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

File tree

4 files changed

+30
-3
lines changed

4 files changed

+30
-3
lines changed

scripts/mvnFortifyScan.bat

Lines changed: 0 additions & 2 deletions
This file was deleted.

scripts/mvnFortifyScan_OnWindows.sh

Lines changed: 9 additions & 0 deletions
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+
Lines changed: 13 additions & 0 deletions
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+
Lines changed: 8 additions & 1 deletion
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)