agent fixes #2695
No reviewers
Labels
No labels
1week
2weeks
Failed compliance check
IP cameras
NATS
Possible security concern
Review effort 1/5
Review effort 2/5
Review effort 3/5
Review effort 4/5
Review effort 5/5
UI
aardvark
accessibility
amd64
api
arm64
auth
back-end
bgp
blog
bug
build
checkers
ci-cd
cleanup
cnpg
codex
core
dependencies
device-management
documentation
duplicate
dusk
ebpf
enhancement
eta 1d
eta 1hr
eta 3d
eta 3hr
feature
fieldsurvey
github_actions
go
good first issue
help wanted
invalid
javascript
k8s
log-collector
mapper
mtr
needs-triage
netflow
network-sweep
observability
oracle
otel
plug-in
proton
python
question
reddit
redhat
research
rperf
rperf-checker
rust
sdk
security
serviceradar-agent
serviceradar-agent-gateway
serviceradar-web
serviceradar-web-ng
siem
snmp
sysmon
topology
ubiquiti
wasm
wontfix
zen-engine
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
carverauto/serviceradar!2695
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "refs/pull/2695/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from GitHub pull request.
Original GitHub pull request: #2347
Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2347
Original created: 2026-01-18T09:22:46Z
Original updated: 2026-01-18T09:31:06Z
Original head: carverauto/serviceradar:bug/agent-crashing-kv-removal
Original base: staging
Original merged: 2026-01-18T09:31:04Z by @mfreeman451
User description
IMPORTANT: Please sign the Developer Certificate of Origin
Thank you for your contribution to ServiceRadar. Please note, when contributing, the developer must include
a DCO sign-off statement indicating the DCO acceptance in one commit message. Here
is an example DCO Signed-off-by line in a commit message:
Describe your changes
Issue ticket number and link
Code checklist before requesting a review
PR Type
Bug fix, Enhancement
Description
Fix agent crash caused by KV configuration removal
Remove noisy logging from internal push loop calls
Deprecate and remove legacy polling code from gateway
Add comprehensive documentation of architectural changes
Diagram Walkthrough
File Walkthrough
server.go
Reduce noisy logging from internal callspkg/agent/server.go
internal calls
application.ex
Remove legacy polling modules from supervisorelixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/application.ex
architecture
agent_client.ex
Mark AgentClient module as deprecatedelixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/agent_client.ex
scalability)
task_executor.ex
Mark TaskExecutor module as deprecatedelixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/task_executor.ex
proposal.md
Add comprehensive change proposal documentationopenspec/changes/fix-agent-kv-removal-crash/proposal.md
spec.md
Add agent configuration and push-only specsopenspec/changes/fix-agent-kv-removal-crash/specs/agent-configuration/spec.md
tasks.md
Add implementation tasks and validation checklistopenspec/changes/fix-agent-kv-removal-crash/tasks.md
Imported GitHub PR comment.
Original author: @qodo-code-review[bot]
Original URL: https://github.com/carverauto/serviceradar/pull/2347#issuecomment-3765095206
Original created: 2026-01-18T09:23:33Z
PR Compliance Guide 🔍
Below is a summary of compliance checks for this PR:
Internal-call spoofing
Description: Defaulting a missing
GatewayIdto the literal value"internal"can allow an externalcaller that omits
GatewayIdto be misclassified as an internal call, which could become anauthentication/authorization bypass if any downstream logic treats
"internal"specially(e.g., skips validation, applies different routing/tenancy, or suppresses auditing).
server.go [537-540]
Referred Code
Sensitive data in logs
Description: Logging
req.GetDetails()(even at DEBUG) may expose sensitive or credential-like datacontained in request details to log storage/aggregators, creating a realistic risk of
sensitive information disclosure depending on what clients populate in
details.server.go [1122-1122]
Referred Code
🎫 No ticket provided
Codebase context is not defined
Follow the guide to enable codebase context checks.
Generic: Meaningful Naming and Self-Documenting Code
Objective: Ensure all identifiers clearly express their purpose and intent, making code
self-documenting
Status: Passed
Generic: Secure Error Handling
Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.
Status: Passed
Generic: Comprehensive Audit Trails
Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.
Status: 🏷️
Misleading audit context: Empty
GatewayIdvalues are now force-labeled asinternal, which may reduce the ability toaccurately reconstruct which gateway/origin triggered a status action if external requests
can omit
GatewayId.Referred Code
Generic: Robust Error Handling and Edge Case Management
Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation
Status: 🏷️
Missing edge handling: The code treats missing
GatewayIdas expected and silently overwrites it, but it isunclear whether missing/invalid
GatewayIdshould instead be rejected or handleddifferently for external requests.
Referred Code
Generic: Secure Logging Practices
Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.
Status: 🏷️
Potential sensitive logging: The new DEBUG log line records
req.GetDetails()which may contain sensitive oruser-supplied data and should be verified/redacted before logging.
Referred Code
Generic: Security-First Input Validation and Data Handling
Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities
Status: 🏷️
Trusting missing GatewayId: Assigning
GatewayIdtointernalwhen it is absent may allow unauthenticated or externalcallers to be misclassified unless request provenance is validated elsewhere.
Referred Code
Compliance status legend
🟢 - Fully Compliant🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label
Imported GitHub PR comment.
Original author: @qodo-code-review[bot]
Original URL: https://github.com/carverauto/serviceradar/pull/2347#issuecomment-3765095878
Original created: 2026-01-18T09:24:31Z
PR Code Suggestions ✨
Explore these optional code suggestions:
Use @deprecated attribute
Use the
@deprecatedmodule attribute to generate compiler warnings when thedeprecated
AgentClientmodule is used.elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/agent_client.ex [1-3]
Suggestion importance[1-10]: 7
__
Why: This is a valuable suggestion that uses a language feature (
@deprecated) to enforce the deprecation at compile time, which is more robust than relying solely on documentation.Add GatewayId to debug logs
Add the
GatewayIdto the "Checker request" debug log inhandleDefaultCheckerforbetter traceability.
pkg/agent/server.go [1122]
Suggestion importance[1-10]: 6
__
Why: This is a good suggestion for improving observability. Adding the
gatewayIdto the debug log for checker requests will make it easier to trace requests, especially for distinguishing between internal and external calls.Avoid mutating function input parameters
To avoid mutating the input
reqobject, use a local variable for theGatewayIdinstead of modifying
req.GatewayIddirectly.pkg/agent/server.go [537-540]
Suggestion importance[1-10]: 2
__
Why: The suggestion proposes a valid principle of not mutating input parameters, but the proposed change would require a larger refactoring to pass the new variable down the call stack, which is not shown. The current approach of modifying the request object is a common pattern in Go gRPC handlers and the risk of side effects is low in this context.