Skip to content

upload sarif from trivy scan #616

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft

Conversation

TomConner
Copy link
Contributor

upload sarif from trivy scans here to expose in the security tab

@TomConner TomConner requested a review from Copilot May 23, 2025 04:21
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enables publishing SARIF results from Trivy scans to the GitHub Security tab by correcting the workflow YAML and uncommenting the upload step.

  • Fixed the schedule entry formatting in the workflow trigger
  • Un-commented and aligned the sarif input for the Trivy scan step
  • Added a step to upload the generated SARIF file to the Security tab
Comments suppressed due to low confidence (3)

.github/workflows/trivy.yml:6

  • The schedule entry has an extra dash and inconsistent indentation, which may break the YAML parsing. Align it as a single list item under schedule: with a single dash and uniform spacing.
-    - cron: "0 14 * * 1" # each Monday at 9am EST

.github/workflows/trivy.yml:35

  • [nitpick] The sarif input is indented two spaces more than the other keys in this block. Adjust indentation to match severities: and dockerfile: for better readability.
sarif: ${{ !github.base_ref && env.SARIF_PATH || '' }}

.github/workflows/trivy.yml:37

  • Consider adding an id to this upload step (e.g., id: upload-sarif) and ensure SARIF_PATH is defined or exported in the job’s env so the file reference is explicit and maintainable.
- name: Upload Trivy scan results to GitHub Security tab

@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.

@TomConner TomConner requested a review from sarahgibs May 23, 2025 05:42
@TomConner TomConner requested a review from sarahgibs May 27, 2025 15:04
Copy link

@TomConner
Copy link
Contributor Author

TomConner commented May 27, 2025

Note trivy.yml findings in the security tab are from codeql, not trivy.

@TomConner TomConner marked this pull request as draft May 27, 2025 15:34
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