-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #45 from GitHubSecurityLab/geekmasher-configs
CodeQL Configurations
- Loading branch information
Showing
6 changed files
with
135 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
|
||
PR_NUMBER=${1} | ||
|
||
codeql_code="/tmp/codeql-test-code" | ||
codeql_db="/tmp/codeql-test-database" | ||
|
||
for file in $(gh pr view $PR_NUMBER --json files --jq '.files.[].path'); do | ||
if [[ ! -f "$file" ]]; then | ||
continue | ||
fi | ||
|
||
# config file | ||
if [[ "$file" == configs/*.yml ]]; then | ||
echo "[+] Compiling Config :: $file" | ||
|
||
if [[ -d "$codeql_db" ]]; then | ||
rm -rf "$codeql_db" | ||
fi | ||
|
||
mkdir -p "$codeql_code" | ||
echo "print('Hello, World!')" > "$codeql_code/main.py" | ||
|
||
codeql database create \ | ||
--source-root=$codeql_code \ | ||
--language=python \ | ||
--codescanning-config=$file \ | ||
"$codeql_db" | ||
fi | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Community Configurations | ||
|
||
## Default / CodeQL | ||
|
||
The `default.yml` configuration is the default config file used to make it easy to use the CodeQL Community Packs. | ||
|
||
## Audit | ||
|
||
The `audit.yml` configuration is used primary to audit code by running a number of audit queries with CodeQL. | ||
These are based on the suite in each language suites folder called `{LANG}-audit.qls` | ||
|
||
> [!NOTE] | ||
> Current Ruby and Swift are not supported |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: "GitHub Community Pack Audit Configuration" | ||
|
||
packs: | ||
# C/C++ | ||
- githubsecuritylab/codeql-cpp-queries:suites/cpp-audit.qls | ||
# C# | ||
- githubsecuritylab/codeql-csharp-queries:suites/csharp-audit.qls | ||
- githubsecuritylab/codeql-csharp-extensions | ||
- githubsecuritylab/codeql-csharp-library-sources | ||
# Go | ||
- githubsecuritylab/codeql-go-queries:suites/go-audit.qls | ||
# Java | ||
- githubsecuritylab/codeql-java-queries:suites/java-audit.qls | ||
- githubsecuritylab/codeql-java-extensions | ||
- githubsecuritylab/codeql-java-library-sources | ||
# JavaScript / Typescript | ||
- githubsecuritylab/codeql-javascript-queries:suites/javascript-audit.qls | ||
# Python | ||
- githubsecuritylab/codeql-python-queries:suites/python-audit.qls | ||
# Ruby | ||
# - githubsecuritylab/codeql-ruby-queries:suites/ruby-audit.qls | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: "GitHub Community Pack Default CodeQL Configuration" | ||
|
||
packs: | ||
# C/C++ | ||
- githubsecuritylab/codeql-cpp-queries | ||
# C# | ||
- githubsecuritylab/codeql-csharp-queries | ||
- githubsecuritylab/codeql-csharp-extensions | ||
- githubsecuritylab/codeql-csharp-library-sources | ||
# Go | ||
- githubsecuritylab/codeql-go-queries | ||
# Java | ||
- githubsecuritylab/codeql-java-queries | ||
- githubsecuritylab/codeql-java-extensions | ||
- githubsecuritylab/codeql-java-library-sources | ||
# JavaScript / Typescript | ||
- githubsecuritylab/codeql-javascript-queries | ||
# Python | ||
- githubsecuritylab/codeql-python-queries | ||
# Ruby | ||
- githubsecuritylab/codeql-ruby-queries | ||
|