New compliance-agent/src/pipeline/public_http.rs (PublicHttp) follows the nuget_license pattern:
client from guarded_client_builder (approved addresses only, redirects re-checked, no proxy)
NetGuard::check_url before every request
10 s per request, 5 s connect
bodies capped at 16 MiB (streamed, plus a Content-Length precheck)
CveScanner uses it for OSV querybatch and vulns/{id} and for NVD per-CVE requests, and so does nvd_cpe::product_cves for NVD CPE product queries. NVD requests keep the 30 s they had on the old shared client, because a product query returns up to 2,000 CVEs and NVD is slow without a key. A URL the guard refuses is not retried.
CveScanner::new(guard, nvd_api_key) -> Result<Self, CoreError> now takes the agent's NetGuard instead of a client. Callers:
orchestrator, scan and PLC paths: uses ?, so a client that can't be built fails the scan instead of falling back to a default client
CVE monitor in scheduler.rs: logs and skips
Removed:
search_context (SearXNG): dead code, and an internal SearXNG would now be refused anyway. SEARXNG_URL is left in core config as a deliberate leftover.
PipelineOrchestrator's http field and new parameter, which had no other user.
Audit of other reqwest clients in compliance-agent
headless Chrome for PDFs (pentest/report/pdf.rs, reqwest::get)
Subprocess egress (Syft remote license lookups, lockfile generation) goes over each tool's own HTTP and is documented, not guarded.
docs/reference/tools.md has a new "Outbound connections (egress)" section listing every destination, what is sent, the module, the guard, the limits and the switch.
Tests
cve::tests::osv_on_an_internal_address_is_refused: OSV stand-in on loopback with a public-only guard. The scan errors and no request arrives.
osv_answers_are_read_through_the_guarded_client: the same stand-in with allow_private works end to end.
Closes #469.
## Change
- New `compliance-agent/src/pipeline/public_http.rs` (`PublicHttp`) follows the `nuget_license` pattern:
- client from `guarded_client_builder` (approved addresses only, redirects re-checked, no proxy)
- `NetGuard::check_url` before every request
- 10 s per request, 5 s connect
- bodies capped at 16 MiB (streamed, plus a `Content-Length` precheck)
- `CveScanner` uses it for OSV `querybatch` and `vulns/{id}` and for NVD per-CVE requests, and so does `nvd_cpe::product_cves` for NVD CPE product queries. NVD requests keep the 30 s they had on the old shared client, because a product query returns up to 2,000 CVEs and NVD is slow without a key. A URL the guard refuses is not retried.
- `CveScanner::new(guard, nvd_api_key) -> Result<Self, CoreError>` now takes the agent's `NetGuard` instead of a client. Callers:
- orchestrator, scan and PLC paths: uses `?`, so a client that can't be built fails the scan instead of falling back to a default client
- CVE monitor in `scheduler.rs`: logs and skips
- Removed:
- `search_context` (SearXNG): dead code, and an internal SearXNG would now be refused anyway. `SEARXNG_URL` is left in core config as a deliberate leftover.
- `PipelineOrchestrator`'s `http` field and `new` parameter, which had no other user.
## Audit of other `reqwest` clients in compliance-agent
Already guarded:
- nuget.org (`sbom/nuget_license.rs`)
- Gitea git source and tracker
- DAST/pentest tools (`compliance-dast`)
- git clones (`check_git_url` + resolved-address check)
Left on plain clients on purpose. These are operator-configured (env) and usually on the internal network, which the guard refuses by design:
- LLM gateway (`llm/`, `LITELLM_URL`)
- tenant registry (`registry.rs`)
- OSCAL backend (`controls/oscal_provider.rs`, `controls/scan_triage.rs`)
- GitLab/Jira trackers (`GITLAB_URL`, `JIRA_URL`)
- pentest test-user cleanup (Keycloak/Auth0/Okta, `pentest/cleanup.rs`, `pentest/orchestrator.rs`)
- headless Chrome for PDFs (`pentest/report/pdf.rs`, `reqwest::get`)
Subprocess egress (Syft remote license lookups, lockfile generation) goes over each tool's own HTTP and is documented, not guarded.
`docs/reference/tools.md` has a new "Outbound connections (egress)" section listing every destination, what is sent, the module, the guard, the limits and the switch.
## Tests
- `cve::tests::osv_on_an_internal_address_is_refused`: OSV stand-in on loopback with a public-only guard. The scan errors and no request arrives.
- `osv_answers_are_read_through_the_guarded_client`: the same stand-in with `allow_private` works end to end.
- `nvd_cpe::tests::an_internal_address_is_refused_and_not_retried`
- `public_http::tests`: loopback, RFC 1918, link-local/metadata and IPv6 loopback are refused, and `localhost` never connects.
- Redirect re-checking is covered in `compliance-core::guarded_net`.
- Ran `cargo fmt`, `cargo clippy -p compliance-agent --all-targets -D warnings` and `cargo test -p compliance-agent --lib`.
Touches `orchestrator.rs` next to #474 (#460). It will be rebased after that merges.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
The CVE scanner asked api.osv.dev (querybatch, vulns/{id}) and NVD (per
CVE, per CPE product) with the agent's plain HTTP client. Every other
outbound call to an address the agent does not fully control is already
guarded, and since #468 the nuget.org license lookup is too.
New pipeline/public_http.rs (PublicHttp), the nuget_license pattern:
a guarded_client_builder client (approved addresses only, redirects
re-checked, no proxy), NetGuard::check_url before every request, 10 s
per request, 5 s connect, bodies capped at 16 MiB. CveScanner and
nvd_cpe::product_cves use it. NVD requests keep 30 s, as on the old
shared client (a product query returns up to 2,000 CVEs). A URL the
guard refuses is not retried.
CveScanner::new takes the agent's NetGuard instead of a client. The
dead search_context (SearXNG) is removed: it was never called, and an
internal SearXNG would be refused by the guard anyway. The orchestrator's
http field had no other user and is gone.
Audited every other reqwest client in compliance-agent. The LLM gateway,
tenant registry, OSCAL backend, GitLab/Jira trackers, identity providers
(pentest cleanup) and headless Chrome are operator-configured and often
internal, so they stay on plain clients. docs/reference/tools.md now
lists all egress in one place.
Tests: the OSV stand-in on loopback is refused with a public-only guard
(no request reaches it) and answers with allow_private. An NVD product
query to loopback is refused and not retried. check_url refuses
loopback, RFC 1918, link-local and metadata addresses, and a name that
resolves to loopback is refused when connecting.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Closes #469.
Change
compliance-agent/src/pipeline/public_http.rs(PublicHttp) follows thenuget_licensepattern:guarded_client_builder(approved addresses only, redirects re-checked, no proxy)NetGuard::check_urlbefore every requestContent-Lengthprecheck)CveScanneruses it for OSVquerybatchandvulns/{id}and for NVD per-CVE requests, and so doesnvd_cpe::product_cvesfor NVD CPE product queries. NVD requests keep the 30 s they had on the old shared client, because a product query returns up to 2,000 CVEs and NVD is slow without a key. A URL the guard refuses is not retried.CveScanner::new(guard, nvd_api_key) -> Result<Self, CoreError>now takes the agent'sNetGuardinstead of a client. Callers:?, so a client that can't be built fails the scan instead of falling back to a default clientscheduler.rs: logs and skipssearch_context(SearXNG): dead code, and an internal SearXNG would now be refused anyway.SEARXNG_URLis left in core config as a deliberate leftover.PipelineOrchestrator'shttpfield andnewparameter, which had no other user.Audit of other
reqwestclients in compliance-agentAlready guarded:
sbom/nuget_license.rs)compliance-dast)check_git_url+ resolved-address check)Left on plain clients on purpose. These are operator-configured (env) and usually on the internal network, which the guard refuses by design:
llm/,LITELLM_URL)registry.rs)controls/oscal_provider.rs,controls/scan_triage.rs)GITLAB_URL,JIRA_URL)pentest/cleanup.rs,pentest/orchestrator.rs)pentest/report/pdf.rs,reqwest::get)Subprocess egress (Syft remote license lookups, lockfile generation) goes over each tool's own HTTP and is documented, not guarded.
docs/reference/tools.mdhas a new "Outbound connections (egress)" section listing every destination, what is sent, the module, the guard, the limits and the switch.Tests
cve::tests::osv_on_an_internal_address_is_refused: OSV stand-in on loopback with a public-only guard. The scan errors and no request arrives.osv_answers_are_read_through_the_guarded_client: the same stand-in withallow_privateworks end to end.nvd_cpe::tests::an_internal_address_is_refused_and_not_retriedpublic_http::tests: loopback, RFC 1918, link-local/metadata and IPv6 loopback are refused, andlocalhostnever connects.compliance-core::guarded_net.cargo fmt,cargo clippy -p compliance-agent --all-targets -D warningsandcargo test -p compliance-agent --lib.Touches
orchestrator.rsnext to #474 (#460). It will be rebased after that merges.🤖 Generated with Claude Code
https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
The CVE scanner asked api.osv.dev (querybatch, vulns/{id}) and NVD (per CVE, per CPE product) with the agent's plain HTTP client. Every other outbound call to an address the agent does not fully control is already guarded, and since #468 the nuget.org license lookup is too. New pipeline/public_http.rs (PublicHttp), the nuget_license pattern: a guarded_client_builder client (approved addresses only, redirects re-checked, no proxy), NetGuard::check_url before every request, 10 s per request, 5 s connect, bodies capped at 16 MiB. CveScanner and nvd_cpe::product_cves use it. NVD requests keep 30 s, as on the old shared client (a product query returns up to 2,000 CVEs). A URL the guard refuses is not retried. CveScanner::new takes the agent's NetGuard instead of a client. The dead search_context (SearXNG) is removed: it was never called, and an internal SearXNG would be refused by the guard anyway. The orchestrator's http field had no other user and is gone. Audited every other reqwest client in compliance-agent. The LLM gateway, tenant registry, OSCAL backend, GitLab/Jira trackers, identity providers (pentest cleanup) and headless Chrome are operator-configured and often internal, so they stay on plain clients. docs/reference/tools.md now lists all egress in one place. Tests: the OSV stand-in on loopback is refused with a public-only guard (no request reaches it) and answers with allow_private. An NVD product query to loopback is refused and not retried. check_url refuses loopback, RFC 1918, link-local and metadata addresses, and a name that resolves to loopback is refused when connecting. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsBe5244e47b1to96ed730ffe