edge onboarding improvements #2535
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!2535
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "refs/pull/2535/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: #2094
Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2094
Original created: 2025-12-10T04:47:50Z
Original updated: 2025-12-10T05:11:24Z
Original head: carverauto/serviceradar:update/rust_edge_onboarding
Original base: main
Original merged: 2025-12-10T05:11:24Z 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
Enhancement
Description
Add host override functionality to token parsing for flexible deployment
Implement
apply_host_override()function to replace hostnames while preserving scheme and portAdd comprehensive test coverage for host override scenarios
Document service integration requirements and future enhancements in proposal
Diagram Walkthrough
File Walkthrough
token.rs
Implement host override logic for token URLsrust/edge-onboarding/src/token.rs
--hostflag is providedapply_host_override()function that intelligently handleshostname replacement while preserving scheme and port
default port assignment
internal hostnames
token_tests.rs
Add comprehensive host override test coveragerust/edge-onboarding/tests/token_tests.rs
preservation
proposal.md
Document service integration proposal and requirementsopenspec/changes/add-rust-edge-onboarding-service-integration/proposal.md
Rust edge-onboarding
--mtls-bootstrap-onlymode for zero-touch deployment withsystemd/launchd support
for systemd integration
pollers
Imported GitHub PR comment.
Original author: @qodo-code-review[bot]
Original URL: https://github.com/carverauto/serviceradar/pull/2094#issuecomment-3635368488
Original created: 2025-12-10T04:48:20Z
PR Compliance Guide 🔍
Below is a summary of compliance checks for this PR:
IPv6/port mishandling
Description: Port detection uses a simplistic
rsplit(':')on the authority which misinterprets IPv6addresses (e.g.,
[2001:db8::1]:8090) and any colon in the hostname, potentially extractingan incorrect port and constructing a wrong target URL, enabling SSRF-style redirection to
unintended hosts/ports.
token.rs [168-213]
Referred Code
URL parsing/validation
Description: The custom URL construction in
apply_host_override()lacks robust parsing andnormalization (e.g., no RFC-compliant URL parser, no validation/encoding), which can allow
crafted inputs like malformed hosts or embedded credentials (
user@host, path/queryfragments, or IPv6 literals with colons) to produce unintended endpoints or bypass
expected port/scheme handling.
token.rs [167-215]
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: 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:
No auditing: New logic overriding token core_url lacks any audit/log trail of the critical action
applied, making it unclear who/when/how overrides occurred.
Referred Code
Generic: Robust Error Handling and Edge Case Management
Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation
Status:
URL parsing edgecases: The manual URL parsing in apply_host_override may mishandle edge cases (IPv6, usernames,
paths, query/fragment) without validation or error handling.
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:
Unvalidated override: The host override string is accepted and used to construct URLs without normalization or
validation, potentially enabling SSRF or invalid URL injection.
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/2094#issuecomment-3635370795
Original created: 2025-12-10T04:49:21Z
PR Code Suggestions ✨
Explore these optional code suggestions:
Preserve URL path during host override
Update the host override logic to preserve the path and query string from the
original URL. The current implementation incorrectly drops them, which can break
API requests.
rust/edge-onboarding/src/token.rs [193-214]
Suggestion importance[1-10]: 9
__
Why: The suggestion correctly identifies a significant bug in the new
apply_host_overridefunction where the URL path is discarded, which would likely cause API requests to fail.Use a URL parsing library
Replace the manual string-based URL parsing in
apply_host_overridewith adedicated URL parsing library like the
urlcrate. This will make theimplementation more robust and handle edge cases correctly.
Examples:
rust/edge-onboarding/src/token.rs [167-215]
Solution Walkthrough:
Before:
After:
Suggestion importance[1-10]: 8
__
Why: The suggestion correctly identifies that the manual URL parsing in
apply_host_overrideis fragile and proposes using a dedicated library, which would significantly improve the robustness and correctness of this core functionality.