Skip to content

Conversation

@AmberJBlue
Copy link
Member

@AmberJBlue AmberJBlue commented Aug 14, 2025

Summary by Sourcery

Add a GitHub Actions workflow to perform file system vulnerability scans using Trivy and surface results in the Security tab

CI:

  • Introduce a security-scan workflow triggered on main branch events and manual dispatch
  • Run Trivy FS scans with SARIF output and enforce failure on critical/high vulnerabilities
  • Upload Trivy SARIF report to GitHub Security tab under a dedicated category

@AmberJBlue AmberJBlue self-assigned this Aug 14, 2025
@sourcery-ai
Copy link

sourcery-ai bot commented Aug 14, 2025

Reviewer's Guide

Introduce a new GitHub Actions workflow that runs a Trivy filesystem scan on commits and pull requests to main, captures all vulnerabilities in SARIF format, enforces a fail-on-high-severity check, and uploads results to the Security tab.

Sequence diagram for Trivy scan and SARIF upload in CI

sequenceDiagram
    participant Developer
    participant GitHubActions
    participant Trivy
    participant SecurityTab
    Developer->>GitHubActions: Push/PR to main
    GitHubActions->>GitHubActions: Checkout code
    GitHubActions->>Trivy: Run FS scan (SARIF output)
    Trivy-->>GitHubActions: trivy-results.sarif
    GitHubActions->>Trivy: Run FS scan (Table output, fail on CRITICAL/HIGH)
    Trivy-->>GitHubActions: Vulnerability report
    GitHubActions->>SecurityTab: Upload SARIF results
    SecurityTab-->>GitHubActions: Results available
Loading

File-Level Changes

Change Details Files
Add Trivy filesystem scan workflow
  • Define workflow triggers for push, pull_request, and manual dispatch
  • Configure trivy-fs job with checkout and required permissions
  • Add initial Trivy scan step producing SARIF output for all severities
  • Add secondary Trivy scan step failing on CRITICAL/HIGH vulnerabilities
  • Upload SARIF report to GitHub Security tab unconditionally
.github/workflows/security-scan.yaml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey there - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@AmberJBlue AmberJBlue marked this pull request as draft August 14, 2025 13:24
@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

@AmberJBlue AmberJBlue closed this Aug 19, 2025
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.

1 participant