-
Notifications
You must be signed in to change notification settings - Fork 7
42 lines (33 loc) · 1.11 KB
/
security-scan.yml
File metadata and controls
42 lines (33 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
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