Skip to content

Commit 91de2fc

Browse files
committed
Add owasp check
1 parent dacc524 commit 91de2fc

File tree

3 files changed

+74
-0
lines changed

3 files changed

+74
-0
lines changed

.github/workflows/owasp.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
on:
2+
push:
3+
branches: [ "master" ]
4+
pull_request:
5+
branches: [ "master" ]
6+
7+
workflow_dispatch:
8+
9+
jobs:
10+
analyze:
11+
name: Analyze
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v3
17+
18+
- run: |
19+
mvn -DskipTests install -P OWASP_CHECK
20+
21+
- name: Upload SARIF file
22+
uses: github/codeql-action/upload-sarif@v2
23+
with:
24+
# Path to SARIF file relative to the root of the repository
25+
sarif_file: target/dependency-check-report.sarif
26+
# Optional category for the results
27+
# Used to differentiate multiple results for one commit
28+
29+
category: OWASP-dependency-check

owasp-suppression-file.xml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<suppressions xmlns="https://jeremylong.github.io/DependencyCheck/dependency-suppression.1.3.xsd">
3+
</suppressions>

pom.xml

+42
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,21 @@
6464
</dependencies>
6565

6666
<build>
67+
<pluginManagement>
68+
<plugins>
69+
<plugin>
70+
<groupId>org.owasp</groupId>
71+
<artifactId>dependency-check-maven</artifactId>
72+
<version>8.2.1</version>
73+
<configuration>
74+
<suppressionFiles>
75+
<suppressionFile>cve-suppression.xml</suppressionFile>
76+
</suppressionFiles>
77+
<formats>sarif,html</formats>
78+
</configuration>
79+
</plugin>
80+
</plugins>
81+
</pluginManagement>
6782
<plugins>
6883
<plugin>
6984
<groupId>org.apache.maven.plugins</groupId>
@@ -193,5 +208,32 @@
193208
</plugins>
194209
</build>
195210
</profile>
211+
<profile>
212+
<id>OWASP_CHECK</id>
213+
<build>
214+
<plugins>
215+
<plugin>
216+
<groupId>org.owasp</groupId>
217+
<artifactId>dependency-check-maven</artifactId>
218+
<configuration>
219+
<suppressionFiles>
220+
<suppressionFile>owasp-suppression-file.xml</suppressionFile>
221+
</suppressionFiles>
222+
</configuration>
223+
<executions>
224+
<execution>
225+
<goals>
226+
<goal>check</goal>
227+
</goals>
228+
<configuration>
229+
<failBuildOnCVSS>10</failBuildOnCVSS>
230+
<skipTestScope>true</skipTestScope>
231+
</configuration>
232+
</execution>
233+
</executions>
234+
</plugin>
235+
</plugins>
236+
</build>
237+
</profile>
196238
</profiles>
197239
</project>

0 commit comments

Comments
 (0)