Skip to content

Commit b25801a

Browse files
author
Dave Wichers
committed
Create a 2nd Contrast CodeSec script for scanning source code, and move
original to its clear that one scans the WAR. Fix the mvnFortifyScan.bat so it works on Windows, but it has to be run in a gitbash shell.
1 parent a3e11b7 commit b25801a

4 files changed

+30
-3
lines changed

scripts/mvnFortifyScan.bat

-2
This file was deleted.

scripts/mvnFortifyScan_OnWindows.sh

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
benchmark_version=$(scripts/getBenchmarkVersion.sh)
2+
FortifySCA_version=$(sourceanalyzer -v | grep 'Fortify Static' | cut -d" " -f5)
3+
FortifyRulePack_version=$(fortifyupdate.cmd -showInstalledRules | grep "Core, Java v" | cut -d" " -f7)
4+
5+
results_file="results/Benchmark_${benchmark_version}-Fortify${FortifySCA_version}_${FortifyRulePack_version}.fpr"
6+
7+
sourceanalyzer -b benchmark -Xmx10G -scan -f $results_file
8+
echo "Results written to: $results_file"
9+
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# To use Contrast CodeSec you have to install it first.
2+
# See the install instructions at: https://www.contrastsecurity.com/developer/codesec/
3+
4+
# For example, on Mac:
5+
# brew tap contrastsecurity/tap
6+
# brew install contrast
7+
8+
# Note: you have to do 'contrast auth' first, and successfully authenticate before you can run this.
9+
benchmark_version=$(scripts/getBenchmarkVersion.sh)
10+
11+
contrast scan -f src --save
12+
mv results.sarif results/Benchmark_$benchmark_version-ContrastCodeSec_OnSrc.sarif
13+
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
1+
# To use Contrast CodeSec you have to install it first.
2+
# See the install instructions at: https://www.contrastsecurity.com/developer/codesec/
3+
4+
# For example, on Mac:
5+
# brew tap contrastsecurity/tap
6+
# brew install contrast
7+
18
# Note: you have to do 'contrast auth' first, and successfully authenticate before you can run this.
29
benchmark_version=$(scripts/getBenchmarkVersion.sh)
310

411
contrast scan -f target/benchmark.war --save
5-
mv results.sarif results/Benchmark_$benchmark_version-ContrastCodeSec.sarif
12+
mv results.sarif results/Benchmark_$benchmark_version-ContrastCodeSec_OnWAR.sarif
613

0 commit comments

Comments
 (0)