Skip to content

Commit a214551

Browse files
committed
Update CodeQL tool scripts to work with latest version (2.19.4). Old scripts don't work anymore with this version.
1 parent 78eb964 commit a214551

File tree

3 files changed

+12
-16
lines changed

3 files changed

+12
-16
lines changed

scripts/runCodeQL.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
# Prerequisites:
44
# 1) Install codeql in a tools/ directory that is a peer to the folder containing BenchmarkJava. For example, if you have a git/ folder, which contains BenchmarkJava, BenchmarkUtils, etc., then the tools/ folder would be at the same level as the git/ folder. i.e., relative to BenchmarkJava, it is at ../../tools/code-ql-home.
55
# 2) Then the owasp-benchmark database has to be initialized by running this:
6-
# ../../tools/codeql-home/codeql/codeql database create owasp-benchmark --language=java
6+
# ../tools/codeql-home/codeql/codeql database create owasp-benchmark --language=java
77

88
# Mac Users: "If you are using macOS on Apple Silicon (for example, Apple M1), ensure that the Xcode command-line developer tools and Rosetta 2 are installed."
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

1212
# This then runs the codeql scan:
1313
benchmark_version=$(scripts/getBenchmarkVersion.sh)
14-
../../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
14+
../tools/codeql-home/codeql/codeql database analyze owasp-benchmark codeql/java-queries --format=sarifv2.1.0 --output=results/Benchmark_$benchmark_version-codeql_java-queries.sarif
1515

scripts/runCodeQLFull.sh

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

scripts/translateCodeQL.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1-
#a This translates the current app, and builds up the rules databases. This only has to be run once after each code change.
2-
../../tools/codeql-home/codeql/codeql database create owasp-benchmark --language=java --overwrite
1+
# First, you have to get the platform binaries from: https://github.com/github/codeql-cli-binaries/releases
2+
# And then install them in a tools directory, that is a peer to your HOME_FOLDER. HOME_FOLDER should contain BenchmarkJava, BenchmarkUtils, etc.
3+
# The unzipped codeql-binaries codeql/ folder should be put in tools/codeql-home/
4+
# NOTE: This tool requires Java 11+
5+
6+
# You have to download the rulepacks now. This does this.
7+
../tools/codeql-home/codeql/codeql pack download codeql/java-queries
8+
9+
# This translates the current app, and builds up the rules databases. This only has to be run once after each code change.
10+
../tools/codeql-home/codeql/codeql database create owasp-benchmark --language=java --overwrite --command="mvn clean package"
311

0 commit comments

Comments
 (0)