Skip to content

ci: run the adversarial security suite (+ fix capability drift it surfaces)#95

Merged
ndreno merged 1 commit into
mainfrom
ci/security-suite
Jun 30, 2026
Merged

ci: run the adversarial security suite (+ fix capability drift it surfaces)#95
ndreno merged 1 commit into
mainfrom
ci/security-suite

Conversation

@ndreno

@ndreno ndreno commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Belt and suspenders: the security suite now runs in CI

The integration test binaries under crates/barbacane-test/tests/including the entire adversarial security suite (tests/security/) — were never executed in CI. The "Integration Tests" job runs only cargo test -p barbacane-test --lib, so the harness that's central to the recent hardening work (PRs #91#94) gated nothing. The header-timer hang I hit while working on #94 would not have been caught by CI.

What this does

  • New "Security Suite" CI job: a PostgreSQL service (for the authz category, which boots the control plane), downloads the build artifacts (data-plane binary + WASM plugins, already produced by the Build job), builds the control-plane binary, and runs cargo test -p barbacane-test --test security.
  • Deterministic egress in the test harness: TestGateway now sets BARBACANE_ALLOW_INTERNAL_EGRESS explicitly instead of inheriting the ambient env — default allow (so tests reach loopback wiremock upstreams), with a new from_spec_blocked_egress used by the SSRF tests so the guard is what they actually observe. This also fixes local runs that previously 502'd on loopback upstreams.

Real bug the new job immediately caught

jwt-auth and oidc-auth import host_log (the one-time no-audience warning added in #92) but never declared the log capability, so they fail to load under WASM capability enforcement. Both manifests now declare log. I audited all 33 plugins against their built wasm — no other capability drift.

Verification

Full security suite green locally: 21 passed, 4 ignored (the 4 are blocked-by-design, e.g. needing an adversarial fixture plugin). cargo fmt --all --check clean; ci.yml validated.

Follow-up (not in this PR)

Broadening CI to the rest of the integration binaries (proxy/plugins/streaming/workload) is a larger effort — some need Kafka/NATS services and a flakiness pass. Filing separately.

…aces

The integration test binaries under crates/barbacane-test/tests/ (including the
entire adversarial security suite) were never run in CI — the "Integration
Tests" job runs only `cargo test -p barbacane-test --lib`. That meant the
security harness central to the recent hardening work gated nothing.

- Add a "Security Suite" CI job: PostgreSQL service (for the authz category),
  downloads the build artifacts (data-plane binary + WASM plugins), builds the
  control-plane binary, and runs `cargo test -p barbacane-test --test security`.
- TestGateway now sets BARBACANE_ALLOW_INTERNAL_EGRESS explicitly instead of
  inheriting the ambient env: default allow (so tests can reach loopback mocks),
  with `from_spec_blocked_egress` for the SSRF tests so the egress guard is what
  they actually observe. This also fixes local runs that previously 502'd on
  loopback upstreams.

Fixes the suite immediately flagged:
- jwt-auth and oidc-auth import host_log (the no-audience warning added earlier)
  but did not declare the `log` capability, so they failed to load under WASM
  capability enforcement. Declare `log` in both manifests. Audited all 33
  plugins: no other capability drift.
@ndreno ndreno merged commit 05a8959 into main Jun 30, 2026
13 checks passed
@ndreno ndreno deleted the ci/security-suite branch June 30, 2026 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant