Skip to content

ci(trivy): report image CVEs from dev to code scanning - #145

Closed
spydisec wants to merge 2 commits into
devfrom
spydisec-patch-2
Closed

spydisec wants to merge 2 commits into
devfrom
spydisec-patch-2

Conversation

@spydisec

@spydisec spydisec commented Nov 16, 2026 •

Copy link
Copy Markdown
Owner

Summary

Add a Trivy workflow that builds the image from dev, scans it and uploads the findings to the Security tab as code scanning alerts.

Changes

  • .github/workflows/trivy.yml runs on pushes to dev that change the image (Dockerfile, uv.lock, pyproject.toml, src/), every Saturday, and by hand. Pull requests run it only when the workflow file changes.
  • The job logs in to dhi.io, builds the Docker Hardened Images image and scans it for high and critical CVEs that already have a fix, the same policy as the Grype scans.
  • Grype stays the gate on pull requests (docker.yml) and on the published image (image-scan.yml). Trivy reports and never fails a run on a finding.
  • Replaces GitHub's starter template: every action is pinned to a commit (aquasecurity/trivy-action v0.36.0 instead of v0.5.0 from 2022), and the placeholder image name is gone.

Checklist

  • Described how the change was checked: pre-commit (zizmor, check-yaml, gitleaks) and actionlint pass locally; the Trivy run on this pull request builds, scans and uploads.
  • No secrets, real configs, hostnames or LAN addresses
  • make check not run: the change touches one workflow file only.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Build the Docker Hardened Images image from dev, scan it with Trivy and
upload the SARIF report to the Security tab. The run covers pushes to
dev that change the image, a weekly schedule and manual runs. Grype
stays the gate on pull requests; Trivy reports and never fails a run.

Replace the starter template: pin every action to a commit, log in to
dhi.io for the base images, and scan the image this repository builds.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@spydisec spydisec added the ci CI and workflow changes label Nov 16, 2026
@spydisec spydisec changed the title Add Trivy vulnerability scanning workflow ci(trivy): report image CVEs from dev to code scanning Nov 16, 2026
@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

docker.yml already reports a check called image; a second one with the
same name makes the two hard to tell apart on a pull request.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@spydisec

Copy link
Copy Markdown
Owner Author

Closing: Grype already scans the same image on pull requests and every week, so a second scanner adds a third image build and duplicate findings. The Security tab alerts come from Grype instead, through a SARIF upload in image-scan.yml.

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

Labels

ci CI and workflow changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants