Skip to content

Commit

Permalink
Merge pull request #1545 from ScilifelabDataCentre/DDS-2019-update-tr…
Browse files Browse the repository at this point in the history
…ivy-actions

DDS-2019 update Trivy action
  • Loading branch information
aishling-scilifelab authored Jul 26, 2024
2 parents 1f1ea06 + 7a77029 commit 05527d8
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 14 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/publish_and_trivyscan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
name: Publish to GHCR (+ Trivy scan)
on:
workflow_dispatch:
branches: [dev]
pull_request:
push:
branches:
Expand Down Expand Up @@ -95,7 +94,7 @@ jobs:
output: "trivy-results.sarif"
severity: "CRITICAL,HIGH"
- name: Upload Trivy scan results to Github Security tab
uses: github/codeql-action/upload-sarif@v2
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: "trivy-results.sarif"
category: trivy-build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/trivy-scan-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
severity: "CRITICAL,HIGH"

- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v2
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: "trivy-results.sarif"
category: trivy
9 changes: 3 additions & 6 deletions .github/workflows/trivy-scheduled-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
# ---------------------------------
name: Trivy - ghcr image scan - dev
on:
workflow_dispatch:
branches:
- dev
schedule:
schedule: # Since dev is the default branch of the repo don't specify
- cron: "0 9,12,15 * * *"
jobs:
scan:
Expand All @@ -26,15 +23,15 @@ jobs:
run: echo REPOSITORY_OWNER=$(echo ${{ github.repository_owner }} | tr "[:upper:]" "[:lower:]") >> $GITHUB_ENV

- name: Run Trivy on latest dev image
uses: aquasecurity/trivy-action@0.7.1
uses: aquasecurity/trivy-action@0.24.0
with:
image-ref: "ghcr.io/${{ env.REPOSITORY_OWNER }}/dds-backend:dev"
format: "sarif"
output: "trivy-results-dev.sarif"
severity: "CRITICAL,HIGH"

- name: Upload Trivy scan results to dev branch GitHub Security tab
uses: github/codeql-action/upload-sarif@v2
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: "trivy-results-dev.sarif"
category: trivy-dev
7 changes: 2 additions & 5 deletions .github/workflows/trivy-scheduled-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
# ---------------------------------
name: Trivy - ghcr image scan - master
on:
workflow_dispatch:
branches:
- master
schedule:
- cron: "0 7,15 * * *"
jobs:
Expand All @@ -28,15 +25,15 @@ jobs:
run: echo REPOSITORY_OWNER=$(echo ${{ github.repository_owner }} | tr "[:upper:]" "[:lower:]") >> $GITHUB_ENV

- name: Run Trivy on latest release image
uses: aquasecurity/trivy-action@0.7.1
uses: aquasecurity/trivy-action@0.24.0
with:
image-ref: "ghcr.io/${{ env.REPOSITORY_OWNER }}/dds-backend:latest"
format: "sarif"
output: "trivy-results-master.sarif"
severity: "CRITICAL,HIGH"

- name: Upload Trivy scan results to master branch GitHub Security tab
uses: github/codeql-action/upload-sarif@v2
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: "trivy-results-master.sarif"
category: trivy-master
1 change: 1 addition & 0 deletions SPRINTLOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -411,3 +411,4 @@ _Nothing merged in CLI during this sprint_
- Small updates to Technical Overview contents ([#1540](https://github.com/ScilifelabDataCentre/dds_web/pull/1540))
- Build Technical Overview PDF in GitHub Actions, rename to include DDS and remove option to view on GitHub ([#1541](https://github.com/ScilifelabDataCentre/dds_web/pull/1541/))
- Fixed index out of range when listing files from root ([#1543](https://github.com/ScilifelabDataCentre/dds_web/pull/1543/))
- Update Trivy GitHub Actions ([#1545](https://github.com/ScilifelabDataCentre/dds_web/pull/1545))

0 comments on commit 05527d8

Please sign in to comment.