Been using security scanners since 2018 and most are garbage. They miss CVE-2021-44228
(Log4Shell) then alert about CVE-2007-4559
in Python tarfile that's been "critical" for 15 years. Trivy is different - finds real shit.
What Makes Trivy Not Terrible
Trivy scans your containers, code repos, and Kubernetes clusters for security issues. The big difference is it finds real problems you should actually fix instead of theoretical bullshit that doesn't matter.
Installation doesn't make you want to quit your job: Run brew install trivy
or docker run aquasec/trivy
and you're done. No database setup, no license keys, no "please contact sales" nonsense.
Covers the stuff you actually use: Alpine, Ubuntu, RHEL, whatever Linux distro is in your containers. Java, Python, Node.js, Go - the languages your team actually uses. Package managers too - npm, Maven, pip, Cargo, the whole zoo.
Actually fast: Alpine containers scan in 30 seconds. Spring Boot with 47 JAR files? 8 minutes. Python ML images with TensorFlow 2.13.0 and 50GB of dependencies? Go grab coffee and a sandwich.
Real World Performance
Here's what happens when you run trivy image nginx:1.25.2
:
Alpine base: 30 seconds. Node.js 18 apps: 2-3 minutes. Java Spring Boot 3.1.0 with every dependency known to mankind? 8-15 minutes. Python ML with PyTorch 2.0.1 and Jupyter? Order takeout.
Memory usage: 2GB for normal containers. Java apps need 6-8GB because Spring loads the entire internet. Learned this when Trivy OOMkilled our 4GB Jenkins node scanning one massive Java monolith.
Caching saves your sanity: First scan downloads vulnerability DB (47MB as of October 2024). After that, scans are instant. Without caching, every CI job downloads from scratch and times out. Learned this debugging why our builds randomly failed with timeout after 300s
.
GitLab Actually Said It's Good
GitLab's security team evaluated multiple scanners and called Trivy "a clear leader in the market" which is corporate speak for "this tool doesn't suck." Coming from GitLab, who have tried every security scanner on earth, that actually means something.
Integration That Doesn't Break Your Workflow
CI/CD: Works with GitHub Actions, GitLab CI, Jenkins, Azure DevOps. The GitHub Action is solid - add it to your workflow and it just works. SARIF output integrates nicely with GitHub's security tab.
Kubernetes: The Trivy Operator scans your cluster continuously. It creates Kubernetes resources for vulnerability reports so you can query them with kubectl. Pretty slick if you're into that.
Developer Tools: VS Code extension shows vulnerabilities while you code. Useful for catching issues before they hit your main branch, though it can be noisy if your project has tons of dependencies.
What Actually Breaks
Let's be real - nothing is perfect:
- Large Python images with scikit-learn 1.3.0 and 12GB of ML libraries take 25+ minutes. Use
--skip-files \"**/site-packages/**\"
if you're debugging at 3am. - CLI output looks like someone vomited JSON. Use
--format table
or--format json
and parse it yourself. - Hangs on broken images like
mcr.microsoft.com/windows/servercore:ltsc2019
(yes, specific version). Kill withCTRL+C
and try again. - Air-gapped setups need manual DB downloads. Error:
failed to download vulnerability DB
means you're fucked without internet.
But compared to other security tools that either don't work or require a PhD to configure, Trivy is refreshingly simple. Install it, point it at your container, get results you can actually use.
Most enterprise security tools cost $50k/year and still miss half the vulnerabilities. Trivy is free and finds more issues than most commercial scanners. That's why teams actually use it instead of letting it collect dust like most security purchases.