This is an old revision of the document!
Docker - Security - Sign and verify images to mitigate MITM attacks
It is critical to make sure the image we’re pulling is the one pushed by the publisher, and that no one has tampered with it.
- Sign your images with the help of Notary.
- Verify the trust and authenticity of the images you pull.
Tampering may occur over the wire, between the Docker client and the registry, or by compromising the registry of the owner’s account in order to push a malicious image to.
Verify docker images
Docker defaults allow pulling Docker images without validating their authenticity, thus potentially exposing you to arbitrary Docker images whose origin and author aren’t verified.
Make it a best practice that you always verify images before pulling them in, regardless of policy.
To experiment with verification, temporarily enable Docker Content Trust with the following command:
export DOCKER_CONTENT_TRUST=1
Now attempt to pull an image that you know is not signed—the request is denied and the image is not pulled.