-
Notifications
You must be signed in to change notification settings - Fork 6
67 lines (63 loc) · 2.18 KB
/
cve-scanning.yml
File metadata and controls
67 lines (63 loc) · 2.18 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Demo Model CVE Scanning
on:
push:
branches:
- master
paths: &monitored-files
- '**/pom.xml' # Monitor all POM files
- '.github/workflows/cve-scanning.yml'
pull_request:
paths: *monitored-files
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
id-token: write # Required for Workload Identity Federation
contents: read # Required for actions/checkout
env:
JAVA_VERSION: '21' # Match the project's compiler version
jobs:
cve-security-scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: 'temurin'
- name: Authenticate to Google Cloud
uses: 'google-github-actions/auth@v3'
with:
project_id: production-208613
workload_identity_provider: projects/211964611435/locations/global/workloadIdentityPools/artifact-registry/providers/github-actions-rosetta-models
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v2
- name: Cache Maven dependencies
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Build modules to populate local repo (no tests)
run: mvn -B -ntp -U -DskipTests install
- name: CVE scanning
uses: dependency-check/Dependency-Check_Action@main
env:
JAVA_HOME: /opt/jdk
with:
project: 'Demo'
path: '.'
format: 'HTML'
out: 'reports'
args: >
--suppression allow-list.xml
--failOnCVSS 7
--centralUrl https://central.sonatype.com/solrsearch/select
--ossIndexUsername ${{ secrets.OSSINDEX_USERNAME }}
--ossIndexPassword ${{ secrets.OSSINDEX_TOKEN }}
- name: Upload results
uses: actions/upload-artifact@v4
with:
name: CVE Scan Report ${{ strategy.job-index }}
path: ${{github.workspace}}/reports