-
-
Notifications
You must be signed in to change notification settings - Fork 260
Added trivy.yaml #1289
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
Added trivy.yaml #1289
Changes from 2 commits
5f0b5f7
323e14b
6231c82
53afc99
00a42bf
e515ffb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,105 @@ | ||||||||||||
| name: Security Scans | ||||||||||||
|
|
||||||||||||
| on: | ||||||||||||
| workflow_run: | ||||||||||||
| workflows: ["Run CI/CD"] | ||||||||||||
| branches: | ||||||||||||
| - main | ||||||||||||
| types: | ||||||||||||
| - completed | ||||||||||||
|
|
||||||||||||
| env: | ||||||||||||
| DOCKERHUB_USERNAME: arkid15r | ||||||||||||
|
|
||||||||||||
| jobs: | ||||||||||||
| scan-repository: | ||||||||||||
| name: Repository Scan | ||||||||||||
| runs-on: ubuntu-latest | ||||||||||||
| if: github.event.workflow_run.conclusion == 'success' | ||||||||||||
| steps: | ||||||||||||
| - name: Checkout code | ||||||||||||
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 | ||||||||||||
| - name: Run Trivy repository scan | ||||||||||||
| uses: aquasecurity/trivy-action@6c175e9c4083a92bbca2f9724c8a5e33bc2d97a5 | ||||||||||||
| with: | ||||||||||||
| scan-type: 'repo' | ||||||||||||
| severity: 'HIGH,CRITICAL' | ||||||||||||
| ignore-unfixed: true | ||||||||||||
|
|
||||||||||||
| scan-filesystem: | ||||||||||||
| name: Filesystem Scan | ||||||||||||
| runs-on: ubuntu-latest | ||||||||||||
| if: github.event.workflow_run.conclusion == 'success' | ||||||||||||
| steps: | ||||||||||||
| - name: Checkout code | ||||||||||||
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 | ||||||||||||
| - name: Run Trivy filesystem scan | ||||||||||||
| uses: aquasecurity/trivy-action@6c175e9c4083a92bbca2f9724c8a5e33bc2d97a5 | ||||||||||||
| with: | ||||||||||||
| scan-type: 'fs' | ||||||||||||
| severity: 'HIGH,CRITICAL' | ||||||||||||
| ignore-unfixed: true | ||||||||||||
|
|
||||||||||||
| scan-staging-images: | ||||||||||||
| name: Scan Staging Images | ||||||||||||
| runs-on: ubuntu-latest | ||||||||||||
| if: | | ||||||||||||
| github.event.workflow_run.conclusion == 'success' && | ||||||||||||
| (github.event.workflow_run.event == 'push' || github.event.workflow_run.event == 'pull_request') | ||||||||||||
| steps: | ||||||||||||
| - name: Scan frontend image | ||||||||||||
| uses: aquasecurity/trivy-action@6c175e9c4083a92bbca2f9724c8a5e33bc2d97a5 | ||||||||||||
| with: | ||||||||||||
| image-ref: ${{ env.DOCKERHUB_USERNAME }}/owasp-nest-frontend:staging | ||||||||||||
| severity: 'HIGH,CRITICAL' | ||||||||||||
| ignore-unfixed: true | ||||||||||||
| ignore-cves: | ||||||||||||
| - CVE-2024-56171 | ||||||||||||
| - CVE-2024-55549 | ||||||||||||
| - CVE-2024-8176 | ||||||||||||
| - CVE-2025-24855 | ||||||||||||
| - CVE-2025-24928 | ||||||||||||
| - CVE-2025-27113 | ||||||||||||
coderabbitai[bot] marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||||||
| exit-code: 1 | ||||||||||||
|
|
||||||||||||
| - name: Scan backend image | ||||||||||||
| uses: aquasecurity/trivy-action@6c175e9c4083a92bbca2f9724c8a5e33bc2d97a5 | ||||||||||||
| with: | ||||||||||||
| image-ref: ${{ env.DOCKERHUB_USERNAME }}/owasp-nest-backend:staging | ||||||||||||
| severity: 'HIGH,CRITICAL' | ||||||||||||
| ignore-unfixed: true | ||||||||||||
| ignore-cves: | ||||||||||||
| - CVE-2025-31115 | ||||||||||||
| exit-code: 1 | ||||||||||||
|
||||||||||||
| ignore-cves: | |
| - CVE-2025-31115 | |
| exit-code: 1 | |
| ignore-cves: "CVE-2025-31115" | |
| exit-code: 1 |
🧰 Tools
🪛 actionlint (1.7.4)
72-72: expected scalar node for string value but found sequence node with "!!seq" tag
(syntax-check)
coderabbitai[bot] marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
YAML Scalar Issue for 'ignore-cves' in Production Backend Image Scan
For the production backend image scan (lines 103–105), the ignore-cves parameter should also be a scalar string rather than a list.
Proposed change:
- ignore-cves:
- - CVE-2025-31115
+ ignore-cves: "CVE-2025-31115"📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| ignore-cves: | |
| - CVE-2025-31115 | |
| exit-code: 1 | |
| ignore-cves: "CVE-2025-31115" | |
| exit-code: 1 |
🧰 Tools
🪛 actionlint (1.7.4)
104-104: expected scalar node for string value but found sequence node with "!!seq" tag
(syntax-check)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why moving this out of the CI/CD scope? I think this way we won't be able to use them in
needssections.