A developer pulls a random image from Docker Hub for a database tool. How do you decide if it is acceptable?
BeginnerScenarioContainer and IaC Security
Answer
Situation read → Unknown images can contain miners, backdoors or outdated software.
What I'd do →
- Prefer Docker Official Images, Verified Publisher or Docker-Sponsored Open Source.
- Check the Dockerfile source and update frequency.
- Scan it:
trivy image publisher/tool:1.2. - Mirror approved images into the internal registry and pin by digest.
- Block direct pulls from public registries in production.
Why → A curated internal registry gives one place for scanning and control.
Interview tip → Mention pull-through caches as the practical approach.
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