2100 bugcore docker agent showing up as docker poller #2541
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!2541
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "refs/pull/2541/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: #2101
Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2101
Original created: 2025-12-11T02:40:31Z
Original updated: 2025-12-11T03:59:43Z
Original head: carverauto/serviceradar:2100-bugcore-docker-agent-showing-up-as-docker-poller
Original base: main
Original merged: 2025-12-11T03:59:40Z 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 device details showing wrong device in Docker environments with shared IPs
Improve SRQL configuration with sensible defaults and environment variable support
Enhance search planner to handle device_id filters when SRQL unavailable
Diagram Walkthrough
File Walkthrough
2 files
Implement database fallback for device registry missesAdd IP detection and prevent device ID IP fallback2 files
Add SRQL configuration defaults and environment variable supportExtract and handle device_id filters in registry search3 files
Test SRQL default configuration normalizationTest IP detection and device ID lookup behaviorTest device_id filter extraction and registry execution2 files
Ensure SRQL configuration in Docker compose setupAdd SRQL configuration to Docker default config1 files
Add registry dependency to search package4 files
Document design decisions for device lookup fixDocument problem analysis and proposed solutionDefine requirements for device ID and IP lookup behaviorTrack implementation tasks and testing requirementsImported GitHub PR comment.
Original author: @qodo-code-review[bot]
Original URL: https://github.com/carverauto/serviceradar/pull/2101#issuecomment-3639802201
Original created: 2025-12-11T02:41:05Z
PR Compliance Guide 🔍
Below is a summary of compliance checks for this PR:
Insecure configuration
Description: SRQL API key is sourced from environment variable without validation or restriction,
risking accidental enablement of external SRQL access if misconfigured; ensure SRQL is
internal-only and that API key usage and transport are secured.
config.go [126-151]
Referred Code
Sensitive information exposure
Description: Script writes SRQL base URL and API key into core.json using jq, which may commit
sensitive API keys to disk in plaintext; consider file permission hardening and avoiding
persisting secrets in config files.
update-config.sh [122-135]
Referred Code
🎫 #2100
Docker environments.
multiple devices share an IP in Docker.
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:
Logging Context: New error paths and fallbacks were added but there is no clear evidence in the diff that
these critical lookup outcomes are consistently logged with user/request context to form
an audit trail.
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:
Env Input Use: New SRQL config reads environment variables directly into configuration without visible
validation or normalization beyond trimming, which may require further review for security
and correctness.
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/2101#issuecomment-3639804435
Original created: 2025-12-11T02:42:19Z
PR Code Suggestions ✨
Explore these optional code suggestions:
✅
Prioritize architectural cleanup over patchingSuggestion Impact:
The commit removes GetMergedDevice, adds a new GetDeviceByIDStrict wrapper, updates the tasks to mark Phase 2 items as completed (deprecation, auditing callers, migration), and retains GetDevicesByIP—aligning with the suggested architectural cleanup rather than patching.code diff:
Instead of patching the flawed
GetMergedDevicefunction, proceed with the "Phase2" architectural cleanup outlined in the design documents. Deprecate
GetMergedDeviceand refactor its callers to use explicitGetDeviceByIDandGetDeviceByIPfunctions to avoid accumulating technical debt.Examples:
pkg/registry/registry.go [2067-2109]
openspec/changes/fix-device-details-wrong-device/tasks.md [22-38]
Solution Walkthrough:
Before:
After:
Suggestion importance[1-10]: 8
__
Why: The suggestion correctly identifies that the PR implements a patch rather than the ideal architectural cleanup described in its own design documents, which adds complexity to a function slated for deprecation.
Allow registry to handle device_id filters
Modify
supportsRegistryto allowdevice_idfilters, enabling the newly addedlogic in
executeRegistryto handle them via the in-memory registry instead ofincorrectly routing to SRQL.
pkg/search/planner.go [312-362]
[To ensure code accuracy, apply this suggestion manually]Suggestion importance[1-10]: 8
__
Why: The suggestion correctly identifies that
supportsRegistryprevents the newdevice_idfilter logic inexecuteRegistryfrom being used, which is a significant bug in the PR's implementation.Respect explicit SRQL disable configuration
Update
ensureSRQLConfigto respect the user's choice to disable SRQL in theconfiguration file, instead of unconditionally enabling it.
pkg/core/config.go [120-137]
[To ensure code accuracy, apply this suggestion manually]Suggestion importance[1-10]: 7
__
Why: The suggestion correctly points out that the current implementation prevents users from disabling the SRQL feature via configuration, which is a valid correctness and usability issue.