Skip to content

Commit 34e2065

Browse files
committed
adding find sec bugs scan
1 parent 6ec2fa0 commit 34e2065

File tree

5 files changed

+32
-1
lines changed

5 files changed

+32
-1
lines changed

.github/workflows/maven.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,7 @@ jobs:
2222
java-version: 1.8
2323
- name: Build with Maven
2424
run: mvn -B package --file pom.xml
25+
- name: Run findSecBugs scan
26+
run: |
27+
chmod +x ./findsecbugs-cli-1.10.1/findsecbugs.sh
28+
./findsecbugs-cli-1.10.1/findsecbugs.sh -progress -html -output report.htm target/JavaVulnerableLab.war

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
.project
88
.classpath
99
factoryConfiguration.json
10-
10+
report.htm
1111
### Eclipse ###
1212

1313
.metadata
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@echo off
2+
java -cp %~dp0lib/* edu.umd.cs.findbugs.LaunchAppropriateUI -quiet -pluginList %~dp0lib/findsecbugs-plugin-1.10.1.jar -include %~dp0include.xml %*
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
3+
SOURCE="${BASH_SOURCE[0]}"
4+
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
5+
DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"
6+
SOURCE="$(readlink "$SOURCE")"
7+
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
8+
done
9+
DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"
10+
FINDBUGS_PLUGIN="$(find "$DIR"/lib/findsecbugs-plugin-* | sort --version-sort | tail -n1)"
11+
12+
for LIB in "$DIR"/lib/*.jar; do
13+
if [[ -z "${LIBS// }" ]]; then
14+
LIBS=$LIB
15+
else
16+
LIBS=$LIB:$LIBS
17+
fi
18+
done
19+
20+
java -cp "$LIBS" edu.umd.cs.findbugs.LaunchAppropriateUI -quiet -pluginList "$FINDBUGS_PLUGIN" -include "$DIR"/include.xml $@

findsecbugs-cli-1.10.1/include.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<FindBugsFilter>
2+
<Match>
3+
<Bug category="SECURITY"/>
4+
</Match>
5+
</FindBugsFilter>

0 commit comments

Comments
 (0)