Skip to content

Commit

Permalink
Include vulnerability scan in the docker build step
Browse files Browse the repository at this point in the history
  • Loading branch information
gcotelli committed Apr 18, 2024
1 parent 2a755be commit 2c6a6bf
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 39 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ on:
jobs:
build_and_publish:
name: Build and Publish Docker images
permissions:
contents: read
security-events: write
runs-on: ubuntu-latest
strategy:
matrix:
Expand Down Expand Up @@ -108,3 +111,19 @@ jobs:
tags: ${{ steps.docker_meta_runtime_gem.outputs.tags }}
labels: ${{ steps.docker_meta_runtime_gem.outputs.labels }}
secrets: GIT_AUTH_TOKEN=${{ secrets.DOCKER_REGISTRY_TOKEN }}

# Scan for vulnerabilities
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
image-ref: ghcr.io/${{ github.repository_owner }}/gs64:${{ github.sha }}
format: 'sarif'
output: 'trivy-results.sarif'
severity: 'CRITICAL,HIGH'
limit-severities-for-sarif: true
ignore-unfixed: true

- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: 'trivy-results.sarif'
39 changes: 0 additions & 39 deletions .github/workflows/security-scan.yml

This file was deleted.

0 comments on commit 2c6a6bf

Please sign in to comment.