Skip to content

Commit

Permalink
CI - push trivy report for postgres to security tab
Browse files Browse the repository at this point in the history
  • Loading branch information
lwih committed Dec 29, 2023
1 parent bff1229 commit c50c3cb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: "Release"

on:
push:
branches: [ "main" ]
# push:
# branches: [ "main" ]
release:
types: [ published ]

Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/trivy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,15 @@ jobs:
ENV_PROFILE=${{ env.ENV_PROFILE }}
GITHUB_SHA=${{ github.sha }}
- name: Run Trivy vulnerability scanner
- name: Run Trivy on Docker build
uses: aquasecurity/trivy-action@master
with:
image-ref: "ghcr.io/mtes-mct/rapportnav2/rapportnav-app:${{ github.sha }}"
format: sarif
output: "trivy-results.sarif"
severity: "CRITICAL,HIGH"

- name: Run Trivy on Postgres
- name: Run Trivy on Postgres image
uses: aquasecurity/trivy-action@master
with:
image-ref: "postgres:15.5-alpine"
Expand All @@ -88,3 +88,8 @@ jobs:
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: "trivy-results.sarif"

- name: Upload Postgres Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: "postgres-trivy-results.sarif"

0 comments on commit c50c3cb

Please sign in to comment.