Skip to content

Conversation

@MonicaG
Copy link
Contributor

@MonicaG MonicaG commented Jul 8, 2025

Add trivy to build docker image
Upload results to the security tab in GitHub

@MonicaG MonicaG added the build Run workflow to build the code in this PR label Jul 8, 2025
@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.

@MonicaG MonicaG requested a review from Copilot July 11, 2025 21:20
Copy link
Contributor

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

Adds Trivy vulnerability scanning into the Docker image build pipeline and uploads scan results to GitHub’s Security tab.

  • Introduce a scheduled workflow triggering the reusable build that now includes Trivy scanning
  • Update the reusable build to grant security-events: write, tag images with the raw ref name, run Trivy, and upload SARIF results
  • Propagate security-events: write permission to other build-update workflows

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
.github/workflows/scheduled.yaml New scheduled workflow dispatching the reusable build workflow
.github/workflows/build.yaml Added security-events permission, raw tagging, Trivy scan + upload steps
.github/workflows/build-update-gitops.yaml Propagate security-events: write permission
.github/workflows/build-update-gitops-pr-branch.yaml Propagate security-events: write permission
Comments suppressed due to low confidence (3)

.github/workflows/build.yaml:65

  • If your SARIF template lives in this repository, use a relative path (e.g., ./contrib/sarif.tpl) instead of the @-prefixed syntax, which refers to files inside the action itself.
          template: '@/contrib/sarif.tpl'

.github/workflows/build.yaml:70

  • [nitpick] Consider using the dedicated actions/upload-sarif@v3 action for uploading SARIF files—it's lighter-weight and focused solely on uploading results.
        uses: github/codeql-action/upload-sarif@v3

.github/workflows/build.yaml:61

  • Add an exit-code: 1 option under the Trivy action’s with block so the build fails automatically when high or critical vulnerabilities are detected.
        with:

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

Labels

build Run workflow to build the code in this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants