Security Vulnerability Scan #2
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: Security Vulnerability Scan | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| grype-scan: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Setup Java version | |
| uses: actions/setup-java@v3 | |
| with: | |
| java-version: '11' | |
| distribution: 'zulu' | |
| - name: Generate CycloneDX SBOM | |
| # Resolves all transitive dependencies and produces build/reports/bom.json | |
| run: ./gradlew cyclonedxBom --no-daemon | |
| - name: Install Grype | |
| run: curl -sSfL https://raw.githubusercontent.com/anchore/grype/main/install.sh | sh -s -- -b /usr/local/bin | |
| - name: Run Grype vulnerability scanner | |
| run: | | |
| echo "=== Vulnerability table ===" | |
| grype "sbom:build/reports/bom.json" \ | |
| --output table | |
| grype "sbom:build/reports/bom.json" \ | |
| --output sarif > grype-results.sarif | |
| - name: Upload scan results as artifact | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: grype-scan-results | |
| path: | | |
| grype-results.sarif | |
| build/reports/bom.json |