A team wants a privileged container for Docker-in-Docker builds in Kubernetes CI. What do you offer instead?
BeginnerScenarioContainer and IaC Security
Answer
Situation read → Privileged pods can break out to the node. The need is to build images, not to run Docker.
What I'd do →
- Use BuildKit in rootless mode or Buildah in an unprivileged pod.
- Use a remote builder service (BuildKit daemon, cloud build) outside the cluster.
- Run builders on a separate, tainted node pool with no production credentials.
- Block
privileged: truethrough admission policy elsewhere.
Why → Moving builds off shared nodes isolates the risk.
Interview tip → Say you replace the tool instead of granting the privilege.
More on Container and IaC Security
A team asks whether to use `ubuntu`, `alpine` or a distroless base image. How do you advise?Beginner`trivy image` shows 300 vulnerabilities in your app image. How do you bring this down?BeginnerA Dockerfile runs the app as root. How do you fix it and prove the fix?IntermediateCheckov fails a Terraform PR because an S3 bucket allows public access. What do you change?BeginnerHow do you set up image scanning so nothing vulnerable reaches production?IntermediateAn image passed scanning three weeks ago and runs in production. A new critical CVE is published today. What happens next?Intermediate