Skip to content

fix: run Trivy misconfiguration scanning by setting scan.scanners - #199

Merged
dnlopes merged 1 commit into
mainfrom
fm/reusable-trivy-misconfig-p2
Nov 8, 2026
Merged

dnlopes merged 1 commit into
mainfrom
fm/reusable-trivy-misconfig-p2

Conversation

@dnlopes

@dnlopes dnlopes commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

What

In the inline trivy.yaml of trivy-scan.yaml, scanners sat at the top level, where Trivy ignores it. It only reads scan.scanners. Trivy therefore ran its default scanners (vuln, secret) and misconfiguration scanning never ran. This moves scanners: [vuln, secret, misconfig] under scan:. Nothing else changes (severity, scanner list and the #198 PR diff logic are untouched).

Proof (Trivy 0.69.3, the workflow's default)

A Dockerfile without USER, scanned with the config extracted from the workflow before and after the change:

Config [misconfig] log line Findings
before (top-level scanners) absent none
after (scan.scanners) Misconfiguration scanning is enabled DS-0002

Impact on default branches

Pushes to the default branch fail on every finding, so enabling misconfig can turn main red. I scanned git archive origin/main of each repo under projects/ with the fixed config and each repo's own .trivyignore, read-only. required-trivy applies to the default branch org-wide, so I treated every repo there as covered. The local origin/main refs were not fetched, so they may lag the remote.

Repository Misconfig findings Check IDs
HomeLab 41 KSV-0001 x4, KSV-0012 x4, KSV-0014 x4, KSV-0038 x9, KSV-01010 x2, KSV-0104 x4, KSV-0118 x8, KSV-0125 x6
Vet.Salopes 6 DS-0002 x5, DS-0013 x1
NevesLopes.Backups 2 AWS-0095, DS-0002
Blog.Personal 1 AWS-0011
Blog.TodosParaAMesa 1 AWS-0011
notifications-relay 1 DS-0002
Organization.Setup, Reusable.Workflows, Runner.Images, System.Setup, Taskfiles, claude-code-plugins 0 none

Vet.Salopes also has 11 vulnerability findings that already fail it today, with or without this change. No repo has secret findings.

Merging this will turn main red in the 6 repos with findings until they fix or ignore them. PRs are unaffected for existing findings, because #198 fails them only on findings the PR introduces.

Commit type

fix: (patch). It repairs behavior #198 meant to ship, and no consumer input, output or interface changes. semantic-release moves v1 on merge, so the new scanning reaches required-trivy right away. If that is too disruptive, hold the merge until the repos above are triaged.

@github-actions github-actions Bot added patch Backwards-compatible bug fixes size-S Small size changes fix Solves a bug labels Nov 8, 2026
@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Trivy Security Scan Results

Note

This PR introduces no new findings.


Scan performed by Trivy v0.69.3

@dnlopes
dnlopes merged commit e9b083d into main Nov 8, 2026
4 checks passed
@dnlopes
dnlopes deleted the fm/reusable-trivy-misconfig-p2 branch November 8, 2026 02:58
@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 1.32.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@github-actions github-actions Bot added the released Issue already released label Nov 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Solves a bug patch Backwards-compatible bug fixes released Issue already released size-S Small size changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant