2023 bugdire internal services not first class devices #2483
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!2483
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "refs/pull/2483/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: #2025
Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2025
Original created: 2025-11-27T16:48:34Z
Original updated: 2025-11-27T16:52:28Z
Original head: carverauto/serviceradar:2023-bugdire-internal-services-not-first-class-devices
Original base: main
Original merged: 2025-11-27T16:52:14Z 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 ICMP metrics attachment to agent devices instead of pollers
Resolve source IP normalization for poller/agent identity reporting
Treat ServiceRadar service updates as authoritative devices bypassing sightings
Add partition parameter to device registration for proper inventory placement
Enhance source IP resolution to check POD_IP, HOST_IP, NODE_IP environment variables
Diagram Walkthrough
File Walkthrough
2 files
ICMP device resolution and agent-based attributionBypass sightings for authoritative service updates5 files
Test ICMP metrics agent device attachmentTest source IP fallback to stored statusUpdate tests for partition parameterTest source IP resolution from environmentTest service devices bypass sightings under identity reconciliation4 files
Source IP resolution and device registration refactoringPass partition to device registration functionsAdd partition parameter to device creation functionsEnhance source IP resolution with environment variables4 files
Remove outdated Beads documentation referencesAdd OpenSpec proposal for service device fixesAdd specification requirements for service device identityAdd implementation tasks and deployment checklist3 files
Update container image SHA tagsUpdate image tags for production deploymentUpdate image tags for staging deploymentImported GitHub PR comment.
Original author: @qodo-code-review[bot]
Original URL: https://github.com/carverauto/serviceradar/pull/2025#issuecomment-3586768289
Original created: 2025-11-27T16:49:15Z
You are nearing your monthly Qodo Merge usage quota. For more information, please visit here.
PR Compliance Guide 🔍
Below is a summary of compliance checks for this PR:
Input validation
Description: ICMP metric processing logs and accepts payload-derived values (e.g., host, response_time)
without strict schema validation or size limits, which could enable log injection or
excessive memory usage if untrusted payloads are passed through.
metrics.go [587-646]
Referred Code
Supply chain risk
Description: Pinning many component images to opaque sha tags without provenance verification or
signatures may risk supply chain integrity if the registry is compromised; ensure images
are trusted and verified.
values.yaml [3-28]
Referred Code
🎫 #2023
to sightings.
in device inventory.
including environment-based fallbacks.
registration and updates.
after promotion and persist in inventory across cycles.
pollers, and that hostnames/IPs are correctly populated.
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: Robust Error Handling and Edge Case Management
Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation
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: Secure Logging Practices
Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.
Status: Passed
Generic: Comprehensive Audit Trails
Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.
Status:
Audit context: New critical flows resolving/normalizing source IPs and registering devices (e.g.,
resolveServiceHostIP, register*AsDevice) add behavior changes without explicit audit/log
entries capturing actor, action, and outcome beyond warnings/info, requiring verification
that upstream logging/audit layers record these actions.
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:
Input validation: The new resolveICMPDevice and ICMP processing pathways derive and propagate IPs/IDs from
environment/metadata without explicit validation beyond normalizeHostIP and net.ParseIP
checks, requiring verification that upstream layers sanitize inputs to prevent injection
or malformed identifiers in device updates.
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/2025#issuecomment-3586772355
Original created: 2025-11-27T16:50:42Z
You are nearing your monthly Qodo Merge usage quota. For more information, please visit here.
PR Code Suggestions ✨
Explore these optional code suggestions:
Prevent data race on shared fields
Add a mutex lock in the
sourceIPmethod to prevent data races when accessingshared
Pollerfields from multiple goroutines.pkg/poller/poller.go [189-211]
Suggestion importance[1-10]: 8
__
Why: The suggestion correctly identifies a potential data race on shared fields
p.resolvedSourceIPandp.config.SourceIPand proposes adding a mutex to ensure thread safety.Fix incorrect IP resolution fallback
Modify
resolveServiceHostIPto ensure it falls back to resolving the IP from thepoller's information if the agent's information does not yield an IP.
pkg/core/pollers.go [1327-1373]
Suggestion importance[1-10]: 7
__
Why: The suggestion correctly identifies a logic flaw where the IP resolution fallback from agent to poller is incomplete, improving the robustness of IP resolution.
Ensure ICMP is always agent-associated
Update
resolveICMPDeviceto always use theagentIDto generate theresolvedDeviceID, ensuring ICMP capabilities are correctly associated with theagent.
pkg/core/metrics.go [801-858]
Suggestion importance[1-10]: 7
__
Why: The suggestion correctly points out that if an
agentIDis present, the ICMP capability should always be associated with that agent, overriding any otherdeviceIDto enforce the PR's goal.Consider a more robust service identity
To make service identity more robust, add an explicit
isAuthoritativebooleanflag to the
DeviceUpdatemodel. This flag should be set upon creation,consolidating the currently distributed logic for identifying authoritative
internal services.
Examples:
pkg/registry/registry.go [2050-2064]
pkg/models/service_registration.go [11-43]
Solution Walkthrough:
Before:
After:
Suggestion importance[1-10]: 7
__
Why: The suggestion correctly identifies that the logic for "authoritative" updates is implicit and spread out, and proposes a valid design improvement to make this explicit in the
DeviceUpdatemodel, which would improve code clarity and maintainability.