Getting Trivy into your pipeline is where it starts paying off - automated, repeatable and reviewed. Here is a working integration and the habits that keep it reliable.
A working pipeline snippet
Fail the build on fixable high/critical CVEs.
- uses: aquasecurity/trivy-action@0.24.0
with:
image-ref: ghcr.io/${{ github.repository }}:${{ github.sha }}
severity: HIGH,CRITICAL
ignore-unfixed: true
exit-code: 1Do this
- Gate on HIGH/CRITICAL with ignore-unfixed, then tighten over time
- Scan images, IaC and filesystems - not just one surface
- Cache and periodically refresh the DB in CI
Avoid this
- Failing on unfixed CVEs and drowning in noise
- Scanning only images and ignoring IaC and secrets
- Never updating the vulnerability DB in air-gapped runners
Want senior help putting Trivy to work - or a team bootcamp on it? CodeWizard runs Israel's largest DevOps community and embeds named senior engineers with a transparent hours log. Book a free consult or explore the Academy.