2057 featsysmon integrate edge onboarding package #2507
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!2507
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "refs/pull/2507/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: #2059
Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2059
Original created: 2025-12-04T18:57:58Z
Original updated: 2025-12-04T19:35:28Z
Original head: carverauto/serviceradar:2057-featsysmon-integrate-edge-onboarding-package
Original base: main
Original merged: 2025-12-04T19:35:25Z 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
Create new
edge-onboardingRust crate mirroring Go package functionalityedgepkg-v1:formatIntegrate edge onboarding into sysmon checker with CLI and environment support
--mtls,--token,--host,--bundle,--cert-dirCLI flagsONBOARDING_TOKEN,CORE_API_URLenvironment variablesAdd comprehensive test coverage with 14 unit tests across all modules
Update Docker image with edge onboarding directories and environment variables
Document edge onboarding usage in README and design specifications
Diagram Walkthrough
File Walkthrough
7 files
Main edge onboarding library with public APIToken parsing for edgepkg-v1 formatCore API package download functionalitymTLS bundle installation and loadingConfiguration generation for sysmon checkerDeployment type detection logicIntegrate edge onboarding with CLI and env support1 files
Error types for edge onboarding operations2 files
New crate manifest with dependenciesAdd edge-onboarding dependency6 files
Comprehensive token parsing unit testsmTLS bundle installation testsConfiguration generation testsDeployment type detection testsPackage download validation testsIntegration tests for public API2 files
Add edge onboarding directories and environment variablesAdd edge-onboarding to workspace members6 files
Document edge onboarding usage and CLI optionsAdd edge onboarding testing playbook with Docker ComposeChange proposal and status documentationDetailed design and architecture documentationFormal requirements and scenarios specificationImplementation tasks and validation checklistImported GitHub PR comment.
Original author: @qodo-code-review[bot]
Original URL: https://github.com/carverauto/serviceradar/pull/2059#issuecomment-3613888712
Original created: 2025-12-04T18:58:57Z
PR Compliance Guide 🔍
Below is a summary of compliance checks for this PR:
Insecure transport fallback
Description: HTTP client errors from Core API (ureq::Error::Transport) are converted to string without
nuanced handling (e.g., timeouts, TLS validation), and ensure_scheme defaults to http://
when no scheme is provided, which could lead to cleartext requests if the token omits
scheme.
download.rs [100-118]
Referred Code
Unsafe file writes
Description: Certificate and key files are written from untrusted bundle content without validation of
PEM format or restricting file ownership, potentially enabling misconfiguration or
privilege issues if paths are attacker-controlled.
bundle.rs [183-196]
Referred Code
🎫 #2057
sysmon-osx capabilities.
mode.
--host, --bundle, --cert-dir) and env vars (ONBOARDING_TOKEN, CORE_API_URL).
support onboarding at runtime.
with generated certs.
host filesystems and container runtimes.
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 Logging Practices
Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.
Status:
Token exposure risk: The code accepts onboarding tokens via --token and environment but logs onboarding success
and SPIFFE ID without masking inputs; combined with other logs and error paths there is no
explicit redaction or guarantee that sensitive tokens or bundle contents are not logged.
Referred Code
Generic: Comprehensive Audit Trails
Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.
Status:
Action logging: New onboarding flows perform critical actions (token use, package download, cert install,
config generation) but rely on info! logs without structured fields for user ID or full
action context, which may be insufficient for audit trail requirements.
Referred Code
Generic: Secure Error Handling
Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.
Status:
Error detail exposure: Core API HTTP errors propagate status and response body directly into errors which may be
surfaced to users, potentially exposing internal details.
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:
URL handling: The ensure_scheme helper auto-prefixes http:// to host values which may unintentionally
downgrade transport security if https is expected, requiring confirmation of intended
security posture.
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/2059#issuecomment-3613893651
Original created: 2025-12-04T19:00:21Z
PR Code Suggestions ✨
Explore these optional code suggestions:
Default to HTTPS for better security
In the
ensure_schemefunction, change the default protocol tohttps://insteadof
http://for better security. An exception can be made to usehttp://forlocalhost addresses.
rust/edge-onboarding/src/download.rs [133-143]
Suggestion importance[1-10]: 8
__
Why: This suggestion correctly identifies a security weakness where the client might communicate over unencrypted HTTP by default. Changing the default to HTTPS is a significant security improvement that aligns with secure-by-default principles.
Improve legacy token parsing logic
In
parse_legacy_token, replacefindwithrfindwhen searching for separators.This makes parsing more robust by splitting on the last occurrence of a
separator, which is a common pattern for
id:tokenformats.rust/edge-onboarding/src/token.rs [96-133]
Suggestion importance[1-10]: 7
__
Why: The suggestion correctly identifies a potential ambiguity in parsing legacy tokens and proposes using
rfindto make the logic more robust. This is a good improvement for handling edge cases where separators might appear in the package ID.Simplify function with redundant match arms
Simplify the
get_storage_pathfunction by removing the redundantmatchstatement, as all deployment types currently resolve to the same storage path.
The first argument can be marked as unused.
rust/edge-onboarding/src/lib.rs [313-326]
Suggestion importance[1-10]: 4
__
Why: The suggestion correctly points out that the
matchstatement is redundant as all arms return the same value. Simplifying it improves conciseness. The impact is minor, but it's a valid code quality improvement.