Supply-chain admission
Distinguish pull access from approval
A private registry authenticates image pulls; that does not establish a trusted build or acceptable vulnerability status. Kubernetes can use a namespaced imagePullSecret referenced by a Pod or its ServiceAccount. The Secret must exist in the Pod namespace and contain appropriate registry credentials. This example references a fictional name without creating credentials. Do not copy production tokens into YAML, logs or source control. Registry pull failures and admission denials are different diagnostic paths.
spec: imagePullSecrets: - name: bookstore-registry-pull containers: - name: catalog image: registry.example.invalid/bookstore/catalog@sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaDesign an explicit admission decision
An admission verifier can enforce policies on images before a request is persisted. An optional tool such as Sigstore policy-controller checks supply-chain evidence; Kubernetes does not automatically verify Cosign signatures merely because a digest is present. Define scope, allowed registry and repository, digest requirement, trusted certificate issuer and signer, required attestation predicate and expected builder/source. Check all relevant workload image fields including init containers and applicable ephemeral container updates. Test actual coverage for the installed controller and policy configuration.
Illustrative decision: allow only when scope, digest, signature, identity, provenance and scan policy all passVerify claims rather than accepting a green badge
Cosign can verify container signatures using expected certificate identity and issuer for keyless signing; trusted key verification is another model. Attestation verification is separate and must evaluate the subject and required predicate claims. Trust roots and transparency evidence must be verified according to the chosen trust policy. A broad identity wildcard can accept an unintended signer. The following is a static command illustration with non-resolving names; do not execute it against a real registry without authorization and pinned tooling.
cosign verify --certificate-identity https://ci.example.invalid/bookstore/release --certificate-oidc-issuer https://issuer.example.invalid registry.example.invalid/bookstore/catalog@sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaHandle vulnerabilities and exceptions deliberately
Use a policy with an explicit freshness window, severity criteria and an accountable exception process. Assess affected component, exploitability in the workload, available fixes and compensating controls. The fixture rejects a stale or missing scan and unresolved high/critical findings unless an approved, scoped, unexpired exception covers that specific finding and digest. An exception is not evidence that a vulnerability disappeared. Promote a rebuilt, rescanned and newly verified digest instead of changing an existing approval record.
Example: scan age 30 hours; maximum 24 hours → require fresh evidencePlan failures and verify enforcement
A webhook outage may reject requests or allow them to continue depending on configured failure behavior. Choose and test availability, timeouts, scope and emergency governance with the platform owner. A fail-closed verifier can block releases during outages; a fail-open path can admit unverified artifacts. Existing workloads are not retroactively made safe by new admission rules, and runtime isolation, network controls and monitoring remain necessary. Verify both positive and negative admission requests in a disposable cluster before production.
Admission accepted ≠ image pulled ≠ container started ≠ application safePractice: a staged promotion gate
Review lab-fixtures/supply-chain/admission-cases.json and pod.yaml. Predict allowed or denied requests under the fictional release policy. For each rejection explain the failed condition and a safe remediation. Keep the fixture offline: the placeholder registry cannot provide real images, and the checker is not a webhook, scanner or policy-controller. In an authorized future lab, pin controller, Cosign and scanner versions and database snapshot, verify actual enforcement and record observed responses.
python lab-fixtures/supply-chain/validate_offline.pyFurther reading
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Supply-chain admission — knowledge check
Interpret fictional release evidence.
What is the role of imagePullSecrets?
An approved image has a scan older than the fictional policy permits. What next?
Which exception is acceptable under the example policy?
What does a successful admission decision prove?
How should a patched dependency be promoted?