Interview Prep/CI/CD/Supply Chain and Pipeline Security

How would you build an end-to-end secure pipeline for a container service?

AdvancedProductionSupply Chain and Pipeline Security
Answer
  1. PR: secret scan, SAST (CodeQL/Semgrep), SCA, IaC scan, lint, tests; actions pinned; read-only token.
  2. Build on an ephemeral, isolated runner from a pinned builder image; reproducible-friendly Dockerfile; digest-pinned base.
  3. Scan the image; fail on fixable criticals/highs.
  4. Generate SBOM; sign image by digest (cosign keyless); attach provenance and SBOM attestations.
  5. Push to the registry with immutable tags.
  6. Deploy via GitOps; admission policy verifies signature, issuer identity and provenance.
  7. Runtime: least-privilege service account, read-only root FS, network policies, runtime detection (Falco).
  8. Continuous rescan of deployed images; SBOM store for impact analysis.
flowchart LR
  A["Commit"] --> B["Secret scan, SAST, SCA"]
  B --> C["Build on ephemeral runner"]
  C --> D["Image scan + SBOM"]
  D --> E["Sign + attest provenance"]
  E --> F["Push immutable tag"]
  F --> G["GitOps deploy"]
  G --> H["Admission verifies signature"]
All CI/CD questions

More on Supply Chain and Pipeline Security