Secrets showing up in `docker inspect` output of production containers.
BeginnerScenarioSecurity and scanning
Answer
Situation read → Passed as -e DB_PASSWORD=...; anyone with Docker access can read them, and they land in shell history and CI logs.
What I'd do → Use secrets files (/run/secrets), --env-file with strict permissions at minimum, or fetch at start from Vault/AWS SM. Restrict Docker API access and rotate leaked values.
Why → docker inspect reveals .Config.Env in plain text.
Interview tip → Orchestrator-native secrets beat env vars.
More on Security and scanning
A scan reports 300 CVEs in your base image. How do you triage?IntermediateAdd vulnerability scanning to CI so critical findings block the merge.BeginnerWhy is mounting `/var/run/docker.sock` into a container dangerous?IntermediateA developer asks for `--privileged`. What do you do?IntermediateHarden a container run command for a stateless web API.IntermediateA pentester got root inside a container. How bad is it?Advanced