You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the GCP registry auth was removed from entrypoint-worker.sh (part of #366), the baseline became: CI build images must be on public registries. This issue tracks providing a secure way to pull from private registries in CI jobs without relying on the GCP metadata server.
Problem
entrypoint-worker.sh previously fetched a ci-runner SA token from http://metadata.google.internal/ and configured ~/.docker/config.json for buildkitd. This was removed because:
Build containers running with --oci-worker-net=host can reach the metadata server
This gave untrusted user code access to the full ci-runner SA token
Options
Token broker sidecar — A privileged sidecar outside the user network namespace mints short-lived, registry-scoped tokens and serves them to buildkitd via a local socket. Build containers cannot reach the broker. Related to the token broker approach in Redesign BuildKit registry cache with per-tenant scoping and short-lived tokens #365.
Pre-fetched credentials before network lockdown — Fetch registry credentials before the iptables block goes up (169.254.169.254 DROP), then immediately drop the metadata server. User code starts after the block is in place and cannot fetch fresh tokens, but buildkitd already has a short-lived token cached.
Per-job OIDC token exchange — Worker exchanges its request_token for a short-lived Artifact Registry token via docstore API, injects it into buildkitd config before execution.
Background
When the GCP registry auth was removed from
entrypoint-worker.sh(part of #366), the baseline became: CI build images must be on public registries. This issue tracks providing a secure way to pull from private registries in CI jobs without relying on the GCP metadata server.Problem
entrypoint-worker.shpreviously fetched aci-runnerSA token fromhttp://metadata.google.internal/and configured~/.docker/config.jsonfor buildkitd. This was removed because:--oci-worker-net=hostcan reach the metadata serverci-runnerSA tokenOptions
Token broker sidecar — A privileged sidecar outside the user network namespace mints short-lived, registry-scoped tokens and serves them to buildkitd via a local socket. Build containers cannot reach the broker. Related to the token broker approach in Redesign BuildKit registry cache with per-tenant scoping and short-lived tokens #365.
Pre-fetched credentials before network lockdown — Fetch registry credentials before the iptables block goes up (
169.254.169.254DROP), then immediately drop the metadata server. User code starts after the block is in place and cannot fetch fresh tokens, but buildkitd already has a short-lived token cached.Per-job OIDC token exchange — Worker exchanges its
request_tokenfor a short-lived Artifact Registry token via docstore API, injects it into buildkitd config before execution.User-supplied registry auth in ci.yaml — Jobs declare their own registry credentials (e.g. via Workload Identity Federation using the job's OIDC token from feat: CI job OIDC identity — bind check run identities for external service authentication #283), keeping system credentials entirely out of the picture.
Related
DOCSTORE_OIDC_REQUEST_TOKENto authenticate to GCP themselves)