-
Notifications
You must be signed in to change notification settings - Fork 20
CodeQL Configurations #45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 9 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
04de8d1
feat(configs): Add initial default configuration file
GeekMasher 11dbd3f
feat(configs): Add audit configuration
GeekMasher ce54456
feat(ci): Add config script and update workflow
GeekMasher c8b9d13
feat(ci): Add CodeQL to PATH
GeekMasher 8bd3aa0
fix(scripts): Fix issue with using gh versus codeql directly
GeekMasher 0f7a196
feat(scripts): Update pr-config script
GeekMasher 57ac0e1
docs: Update READMEs
GeekMasher 7a3f414
docs: Fix README
GeekMasher 09e38e1
docs: Fix config link issue
GeekMasher 1442765
refactor: Rename codeql.yml to default.yml
GeekMasher File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 `codeql.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 hidden or 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 hidden or 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 | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.