Skip to content

Commit 2d37d5a

Browse files
committed
Clean up a few scripts.
1 parent e182afc commit 2d37d5a

7 files changed

+15
-15
lines changed

.gitignore

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.DS_Store
2+
.dccache
23
.java-version
34
.classpath
45
.project
@@ -7,11 +8,13 @@
78
*.iml
89

910
data/out.csv
11+
owasp-benchmark/
1012
reports/
13+
.scannerwork/
1114
scripts/SonarQubeCredentials.sh
15+
src/main/resources/benchmark.properties
1216
target/
1317
testfiles/
1418
tools/Contrast/contrast.jar
1519
tools/Contrast/contrast.yaml
1620
tools/Contrast/working/
17-

createScorecards.bat

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
# source "scripts/verifyBenchmarkPluginAvailable.sh" - Don't have .bat version of this (yet)
2-
#mvn -Djava.awt.headless=true org.owasp:benchmarkutils-maven-plugin:create-scorecard -DconfigFile=config/score_v1.3config.yaml
32
call mvn -Djava.awt.headless=true org.owasp:benchmarkutils-maven-plugin:create-scorecard
43

createScorecards.sh

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
source "scripts/verifyBenchmarkPluginAvailable.sh"
2-
#mvn -Djava.awt.headless=true org.owasp:benchmarkutils-maven-plugin:create-scorecard -DconfigFile=config/score_v1.3config.yaml
3-
mvn -Djava.awt.headless=true org.owasp:benchmarkutils-maven-plugin:create-scorecard
2+
MAVEN_OPTS="-Xmx8G" mvn -Djava.awt.headless=true org.owasp:benchmarkutils-maven-plugin:create-scorecard
43

scripts/runCodeQL.sh

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
## For Xcode command line, run: xcode-select -p 1>/dev/null;echo $? - If this returns 0, its installed, if 2, its not installed.
1010
## For Rosetta 2, run: lsbom -f /Library/Apple/System/Library/Receipts/com.apple.pkg.RosettaUpdateAuto.bom - And if it returns a list of files, it's installed.
1111

12-
1312
# This then runs the codeql scan:
1413
benchmark_version=$(scripts/getBenchmarkVersion.sh)
1514
../../tools/codeql-home/codeql/codeql database analyze owasp-benchmark java-code-scanning.qls --format=sarifv2.1.0 --output=results/Benchmark_$benchmark_version-codeql_java-code-scanning_qls.sarif

scripts/runCodeQLFull.sh

+3-4
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@
55
# tested: java-lgtm.qls - Standard LGTM queries for Java - scores the same as standard java-code-scanning.qls
66
# tested: java-lgtm-full.qls - Standard LGTM queries for Java, including ones not displayed by default. Scores the same as security-extended ruleset.
77

8-
# This script assumes the owasp-benchmark database has already been initialized by running this first:
9-
# ../../Tools/codeql-home/codeql/codeql database create owasp-benchmark --language=java
10-
#../../Tools/codeql-home/codeql/codeql database analyze owasp-benchmark java-security-extended.qls --format=sarifv2.1.0 --output=results/Benchmark_1.2-codeql_java-security-extended.sarif
8+
# This script assumes CodeQL has been installed and the owasp-benchmark database has already been initialized per the instructions in runCodeQL.sh
9+
1110
benchmark_version=$(scripts/getBenchmarkVersion.sh)
12-
../../Tools/codeql-home/codeql/codeql database analyze owasp-benchmark java-security-and-quality.qls --format=sarifv2.1.0 --output=results/Benchmark_$benchmark_version-codeql_java-security-and-quality.sarif
11+
../../tools/codeql-home/codeql/codeql database analyze owasp-benchmark java-security-and-quality.qls --format=sarifv2.1.0 --output=results/Benchmark_$benchmark_version-codeql_java-security-and-quality.sarif
1312

scripts/runSemgrep.sh

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
#!/usr/bin/env bash
22

3-
# Check for install/updates at https://github.com/returntocorp/semgrep
3+
# Check for install/updates at https://semgrep.dev/docs/update/
44

55
source scripts/requireCommand.sh
66

77
requireCommand docker
88

9-
docker pull returntocorp/semgrep
9+
docker pull docker.io/semgrep/semgrep
1010

1111
benchmark_version=$(scripts/getBenchmarkVersion.sh)
12-
semgrep_version=$(docker run --rm returntocorp/semgrep semgrep --version)
12+
semgrep_version=$(docker run --rm semgrep/semgrep semgrep --version)
1313
result_file="/src/results/Benchmark_$benchmark_version-Semgrep-v$semgrep_version.json"
1414

15-
docker run --rm -v "${PWD}:/src" returntocorp/semgrep semgrep --config p/security-audit -q --json -o "$result_file" . > /dev/null
15+
docker run --rm -v "${PWD}:/src" semgrep/semgrep semgrep --config p/security-audit -q --json -o "$result_file" . > /dev/null
16+

scripts/runSonarQube.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ while (((page - 1) * elements_per_request < hotspot_count)); do
9999
done
100100
echo "Writing end results json content";
101101
cp resdump.json "${result_file}";
102-
echo "Done, please go ahead an generate the scorecard";
103-
## cleanup the two files generated to record results, if want them for debug, you can comment the following line
102+
echo "Done, please go ahead and generate the scorecard";
103+
## cleanup the two files generated to record results, if you want them for debug purposes, comment out the following line
104104
rm resdump.json buffdump.json;
105105

0 commit comments

Comments
 (0)