Skip to content

Add Trivy vulnerability scan to PR checks - #7

Open
ngpayyappilly wants to merge 1 commit into
mainfrom
claude/trivy-scan
Open

ngpayyappilly wants to merge 1 commit into
mainfrom
claude/trivy-scan

Conversation

@ngpayyappilly

Copy link
Copy Markdown
Owner

Summary

There was no vulnerability scanning anywhere in CI. This scans the freshly built amd64 image in the PR workflow (the vulnerability DB is arch independent, so one arch is enough).

  • Report step: lists fixable HIGH and CRITICAL findings in the job log; never fails.
  • Gate step: fails the PR on fixable CRITICAL only. Rationale: an upstream HIGH disclosure should not wedge unrelated PRs. Tighten to HIGH later if it proves quiet.
  • ignore-unfixed: true so only actionable findings count.
  • .trivyignore is added for justified suppressions (with expiry); it is part of the workflow paths filter.
  • The action is pinned by commit SHA (# v0.36.0); Dependabot (Add Dependabot for base image and GitHub Actions #5) keeps it current.

Testing

actionlint passes locally. I could not run Trivy against the image because there is no Docker daemon in my environment, so the first CI run on this PR is the real test. Expect it to possibly surface existing findings in the Go-built binaries (kubectl, stern, yq, grpcurl). If the gate fails for something with no available fix, add it to .trivyignore with a reason and expiry rather than weakening the gate.

Follow-ups (separate PRs)

  • Scheduled weekly rebuild plus scan of the published image (so new CVEs against the existing image are noticed).
  • SARIF upload to the Security tab (needs security-events: write and code scanning enabled).

Part of an SRE review series (supply chain).


Generated by Claude Code

Scan the freshly built amd64 image. Report fixable HIGH+ findings in the
job log and fail the PR only on fixable CRITICAL, so an upstream HIGH
disclosure does not block unrelated PRs. Suppressions go in .trivyignore
with a justification and expiry. The action is pinned by commit SHA.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014iDTyB5N8EdZyyZo4ymUVR

This branch has not been deployed

No deployments
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.

2 participants