Conversation
There was a problem hiding this comment.
Summary
This PR successfully implements IaC security scanning gates in the CI pipeline. The changes enable enforceable security checks via Checkov and Trivy with SARIF reporting to GitHub Security.
Critical Issues Found: 2
- Pipeline Failure Risk: Missing
continue-on-error: trueon SARIF upload could block the pipeline if upload fails - Type Mismatch: Trivy exit-code uses string '1' instead of numeric 1
Changes Reviewed
- ✅ Added security-events permission for SARIF uploads
- ✅ Configured Checkov with soft_fail: false for enforcement
- ✅ Added SARIF output and upload integration
- ✅ Added Trivy IaC scanning for additional coverage
- ✅ Updated README to reflect actual CI steps
The implementation is sound but requires the two fixes above to ensure reliable pipeline operation.
You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.
| - name: Upload Checkov SARIF report | ||
| if: always() | ||
| uses: github/codeql-action/upload-sarif@v3 | ||
| with: | ||
| sarif_file: results.sarif |
There was a problem hiding this comment.
🛑 Pipeline Failure Risk: The SARIF upload will fail if Checkov doesn't generate the results.sarif file before exiting with a failure status. Add continue-on-error: true to prevent upload failures from blocking the pipeline, since the primary security gate is Checkov itself. The upload is for visibility, not enforcement.
| - name: Upload Checkov SARIF report | |
| if: always() | |
| uses: github/codeql-action/upload-sarif@v3 | |
| with: | |
| sarif_file: results.sarif | |
| - name: Upload Checkov SARIF report | |
| if: always() | |
| continue-on-error: true | |
| uses: github/codeql-action/upload-sarif@v3 | |
| with: | |
| sarif_file: results.sarif |
| - name: Static security scan (Trivy IaC misconfigurations) | ||
| uses: aquasecurity/trivy-action@0.24.0 | ||
| with: | ||
| scan-type: config | ||
| scan-ref: . | ||
| hide-progress: true | ||
| severity: CRITICAL,HIGH | ||
| exit-code: '1' |
There was a problem hiding this comment.
🛑 Type Mismatch: The exit-code parameter expects a numeric value but receives a string '1'. While some action versions may coerce this, using the numeric value ensures consistent behavior across all versions and prevents potential issues where the string is interpreted as truthy rather than as the exit code 1.
| - name: Static security scan (Trivy IaC misconfigurations) | |
| uses: aquasecurity/trivy-action@0.24.0 | |
| with: | |
| scan-type: config | |
| scan-ref: . | |
| hide-progress: true | |
| severity: CRITICAL,HIGH | |
| exit-code: '1' | |
| - name: Static security scan (Trivy IaC misconfigurations) | |
| uses: aquasecurity/trivy-action@0.24.0 | |
| with: | |
| scan-type: config | |
| scan-ref: . | |
| hide-progress: true | |
| severity: CRITICAL,HIGH | |
| exit-code: 1 |
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
Motivation
Description
security-events: writepermission and enhanced.github/workflows/platform-iac-ci.ymlto run Checkov withsoft_fail: false, emit SARIF output, upload the SARIF usinggithub/codeql-action/upload-sarif@v3, and run a Trivy IaC config scan that fails on HIGH/CRITICAL findings.README.mdto note that CI includesbuild/test/synth + Checkov + Trivy security scans..github/workflows/platform-iac-ci.ymlandREADME.md.AGENTS.mdwere used for this change.Testing
npm ciand the command completed successfully.npm run buildand the TypeScript build completed successfully.npm test -- --ciand all unit and snapshot tests passed.npm run synthand CDK synth completed successfully.Codex Task