Skip to content

Commit

Permalink
Add further changes to GH actions to fix page upload and trivy SARIF …
Browse files Browse the repository at this point in the history
…upload
  • Loading branch information
fgogolli committed Sep 5, 2024
1 parent 5f1f453 commit 3299ca0
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 13 deletions.
6 changes: 3 additions & 3 deletions .github/conf/trivy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ format: sarif
scan:
scanners:
- vuln
- config
- misconfig
# - secret
# - license

Expand All @@ -29,5 +29,5 @@ scan:
# - CRITICAL
# - UNKNOWN

# vulnerability:
# ignore-unfixed: true
vulnerability:
ignore-unfixed: true
3 changes: 2 additions & 1 deletion .github/workflows/doc_builder.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ jobs:
build:
name: Deploy docs
permissions:
contents: write # for actions/checkout to fetch code
contents: write # for actions/checkout to fetch code and creating gh-pages
pages: write # for creating github pages
security-events: write # for creating github pages
runs-on: ubuntu-latest

Expand Down
20 changes: 11 additions & 9 deletions .github/workflows/iac_scan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,25 +25,27 @@ jobs:
uses: actions/checkout@v4

- name: Run trivy in fs mode and generate report
uses: aquasecurity/trivy-action@master
uses: aquasecurity/trivy-action@0.20.0
with:
scan-type: 'fs'
ignore-unfixed: true
# ignore-unfixed: true
trivy-config: ".github/conf/trivy.yaml"
trivyignores: ".github/conf/.trivyignore"
exit-code: '0'
# severity: UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL
# output: ${{ env.TRIVY_REPORT_FILE }} # This flag doesnt seem to be working.
env:
TRIVY_OUTPUT: ${{ env.TRIVY_REPORT_FILE }}
# format: 'sarif'
output: ${{ env.TRIVY_REPORT_FILE }} # This flag doesnt seem to be working.
# env:
# TRIVY_OUTPUT: ${{ env.TRIVY_REPORT_FILE }}

# As per the following issue/solution: https://github.com/aquasecurity/trivy/issues/5003
- name: Fix trivy SARIF report for URI scheme
run: |-
sed -i 's#git::https:/##g' ${{ env.TRIVY_REPORT_FILE }}
# - name: Fix trivy SARIF report for URI scheme
# run: |-
# sed -i 's#git::https:/##g' ${{ env.TRIVY_REPORT_FILE }}

- name: Upload trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v3
if: success() || failure()
# if: success() || failure()
with:
sarif_file: "${{ env.TRIVY_REPORT_FILE }}"

Expand Down

0 comments on commit 3299ca0

Please sign in to comment.