feat(agents): gateway-proxied netprobe add-on delivery + agent host-IP self-registration (#3425) #3526
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!3526
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/netprobe-gateway-addon-delivery"
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?
Two fixes that make worker-node agents fully functional (managed devices running netprobe via the gateway, never the KV).
1. Gateway-proxied native add-on delivery (
475dbc4ab)Agents fetch add-on artifacts THROUGH the agent-gateway over mTLS HTTPS (the same path WASM plugins use) instead of the direct-KV
grpcRemoteStore— so external/NAT'd agents (nokv_address) can run netprobe.download_url/download_tokenonAddonAssignmentConfig.build_addon_assignment_configmints a signed (HMAC) download request viaStorageToken; stripped from the config-version hash so the rotating token doesn't churn it.POST /api/addon-packages/:id/blob/download(token-verified, entitlement-checked against the package's own artifact object_keys via constant-time compare, serves from storage via DataService).download_urlset (mTLS gateway client), else direct store; sha256 + ed25519 signature verified before any disk write.2. Agent host-IP self-registration (
d75ed2f44)Fixes the regression where externally/NAT'd agents never become managed devices.
AgentHelloRequest/ControlStreamHellonow carryhost_ip; the gateway prefers it over the TCP peer IP so DIRE links the agent to the right device record (setsagent_id/is_managed/agentdiscovery source). In-cluster behavior unchanged (falls back to peer IP). Already-orphaned devices self-heal on next Hello.Verified:
go build ./go/...+go test ./go/pkg/agent/...green;mix compile --warnings-as-errors(core + agent_gateway) clean.Note:
make generate-proto-elixir(0.16.0) emits paren-less style + a spuriousproto/flow/dir; the checked-inmonitoring.pb.excarries just the new field lines in the existing format — ifverify-proto-elixirflags drift it's cosmetic, not a contract change.🤖 Generated with Claude Code
Agents fetch native add-on (netprobe) artifacts THROUGH the agent-gateway over HTTPS, exactly like WASM plugins, never touching the KV/object store directly. Five pieces, mirroring the existing WASM-plugin delivery pattern: 1. Elixir proto regen: Monitoring.AddonAssignmentConfig now carries :download_url (16) and :download_token (17) (proto/monitoring.{proto,pb.go} already had them). 2. Control plane (agent_config_generator.ex): build_addon_assignment_config/3 now mints a gateway download request for the selected per-arch artifact via StorageToken.download_addon_request/2 and sets download_url/download_token on the proto. StorageToken gains an addon URL variant (/api/addon-packages/:id/blob/download) reusing the identical signed-token mechanism; only the URL path differs. stable_addon_assignment/1 now strips the per-poll download fields so the rotating token does not churn the config version hash. 3. web-ng (addon_package_controller.ex + router): new POST /api/addon-packages/:id/blob/download in the same :api pipeline as the plugin blob route. Verifies the download token (Storage.verify_token), checks token.id == route :id, fetches the AddonPackage, and serves the blob only if the token's key is one of the package's mirrored artifact object_keys (constant-time), as application/gzip. 4. Agent (addon_activation.go, push_loop_addons.go): when download_url is set, stageAddonArtifactWithClient fetches the artifact over HTTPS via the gateway mTLS client (gatewayArtifactHTTPClient(GatewaySecurity)) with the token in X-ServiceRadar-Plugin-Token, then applies the SAME sha256 + ed25519 signature verification before staging. External agents (no kv_address) no longer hit ErrAddonObjectStoreUnavailable when a download_url is present; direct-store path preserved when it is empty. 5. Seeder (netprobe_addon_package_seeder.ex): when an existing package already has non-empty artifacts (imported/mirrored), the seeder no longer overwrites artifacts or downgrades status via restage; it at most refreshes config_schema. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>lgtm