Docker interview question · Most asked

What is a software supply chain attack on containers, and how do you defend against it?

Summary

An attacker compromises something you build from rather than your code directly: a malicious or typo-squatted base image, a compromised dependency, a tampered CI pipeline, or a pushed image replaced in a registry. Defences: trusted, pinned sources; vulnerability and malware scanning; signed images with signature verification before deploy; SBOMs and provenance attestations; and locked-down CI and registries.

Longer Answer

Frameworks such as SLSA describe levels of build integrity. Practical steps: use official or verified-publisher images and internal mirrors; pin by digest; generate provenance with BuildKit (--provenance, --sbom); sign with Sigstore cosign; verify signatures at admission in Kubernetes (Kyverno, policy-controller); enable registry tag immutability; and require least-privilege, short-lived credentials in CI.

Key Points

  • Attacks via bases, dependencies, CI, registries.
  • Pin, scan, sign, verify.
  • SBOM and provenance (SLSA).
  • Locked-down CI and registries.

More most-asked Docker questions

← All Docker questions