Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update trivy scanning job #3733

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .ci/trivy-json.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ignore-policy: ""
ignorefile: .trivyignore
format: spdx-json
output: trivy-results.spdx.json
list-all-pkgs: true
debug: true
3 changes: 2 additions & 1 deletion .ci/trivy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ scan:
- vuln
- secret
slow: false
severity: UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL
severity: MEDIUM,HIGH,CRITICAL
exit-code: 1
vulnerability:
ignore-unfixed: false
format: template
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/code_scan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,25 @@ jobs:
run: python -m pip install --require-hashes --no-deps -r .ci/requirements.txt
- name: Freeze dependencies
run: pip-compile --extra=docs,base,mmlab,anomaly -o requirements.txt pyproject.toml
- name: Trivy Scanning (spdx.json)
uses: aquasecurity/trivy-action@7c2007bcb556501da015201bcba5aa14069b74e2 # 0.23.0
with:
trivy-config: ".ci/trivy-json.yaml"
scan-type: "fs"
scan-ref: .
- name: Trivy Scanning
uses: aquasecurity/trivy-action@7c2007bcb556501da015201bcba5aa14069b74e2 # 0.23.0
with:
trivy-config: ".ci/trivy.yaml"
scan-type: "fs"
scan-ref: .
scanners: vuln,secret
- name: Upload Trivy results artifact
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: trivy-results
path: "${{ github.workspace }}/trivy-results.csv"
path: "${{ github.workspace }}/trivy-results.*"
# Use always() to always run this step to publish scan results when there are test failures
if: ${{ always() }}
Bandit:
runs-on: ubuntu-latest
steps:
Expand Down
Loading