@@ -2,101 +2,26 @@ name: OWASP Dependency Check (.NET)
22
33on :
44 workflow_dispatch :
5- schedule :
6- - cron : " 0 9 * * 1"
75 push :
86 branches : [ main ]
9- paths :
10- - " cas-dotnet-sdk/**"
11- - " cas-dotnet-sdk-tests/**"
12- - " *.sln"
13- - " **/*.csproj"
14- - " **/*.props"
15- - " **/*.targets"
16- - " **/packages.config"
177 pull_request :
188 branches : [ main ]
19- paths :
20- - " cas-dotnet-sdk/**"
21- - " cas-dotnet-sdk-tests/**"
22- - " *.sln"
23- - " **/*.csproj"
24- - " **/*.props"
25- - " **/*.targets"
26- - " **/packages.config"
27-
28- permissions :
29- contents : read
30- security-events : write
319
3210jobs :
3311 dependency-check :
3412 name : Scan dependencies
3513 runs-on : ubuntu-latest
36- env :
37- DOTNET_NOLOGO : true
3814
3915 steps :
40- - name : Checkout repository
41- uses : actions/checkout@v4
42- with :
43- submodules : recursive
44-
45- - name : Setup .NET SDKs
46- uses : actions/setup-dotnet@v4
47- with :
48- dotnet-version : |
49- 6.0.x
50- 7.0.x
51- 8.0.x
52- 9.0.x
53- 10.0.x
54-
55- - name : Restore solution
56- run : dotnet restore cas-dotnet-sdk.sln
57-
58- - name : Prepare Dependency-Check data directory
59- run : mkdir -p .dependency-check-data
60-
61- - name : Cache Dependency-Check data
62- uses : actions/cache@v4
63- with :
64- path : .dependency-check-data
65- key : dependency-check-data-${{ runner.os }}-${{ hashFiles('cas-dotnet-sdk/**/*.csproj', 'cas-dotnet-sdk-tests/**/*.csproj') }}
66- restore-keys : |
67- dependency-check-data-${{ runner.os }}-
68-
69- - name : Run OWASP Dependency-Check (Docker)
70- env :
71- NVD_API_KEY : ${{ secrets.NVD_API_KEY }}
72- run : |
73- set -euo pipefail
74- mkdir -p dependency-check-report
75- docker run --rm \
76- -e NVD_API_KEY="${NVD_API_KEY:-}" \
77- -v "${{ github.workspace }}:/src" \
78- -v "${{ github.workspace }}/.dependency-check-data:/usr/share/dependency-check/data" \
79- -v "${{ github.workspace }}/dependency-check-report:/report" \
80- owasp/dependency-check:latest \
81- --project "cas-dotnet-sdk" \
82- --scan /src/cas-dotnet-sdk \
83- --scan /src/cas-dotnet-sdk-tests \
84- --format "HTML" \
85- --format "JSON" \
86- --format "SARIF" \
87- --out /report \
88- --failOnCVSS 7 \
89- ${NVD_API_KEY:+--nvdApiKey "${NVD_API_KEY}"}
90-
91- - name : Upload OWASP dependency report
92- uses : actions/upload-artifact@v4
93- with :
94- name : dependency-check-report
95- path : dependency-check-report
96- retention-days : 7
97-
98- - name : Upload SARIF to code scanning
99- if : success() && hashFiles('dependency-check-report/*.sarif') != ''
100- uses : github/codeql-action/upload-sarif@v3
101- with :
102- sarif_file : dependency-check-report/dependency-check-report.sarif
16+ - name : Install Dependency-Check
17+ run : |
18+ wget https://github.com/jeremylong/DependencyCheck/releases/latest/download/dependency-check.zip
19+ unzip dependency-check.zip
20+
21+ - name : Run scan
22+ run : |
23+ ./dependency-check/bin/dependency-check.sh \
24+ --project "cas-dotnet-sdk" \
25+ --scan . \
26+ --format "HTML" \
27+ --out reports
0 commit comments