fixing kv watcher in core and cert issues with tools container #2477
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!2477
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "refs/pull/2477/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: #2015
Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2015
Original created: 2025-11-24T23:55:58Z
Original updated: 2025-11-24T23:58:32Z
Original head: carverauto/serviceradar:2014-bug-serviceradar-core-not-reading-from-secret-for-admin-pw-in-demo-namespace
Original base: main
Original merged: 2025-11-24T23:58:26Z 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
Make KV config watch optional via
CONFIG_WATCH_ENABLEDenvironment variableStrip sensitive auth fields (
local_users,jwt_secret) from KV overlays to preserve secret-derived valuesFix tools container DNS references to use short names instead of FQDN
Generate debug client certificate for tools container with proper SAN entries
Diagram Walkthrough
File Walkthrough
4 files
Add DisableWatch option to core appParse CONFIG_WATCH_ENABLED environment variableGenerate debug client certificate for toolsGenerate debug client certificate for demo environment3 files
Strip sensitive auth fields from KV overlaysApply auth field stripping in KV watchFix DNS references to use short service names1 files
Test auth secrets stripping in overlay config3 files
Add CONFIG_WATCH_ENABLED environment variableAdd CONFIG_WATCH_ENABLED helm template variableAdd configWatchEnabled helm value for core serviceImported GitHub PR comment.
Original author: @qodo-code-review[bot]
Original URL: https://github.com/carverauto/serviceradar/pull/2015#issuecomment-3573202101
Original created: 2025-11-24T23:56:35Z
PR Compliance Guide 🔍
Below is a summary of compliance checks for this PR:
Secrets overlay risk
Description: The list of stripped auth keys in KV overlays is hardcoded to "local_users" and
"jwt_secret", which risks missing other sensitive fields and unintentionally allowing
secrets to be overlaid from KV if field names differ or new fields are added.
kv_client.go [498-532]
Referred Code
🎫 #2014
overridden by KV overlays.
disable or enable watching as needed.
appropriate DNS names/SANs.
KV overlays and during watch updates.
certificate SANs satisfy mTLS handshakes against all services.
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: Security-First Input Validation and Data Handling
Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities
Status: Passed
Generic: Comprehensive Audit Trails
Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.
Status:
Missing audit logs: Newly added sensitive overlay filtering and KV watch behavior do not include explicit
audit logging of critical config changes or watch enablement/disablement, which may be
acceptable if logging is implemented 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/2015#issuecomment-3573203600
Original created: 2025-11-24T23:57:27Z
PR Code Suggestions ✨
Explore these optional code suggestions:
Prevent returning data with secrets
Modify the
dropSensitiveAuthFieldsfunction to returnnilinstead of theoriginal data if JSON marshalling fails, preventing the accidental exposure of
sensitive information.
pkg/config/kv_client.go [525-531]
Suggestion importance[1-10]: 8
__
Why: This suggestion correctly identifies a security flaw where the function could return sensitive data on a marshalling error, and the proposed fix of returning
nilis a robust way to prevent this.Generalize the secret stripping logic
The current method of stripping sensitive fields like
local_usersandjwt_secretis hardcoded. This should be generalized using struct tags or a configuration
list to improve scalability and maintainability.
Examples:
pkg/config/kv_client.go [496-532]
Solution Walkthrough:
Before:
After:
Suggestion importance[1-10]: 7
__
Why: The suggestion correctly identifies a hardcoded list of sensitive fields and proposes a more scalable design, which significantly improves the maintainability of the new configuration overlay logic.