Skip to content

Commit

Permalink
Fix runContrastCodeSec_OnSource.sh script. Add Snyk version to runSnyk
Browse files Browse the repository at this point in the history
scripts. Delete all the .xml metadata files for each test case .java
file as they aren't needed. All that info is in the expectedresults.csv
file for the entire test suite.
  • Loading branch information
Dave Wichers committed Jan 24, 2025
1 parent 00931b7 commit f190e05
Show file tree
Hide file tree
Showing 2,744 changed files with 20 additions and 19,184 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
.settings/
.idea/
*.iml
.scannerwork/

data/out.csv
owasp-benchmark/
reports/
.scannerwork/
scripts/SonarQubeCredentials.sh
src.zip
src/main/resources/benchmark.properties
target/
testfiles/
Expand Down
10 changes: 9 additions & 1 deletion scripts/runContrastCodeSec_OnSource.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,17 @@
# brew tap contrastsecurity/tap
# brew install contrast

# To scan the source code you have to create a .zip of the src/ directory so src.zip exists in the project's root folder.

if [ -f "./src.zip" ]; then

# Note: you have to do 'contrast auth' first, and successfully authenticate before you can run this.
benchmark_version=$(scripts/getBenchmarkVersion.sh)

contrast scan -f src --save
contrast scan -f src.zip --timeout=10000 --save
mv results.sarif results/Benchmark_$benchmark_version-ContrastCodeSec_OnSrc.sarif

else
echo "ERROR: You must create a .zip of the src directory first, before running this script."
fi

4 changes: 3 additions & 1 deletion scripts/runSnykSAST.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Install Snyk per: https://docs.snyk.io/snyk-cli/install-or-update-the-snyk-cli
benchmark_version=$(scripts/getBenchmarkVersion.sh)
snyk code test --sarif-file-output=results/Benchmark_$benchmark_version-snykCodeCli.sarif
Snyk_version=$(snyk -v)

snyk code --sarif-file-output=results/Benchmark_$benchmark_version-snykCodeCli-v$Snyk_version.sarif

6 changes: 6 additions & 0 deletions scripts/runSnykSAST_OnWindows.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Install Snyk per: https://docs.snyk.io/snyk-cli/install-or-update-the-snyk-cli
benchmark_version=$(scripts/getBenchmarkVersion.sh)
Snyk_version=$(snyk-win -v)

snyk-win code test --sarif-file-output=results/Benchmark_$benchmark_version-snykCodeCli-v$Snyk_version.sarif

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit f190e05

Please sign in to comment.