Skip to main content
InterviewHubPRO
Section Overview
Q31

Question 31 of 50

Part 3: Advanced Internals, Scale & Production Security (Senior / Lead)

62%
Docker & Containers (50 Qs)•Part 3: Advanced Internals, Scale & Production Security (Senior / Lead)

Container Image Vulnerability Scanning and Cryptographic Image Signing.

senior LevelCode ExampleSecurity & AuthDocker & ContainersData Structures

In Simple Words: Production CI/CD pipelines must verify both the integrity and security posture of container images before deployment:

1. Vulnerability Scanning (Trivy / Grype):

Scans OS packages (Debian dpkg, Alpine apk) and language dependencies (package-lock.json, Cargo.lock, go.sum) against the National Vulnerability Database (NVD).

bash
trivy image --severity HIGH,CRITICAL --exit-code 1 myapp:latest

Fails CI builds if unpatched critical CVEs are present.

2. Image Signing & Verification (Sigstore / Cosign):

Ensures that images deployed to production were genuinely built by your trusted CI pipeline and have not been tampered with in the registry:

bash
# 1. Sign image in GitHub Actions using OIDC keyless signing
cosign sign --yes ghcr.io/myorg/myapp:v1.0.0

# 2. Enforce policy in Kubernetes via Kyverno or Gatekeeper
# Rejects Pod admission if cosign signature from authorized issuer is missing!