Vulnerability Scan #148
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Vulnerability Scan | |
| on: | |
| schedule: | |
| - cron: '30 19 * * *' | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Image tag to scan' | |
| required: false | |
| default: 'latest' | |
| type: string | |
| permissions: | |
| packages: read | |
| security-events: write | |
| jobs: | |
| scan: | |
| name: Scan container image | |
| strategy: | |
| matrix: | |
| workload: ["controller", "server", "web-hooks"] | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Run trivy scanner | |
| uses: aquasecurity/[email protected] | |
| with: | |
| image-ref: ghcr.io/sap/cap-operator/${{ matrix.workload }}:${{ inputs.version || 'latest' }} | |
| scanners: 'vuln' | |
| version: 'v0.67.2' | |
| format: 'sarif' | |
| output: 'vuln-${{ matrix.workload }}.sarif' | |
| - name: Upload trivy scan results to GitHub Security tab | |
| uses: github/codeql-action/upload-sarif@v4 | |
| with: | |
| sarif_file: 'vuln-${{ matrix.workload }}.sarif' | |
| - name: Run grype scanner | |
| uses: anchore/scan-action@v7 | |
| with: | |
| image: ghcr.io/sap/cap-operator/${{ matrix.workload }}:${{ inputs.version || 'latest' }} | |
| output-file: 'vuln-grype-${{ matrix.workload }}.sarif' | |
| - name: Upload grype scan results to GitHub Security tab | |
| uses: github/codeql-action/upload-sarif@v4 | |
| with: | |
| sarif_file: 'vuln-grype-${{ matrix.workload }}.sarif' |