Skip to content

ci(security): add Trivy filesystem vulnerability scan#1262

Open
MukundaKatta wants to merge 1 commit intoanthropics:mainfrom
MukundaKatta:fix/trivy-ci-1231
Open

ci(security): add Trivy filesystem vulnerability scan#1262
MukundaKatta wants to merge 1 commit intoanthropics:mainfrom
MukundaKatta:fix/trivy-ci-1231

Conversation

@MukundaKatta
Copy link
Copy Markdown

Why

Closes #1231. Several teams using this action need a vulnerability scan in CI to satisfy internal security policies. The issue lists 12 + 5 + 9 + 14 = 40 outstanding HIGH/MEDIUM findings across bun.lock, base-action/bun.lock, base-action/package-lock.json, and base-action/test/mcp-test/bun.lock — there's currently no automated check to surface these on PRs.

What

Adds .github/workflows/trivy.yml:

  • Runs on push to main, every pull request, and workflow_dispatch.
  • Uses aquasecurity/trivy-action@0.36.0 in fs mode against the repo root, scanning all four lockfiles in one pass.
  • Fails the job on HIGH/CRITICAL findings with ignore-unfixed: true (so unactionable advisories don't block merges).
  • Always uploads SARIF to the GitHub Security tab via github/codeql-action/upload-sarif@v3.35.2, even when the gate step fails — so findings show up under Code scanning either way.
  • Pinned action versions (no floating tags), permissions: scoped to contents: read + security-events: write.

Tested

  • This PR will trigger the new workflow on creation; the run will surface any current HIGH/CRITICAL fixable findings (the issue suggests there will be some) and upload SARIF to Security > Code scanning. If the maintainers prefer to land the workflow without immediately gating CI on existing findings, flip exit-code: "1" to "0" in a follow-up — the SARIF upload still works.
  • Workflow lints clean against actionlint conventions used elsewhere in .github/workflows/.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Trivy security audit (vulnerabilities)

1 participant