Skip to content

Commit db35a0f

Browse files
committed
Updated CVE Check Process
1 parent b703d6f commit db35a0f

File tree

3 files changed

+46
-69
lines changed

3 files changed

+46
-69
lines changed

.github/workflows/fosstars-report.yml

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ on:
77
env:
88
MVN_MULTI_THREADED_ARGS: --batch-mode --no-transfer-progress --fail-at-end --show-version --threads 1C
99
JAVA_VERSION: 17
10+
CVE_CACHE_KEY: cve-db
11+
CVE_CACHE_DIR: ~/.m2/repository/org/owasp/dependency-check-data
12+
CVE_CACHE_REF: refs/heads/main
1013

1114
jobs:
1215
create_fosstars_report:
@@ -22,29 +25,52 @@ jobs:
2225
distribution: "temurin"
2326
java-version: ${{ env.JAVA_VERSION }}
2427
cache: 'maven'
28+
2529
- name: Restore CVE Database
2630
uses: actions/cache/restore@v4
2731
with:
2832
path: ${{ env.CVE_CACHE_DIR }}
2933
key: ${{ env.CVE_CACHE_KEY }}
30-
fail-on-cache-miss: true
34+
# fail-on-cache-miss: true
3135

3236
- name: "Build SDK"
3337
run: |
3438
MVN_ARGS="${{ env.MVN_MULTI_THREADED_ARGS }} clean install -DskipTests -DskipFormatting"
3539
mvn $MVN_ARGS
3640
37-
- name: "OWASP Dependency check"
38-
run: mvn org.owasp:dependency-check-maven:11.1.0:check -DnvdApiKey=$NVD_API_KEY -DfailBuildOnCVSS=7 -DskipProvidedScope=true -DsuppressionFile=.pipeline/dependency-check-suppression.xml -DautoUpdate=false
39-
env:
40-
NVD_API_KEY: ${{ secrets.NVD_API_KEY }}
41-
42-
- name: "Fosstars rating"
41+
- name: "Fosstars Rating"
4342
4443
with:
4544
report-branch: fosstars-report
4645
token: ${{ secrets.GITHUB_TOKEN }}
4746

47+
- name: "CVE Scan"
48+
run: |
49+
mvn -T1 --no-transfer-progress dependency-check:check dependency-check:aggregate
50+
51+
# - name: "Archive CVE Report"
52+
# uses: actions/upload-artifact@v4
53+
# with:
54+
# name: cve-report
55+
# path: target/dependency-check-report.html
56+
# retention-days: 7
57+
58+
- name: Delete Old CVE Cache
59+
run: |
60+
CACHE_IDS=$(gh cache list --key "${{ env.CVE_CACHE_KEY }}" --ref "${{ env.CVE_CACHE_REF }}" --json id | jq -r '.[] | .id')
61+
for CACHE_ID in $CACHE_IDS; do
62+
echo "Deleting cache with ID: $CACHE_ID"
63+
gh cache delete "${CACHE_ID}"
64+
done
65+
env:
66+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
67+
68+
- name: Create Updated CVE Cache
69+
uses: actions/cache/save@v4
70+
with:
71+
path: ${{ env.CVE_CACHE_DIR }}
72+
key: ${{ env.CVE_CACHE_KEY }}
73+
4874
- name: "Slack Notification"
4975
if: failure()
5076
uses: slackapi/[email protected]

.github/workflows/update-vulnerability-database.yaml

Lines changed: 0 additions & 62 deletions
This file was deleted.

pom.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -584,6 +584,19 @@ https://gitbox.apache.org/repos/asf?p=maven-pmd-plugin.git;a=blob_plain;f=src/ma
584584
<artifactId>maven-resources-plugin</artifactId>
585585
<version>3.3.1</version>
586586
</plugin>
587+
<plugin>
588+
<groupId>org.owasp</groupId>
589+
<artifactId>dependency-check-maven</artifactId>
590+
<version>11.1.0</version>
591+
<configuration>
592+
<connectionTimeout>60000</connectionTimeout>
593+
<nvdMaxRetryCount>10</nvdMaxRetryCount>
594+
<failBuildOnCVSS>7</failBuildOnCVSS>
595+
<nvdApiKeyEnvironmentVariable>NVD_API_KEY</nvdApiKeyEnvironmentVariable>
596+
<suppressionFile>${project.rootdir}/.pipeline/dependency-check-suppression.xml</suppressionFile>
597+
<nvdValidForHours>46</nvdValidForHours>
598+
</configuration>
599+
</plugin>
587600
</plugins>
588601
</build>
589602
<profiles>

0 commit comments

Comments
 (0)