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

Security scan pipeline update #4177

Merged
merged 17 commits into from
Jan 16, 2025
Prev Previous commit
Next Next commit
trivy fix
AlexanderBarabanov committed Jan 15, 2025
commit 8b344238435845890f8df3c8bef460c9559634d1
14 changes: 11 additions & 3 deletions .github/workflows/code_scan.yaml
Original file line number Diff line number Diff line change
@@ -28,29 +28,37 @@ jobs:
- name: Freeze dependencies
run: pip-compile --extra=docs,base,mmlab,anomaly -o requirements.txt pyproject.toml

- name: Run Trivy Scan (vuln)
uses: aquasecurity/trivy-action@18f2510ee396bbf400402947b394f2dd8c87dbb0 # v0.29.0
with:
scan-type: fs
scan-ref: requirements.txt
scanners: vuln
output: trivy-results-vuln.txt

- name: Trivy Scanning (spdx.json)
uses: aquasecurity/trivy-action@18f2510ee396bbf400402947b394f2dd8c87dbb0 # 0.29.0
with:
scan-type: fs
scan-ref: .
format: spdx-json
output: trivy-results.spdx.json
output: trivy-results-spdx.json

- name: Run Trivy Scan (dockerfile and secrets)
uses: aquasecurity/trivy-action@18f2510ee396bbf400402947b394f2dd8c87dbb0 # v0.29.0
if: always()
with:
scan-type: fs
scan-ref: .
scanners: misconfig,secret,vuln
scanners: misconfig,secret
output: trivy-results-misconfig.txt
skip-setup-trivy: true

- name: Upload Trivy results artifact
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
with:
name: trivy-results
path: "${{ github.workspace }}/trivy-results.*"
path: "${{ github.workspace }}/trivy-results-*"
retention-days: 7
# Use always() to always run this step to publish scan results when there are test failures
if: ${{ always() }}