-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbackend_owasp_dependency_check.yml
More file actions
66 lines (59 loc) · 2.13 KB
/
backend_owasp_dependency_check.yml
File metadata and controls
66 lines (59 loc) · 2.13 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
name: OWASP Dependency Check ensure no vulnerable dependencies
run-name: OWASP Dependency Check
on:
workflow_call:
secrets:
NIST_OWASP_API_KEY:
description: "API Key for the national vulnerability database used by OWASP Dependency Check"
required: true
jobs:
owasp-dependency-check:
name: OWASP Dependency Check
runs-on: ubuntu-latest
timeout-minutes: 100
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set up JDK 25
uses: actions/setup-java@v5
with:
java-version: '25'
distribution: 'corretto'
- name: Get Date for OWASP Cache
id: get-cache-date
run: |
echo "date=$(/bin/date -u "+%Y%m%d")" >> $GITHUB_OUTPUT
shell: bash
- name: check NIST key length
env:
NIST_OWASP_API_KEY: ${{ secrets.NIST_OWASP_API_KEY }}
run: |
echo "Key length: ${#NIST_OWASP_API_KEY}"
- name: Restore Maven Cache
uses: actions/cache/restore@v5
with:
path: ~/.m2/repository
# Using date in cache key as OWASP database may change, without the pom changing
key: ${{ runner.os }}-owasp-${{ steps.get-cache-date.outputs.date }}-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-owasp-${{ steps.get-cache-date.outputs.date }}
${{ runner.os }}-owasp-
- name: Maven install
run: mvn -B install -DskipTests -T 1C
- name: Run OWASP Dependency Check
run: |
mvn org.owasp:dependency-check-maven:check \
-DossindexAnalyzerEnabled=false \
-DnvdApiKey=${{ secrets.NIST_OWASP_API_KEY }} \
-DossindexAnalyzerEnabled=false \
-DpnpmAuditAnalyzerEnabled=false \
-DnodeAuditAnalyzerEnabled=false \
-DyarnAuditAnalyzerEnabled=false
- name: Save Maven Cache
uses: actions/cache/save@v5
if: always()
with:
path: ~/.m2/repository
key: ${{ runner.os }}-owasp-${{ steps.get-cache-date.outputs.date }}-${{ hashFiles('**/pom.xml') }}