intermediateContainer Security: Non-Root, Secrets, Image Scanning & Distroless

A security audit flags that database credentials are visible via `docker inspect` on production hosts

The app's compose.yaml passes DB_PASSWORD via `environment:`. Propose a remediation plan. Expected reasoning: migrate to file-based secret delivery — Docker secrets (Swarm) or, more realistically for most teams, an external secrets manager (Vault/AWS Secrets Manager) that the application fetches from at startup, or Kubernetes Secrets mounted as files if already on K8s. Update the application to read from a file path (or fetch at boot) rather than expecting an env var, then remove the plaintext password from compose.yaml and any committed .env files; rotate the exposed credential as part of rem

This is a Pro chapter

Sign in, then upgrade to Pro or Power to unlock this and the full DevOps Mastery library.

A security audit flags that database credentials are visible via `docker inspect` on production hosts

Next Step

Continue to An image scan suddenly reports a dozen new Critical CVEs on an image that hasn't changed in months← Back to all Docker questions