Interview Prep/DevSecOps/Container and IaC Security

How do you control which images may run in a cluster of 200 teams?

AdvancedScenarioContainer and IaC Security
Answer

Situation read → You need central policy that does not slow teams down and cannot be bypassed from kubectl.

What I'd do →

  1. Allow only approved registries via admission control (Kyverno or Gatekeeper).
  2. Require cosign signatures from the CI identity using keyless verification:
verifyImages:
  - imageReferences: ["registry.example.com/*"]
    attestors:
      - entries:
          - keyless:
              issuer: https://token.actions.githubusercontent.com
              subject: https://github.com/example-org/*
  1. Roll out in Audit mode first, publish reports, then switch to Enforce.
  2. Provide exemptions by namespace label with expiry.

Why → Admission is the last gate before execution.

Interview tip → Mention audit-before-enforce rollout.

All DevSecOps questions Roadmap: Policy as code

More on Container and IaC Security