Menu

Scan Every Container Before It Ships: Trivy in CI
📰

Scan Every Container Before It Ships: Trivy in CI

DEV Community: devsecops·FlatlinerAtheist | CLI-NERDS·3 days ago
#A6V6Yi5Z
#devtodevsecops#devto#dev#trivy#exit
Reading 0:00
15s threshold

A couple of years ago I got a CVE alert email about a container running in production. Not a new CVE — one that had been public for eight months. The image was fine when we built it; it had just been sitting there while the world moved on. That was the day I stopped treating vulnerability scanning as a nice-to-have and made it a build gate.

The tool I landed on was Trivy — free, open source, absurdly fast, and it doesn't just scan container images. If you have a CI pipeline (and after the GitHub Actions article , you do), this is a thirty-minute upgrade that pays for itself the first time it catches something.

One minute to your first scan

Install is a single binary (or a Docker image if you prefer):

curl -sfL https://get.aquasec.io/trivy | sh

Enter fullscreen mode

Exit fullscreen mode

Then point it at any image:

trivy image nginx:1.27-alpine

Enter fullscreen mode

Exit fullscreen mode

What you get back is a full bill of materials: OS packages, language dependencies (the ones baked into your app…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.