Skip to content

Commit 10e9694

Browse files
felickzCopilotCopilot
authored
Add scan configuration for standard queries plus credential checks (#250)
* Add cross-language hardcoded credentials query suite Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Include community credential queries in suite Co-authored-by: felickz <1760475+felickz@users.noreply.github.com> * Select community credential queries through language-specific pack suites Keep the combined suite built-in-only and document pack-based selection and standalone CLI downloads. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Reference community credential queries directly through packs Remove unnecessary per-language suites and document the existing published query paths. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Provide credential checks as an additive scan configuration Replace the standalone suite with explicit language-keyed pack query paths. Keep standard defaults enabled and document optional suite selection and credential-only scanning. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Update README with configuration details Clarified usage of custom configuration files and CodeQL Action input. * Update README.md for clarity on config usage Clarified wording regarding the use of the `config:` input in the CodeQL Action. --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
1 parent ac5ea73 commit 10e9694

2 files changed

Lines changed: 71 additions & 2 deletions

File tree

‎configs/README.md‎

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# Community Configurations
22

33
The checked-in configurations reference community packs that have already been published to GHCR.
4-
Add new language packs to the relevant configurations after their first release so they do not
5-
point to packages that consumers cannot download yet.
4+
Add new language packs to the relevant configurations after their first release so they do not point to packages that consumers cannot download yet.
5+
We use a custom configuration file(.yml) rather than a standalone query suite(.qls) so the CodeQL Action downloads the required packs automatically and adds the selected queries without filtering the standard scan.
6+
Also consider that it is possible to directly use the `config:` input to the CodeQL Action and copy the statements from these config files directly without using the `config-file:` reference to the .yml files in this repository.
67

78
## [Default / CodeQL](default.yml)
89

@@ -20,6 +21,25 @@ These are based on the suite in each language suites folder called `{LANG}-audit
2021
> [!NOTE]
2122
> Ruby, Actions, Rust, and Swift do not currently have audit suites in this configuration.
2223

24+
## [Hardcoded credentials](hardcoded-credentials.yml)
25+
26+
Adds 12 built-in and 12 community credential/password queries across seven languages
27+
to the standard code-scanning scan. Packs are downloaded automatically, and explicit
28+
query paths avoid running entire community default suites. No global query filters
29+
restrict the standard scan.
30+
31+
```yaml
32+
- uses: github/codeql-action/init@v4
33+
with:
34+
languages: ${{ matrix.language }}
35+
config-file: GitHubSecurityLab/CodeQL-Community-Packs/configs/hardcoded-credentials.yml@main
36+
```
37+
38+
The config includes commented options for `code-scanning`, `security-extended`,
39+
and `disable-default-queries: true` to run only the listed credential checks.
40+
Copy the config into your repository to customize it; the remote reference works
41+
after merge to `main` and can be pinned to a commit SHA.
42+
2343
## [Synthetics](synthetics.yml)
2444

2545
This `synthetics.yml` configuration is intended for analyzing synthetic ([intentionally vulnerable](https://owasp.org/www-project-vulnerable-web-applications-directory/)) code samples for vulnerabilities. This configuration uses all possible security queries/extensions from the CodeQL built in packs, the CodeQL Community Packs, and additional OSS packs. It also includes the queries from the built-in `security-experimental.qls` suite with additional lower precision/experimental queries:

‎configs/hardcoded-credentials.yml‎

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: "Standard scan plus credential checks"
2+
3+
# Uncomment to run ONLY the credential queries listed under packs.
4+
# Leave the optional queries setting below commented in that case.
5+
# disable-default-queries: true
6+
7+
# Optional: explicitly select a standard suite (uncomment one).
8+
# queries:
9+
# - uses: code-scanning # Redundant while defaults are enabled.
10+
# - uses: security-extended # Broader security coverage.
11+
12+
packs:
13+
csharp:
14+
- "codeql/csharp-queries:Security Features/CWE-798/HardcodedConnectionString.ql"
15+
- "codeql/csharp-queries:Security Features/CWE-798/HardcodedCredentials.ql"
16+
- codeql/csharp-queries:Configuration/PasswordInConfigurationFile.ql
17+
- githubsecuritylab/codeql-csharp-queries:security/CWE-798/HardcodedCredentialsSymmetricSecurityKey.ql
18+
- githubsecuritylab/codeql-csharp-queries:security/CWE-328/WeakPasswordHashing.ql
19+
- githubsecuritylab/codeql-csharp-queries:security/CWE-759/HashWithoutSalt.ql
20+
21+
go:
22+
- codeql/go-queries:Security/CWE-798/HardcodedCredentials.ql
23+
24+
java:
25+
- codeql/java-queries:Security/CWE/CWE-798/HardcodedCredentialsApiCall.ql
26+
- codeql/java-queries:experimental/Security/CWE/CWE-555/PasswordInConfigurationFile.ql
27+
- githubsecuritylab/codeql-java-queries:security/CWE-798/HardcodedBase64Usage.ql
28+
- githubsecuritylab/codeql-java-queries:security/CWE-798/HardcodedPasswordsInProperties.ql
29+
- githubsecuritylab/codeql-java-queries:security/CWE-555/CredentialsInPropertiesFile.ql
30+
- githubsecuritylab/codeql-java-queries:security/CWE-598/CredentialsInOutboundUrl.ql
31+
- githubsecuritylab/codeql-java-queries:security/CWE-555/PasswordInConfigurationFile.ql
32+
- githubsecuritylab/codeql-java-queries:security/CWE-759/HashWithoutSalt.ql
33+
34+
javascript:
35+
- codeql/javascript-queries:Security/CWE-798/HardcodedCredentials.ql
36+
- codeql/javascript-queries:Security/CWE-313/PasswordInConfigurationFile.ql
37+
38+
python:
39+
- codeql/python-queries:Security/CWE-798/HardcodedCredentials.ql
40+
- githubsecuritylab/codeql-python-queries:security/CWE-798/HardcodedFrameworkSecrets.ql
41+
- githubsecuritylab/codeql-python-queries:security/CWE-1393/DefaultPasswordDB.ql
42+
- githubsecuritylab/codeql-python-queries:security/CWE-522/InsecurelyStoredPassword.ql
43+
44+
ruby:
45+
- codeql/ruby-queries:queries/security/cwe-798/HardcodedCredentials.ql
46+
47+
swift:
48+
- codeql/swift-queries:queries/Security/CWE-259/ConstantPassword.ql
49+
- codeql/swift-queries:queries/Security/CWE-321/HardcodedEncryptionKey.ql

0 commit comments

Comments
 (0)