feat(dependency-firewall): add job-level proxy for CI jobs

What

Adds glab dependency-firewall job-proxy: a job-level Dependency Firewall proxy that a CI/CD job starts once and routes all of its traffic through, instead of wrapping each package-manager command (glab dependency-firewall npm, … pip, …).

default:
  before_script:
    - eval "$(glab dependency-firewall job-proxy start)"
script:
  - npm ci
  - pip install -r requirements.txt
  - mvn -B verify
  - glab dependency-firewall ci-summary   # fails the job if anything was blocked

This is the "T2" tier of Dependency Firewall native enforcement: broader coverage than the per-manager shims (it also catches non-package-manager traffic such as a raw curl of a tarball), with no runner privilege required (unlike the transparent runner sidecar).

Commands

  • job-proxy start — runs the proxy as a detached daemon, installs the proxy CA into the system trust store, and prints export lines to route the job and trust the proxy. Use with eval "$(…)".
  • job-proxy stop — stops the daemon (the job's container teardown also stops it).
  • proxy serve (hidden) — the daemon body that start spawns.

Composition — it does not clobber the caller's config

  • Routing: points HTTP(S)_PROXY and each manager's own routing variables at the proxy; preserves the caller's NO_PROXY; exempts the GitLab instance (CI_SERVER_HOST) so git/API traffic is never intercepted.
  • Corporate egress proxy: the daemon keeps the caller's original HTTP(S)_PROXY, so the proxy's upstream transport chains to it (via http.ProxyFromEnvironment, honoring NO_PROXY and credentials).
  • Trust is additive: installs the proxy CA into the system trust store (covers curl, git, wget, OpenSSL, apt) and, for tools that read a CA bundle instead, writes a merged bundle (system roots + the caller's existing bundles + the proxy CA). Maven and Gradle get a generated settings.xml and a JVM trust store (PKCS#12, folding in the system roots).

Reliability

  • One composite matcher covers every supported ecosystem from a single proxy.
  • Each verdict is written to .gitlab/df/ci-log.json the instant it is recorded (a new WithVerdictHook), before the blocked response reaches the client — so a ci-summary that runs immediately after a blocked install never races the proxy. A 1 s flush remains as a backstop.

Verified end-to-end (GDK)

One proxy per job, against a "block malicious packages" policy:

Ecosystem Allowed Blocked Result
npm is-number ✓ left-pad@1.3.0 → 403 job failed (exit 3)
pip idna ✓ six → 403 job failed (exit 3)
maven commons-lang3:3.14.0 ✓ commons-lang:2.6 → 403 job failed (exit 3)
raw curl — tarball → HTTP 403 coverage beyond per-manager shims

Follow-ups (not in this MR)

  • Upload/publish coverage through the composite matcher (body-read ordering).
  • A synchronous job-proxy stop that waits for the final flush.
  • Documentation page under docs/source/dependency-firewall/.
Edited by Ryan Wells

Merge request reports

Loading
Loading