Choose and maintain a trusted base image
Use an image from a known publisher and check its support policy. Pin the image by digest where your workflow supports it so builds use the intended content.
Remove packages, shells and tools that the application does not need. Smaller images reduce maintenance work and the number of components to review.
Keep secrets and privileges out of the image
Do not bake credentials into image layers. Supply secrets at runtime through a controlled mechanism. A deleted secret can remain in an earlier image layer.
Run the container with the least privileges required. Avoid privileged mode and unnecessary host mounts.
Rebuild and verify releases
Rebuild images when base packages need a security update. Scan the final image and review findings before deployment.
Check the image digest and deployment record in production. Remove old images and credentials when they are no longer required.
