Repository navigation
Add Trivy security scanning workflow to aws-unified-lambda #64
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
Changes from all commits
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,63 @@ | ||
| name: 'Trivy Security Scans' | ||
|
|
||
| on: | ||
| schedule: | ||
| # Run every day at 12 AM IST (which is 6:30 PM UTC) | ||
| - cron: "46 7 * * *" | ||
|
|
||
| jobs: | ||
| trivy_fs_scan: | ||
| name: Trivy Filesystem Scan | ||
| runs-on: ubuntu-latest | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It duplicates github/workflows/trivy_schedule.yaml which already runs a daily filesystem scan for HIGH and github/workflows/pull_request.yaml#L91-L116) also runs Trivy on every PR. |
||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Run Trivy filesystem scan | ||
| uses: aquasecurity/trivy-action@master | ||
| with: | ||
| scan-type: 'fs' | ||
| scan-ref: '.' | ||
| ignore-unfixed: true | ||
| severity: 'HIGH,CRITICAL' | ||
| format: 'sarif' | ||
| output: 'trivy-fs-results.sarif' | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The scan steps at lines 18-26 and 49-56 never fail the run. Compare withgithub/workflows/trivy_schedule.yaml#L34. |
||
|
|
||
| - name: Upload Trivy filesystem results to GitHub Security tab | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing permissions. |
||
| if: always() | ||
| uses: github/codeql-action/upload-sarif@v3 | ||
| with: | ||
| sarif_file: 'trivy-fs-results.sarif' | ||
|
|
||
| trivy_image_scan: | ||
|
Comment on lines
+10
to
+33
|
||
| name: Trivy Docker Image Scan | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Build and load Docker image | ||
| uses: docker/build-push-action@v6 | ||
| with: | ||
| context: ./logs-function | ||
| file: ./logs-function/Dockerfile | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. he trivy_image_scan job builds from ./logs-function/Dockerfile (lines 41-42). That path doesn't exist, and the repo has no Dockerfile. |
||
| load: true | ||
| tags: oci-log-integration-scan:latest | ||
|
|
||
| - name: Run Trivy image scan | ||
| uses: aquasecurity/trivy-action@master | ||
| with: | ||
| scan-type: 'image' | ||
| image-ref: 'oci-log-integration-scan:latest' | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no oci-log-integration-scan:latest tag isnt from this repo |
||
| ignore-unfixed: true | ||
| severity: 'HIGH,CRITICAL' | ||
| format: 'sarif' | ||
| output: 'trivy-image-results.sarif' | ||
|
|
||
| - name: Upload Trivy image results to GitHub Security tab | ||
| if: always() | ||
| uses: github/codeql-action/upload-sarif@v3 | ||
| with: | ||
| sarif_file: 'trivy-image-results.sarif' | ||
|
Comment on lines
+34
to
+63
|
||
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.
Lines 5-6: the comment says 12 AM IST / 6:30 PM UTC, but 46 7 * * * is 07:46 UTC, which is 1:16 PM IST.