Security with Trivy is mostly correct, boring defaults applied consistently. Here is the short list that removes most of the risk.
Safe defaults
- Add Trivy as a required check on pull requests
- Generate SBOMs (CycloneDX/SPDX) for supply-chain visibility
Wire it into the pipeline
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: 1Reinforcing habits
- 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
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.