I've been seeing a lot of discussions about securing and hardening Docker containers lately. This made me wonder if there's a good tool out there that can inspect Docker configurations or stacks and provide tips for tightening security or optimizing those configs. I use a bunch of Docker containers for different projects—some I've built myself and others I've downloaded. Most aren't exposed to the internet, but a few are. Since time is limited, I'd love any suggestions beyond just general best practices to help me enhance my setup.
4 Answers
I've been enjoying using Trivy for free—as it does a great job with image vulnerability scanning.
You really have to be cautious with these tools. Personally, I think the best security comes from limiting dependencies. Just stick to a base Docker image and avoid adding unnecessary stuff. Keep it simple, and you'll be in a good spot.
In addition to Trivy for CVE scanning, Dockle is handy for checking Dockerfile best practices. But honestly, the most effective strategies may not even need a scanner—use 'cap_drop ALL', avoid mounting docker.sock, and make the root filesystem read-only wherever possible. These three tips really reduce your attack surface.
Consider using Docker Hardened Images from dhi.io as your base. If you're looking for minimal additional tools, Docker Scout can help you scan without much fuss.

Sounds like you're onto something! But there's more to it—check this out: [Oh boy do I have news for you...](https://www.paloaltonetworks.com/blog/cloud-security/trivy-supply-chain-attack/)