You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
codeql database", or "find vulnerabilities with codeql". Supports "run all" (security-and-quality
7
-
suite) and "important only" (high-precision security findings) scan modes. Also handles
8
-
creating data extension models and processing CodeQL SARIF output.
7
+
+ security-experimental suites) and "important only" (high-precision security findings) scan
8
+
modes. Also handles creating data extension models and processing CodeQL SARIF output.
9
9
allowed-tools:
10
10
- Bash
11
11
- Read
@@ -155,6 +155,7 @@ Then execute the full pipeline: **build database → create data extensions →
155
155
These shortcuts lead to missed findings. Do not accept them:
156
156
157
157
-**"security-extended is enough"** - It is the baseline. Always check if Trail of Bits packs and Community Packs are available for the language. They catch categories `security-extended` misses entirely.
158
+
-**"security-and-quality is the broadest suite"** - `security-and-quality` excludes all `experimental/` query paths. For run-all mode, import both `security-and-quality` and `security-experimental`. The delta is 1–52 queries depending on the language.
158
159
-**"The database built, so it's good"** - A database that builds does not mean it extracted well. Always run quality assessment and check file counts against expected source files.
159
160
-**"Data extensions aren't needed for standard frameworks"** - Even Django/Spring apps have custom wrappers that CodeQL does not model. Skipping extensions means missing vulnerabilities.
160
161
-**"build-mode=none is fine for compiled languages"** - It produces severely incomplete analysis. Only use as an absolute last resort. On macOS, try the arm64 toolchain workaround or Rosetta first.
> **Suite hierarchy:**`security-and-quality` and `security-experimental` are complementary. `security-and-quality` excludes `experimental/` query paths. `security-experimental` includes them but excludes code quality queries. For maximum coverage (run-all mode), import both.
Copy file name to clipboardExpand all lines: plugins/static-analysis/skills/codeql/references/run-all-suite.md
+13-5Lines changed: 13 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,17 +6,23 @@ In run-all mode, generate a custom `.qls` query suite file at runtime. This ensu
6
6
7
7
When you pass a pack name directly to `codeql database analyze` (e.g., `-- codeql/cpp-queries`), CodeQL uses the pack's `defaultSuiteFile` field from `qlpack.yml`. For official packs, this is typically `codeql-suites/<lang>-code-scanning.qls`, which applies strict precision and severity filters. This silently drops many queries and can produce zero results for small codebases.
8
8
9
-
The run-all suite explicitly references the broadest built-in suite (`security-and-quality`) for official packs and loads third-party packs with minimal filtering.
9
+
The run-all suite explicitly imports both `security-and-quality` and `security-experimental` from official packs, plus third-party packs with minimal filtering.
10
+
11
+
> **Why both suites?**`security-and-quality` = stable security + code quality (excludes `experimental/` paths). `security-experimental` = stable security + experimental security (re-includes `experimental/` paths tagged `security`). They are complementary — importing both is safe since CodeQL deduplicates shared queries automatically.
10
12
11
13
## Suite Template
12
14
13
15
Generate this file as `run-all.qls` in the results directory before running analysis:
14
16
15
17
```yaml
16
-
- description: Run-all — all security and quality queries from all installed packs
17
-
# Official queries: use security-and-quality suite (broadest built-in suite)
18
+
- description: Run-all — all security, experimental, and quality queries from all installed packs
19
+
# Official queries: import BOTH suites (they are complementary, not hierarchical)
Copy file name to clipboardExpand all lines: plugins/static-analysis/skills/codeql/workflows/run-analysis.md
+9-8Lines changed: 9 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ Two modes control analysis scope. Both use all installed packs — the differenc
8
8
9
9
| Mode | Description | Suite Reference |
10
10
|------|-------------|-----------------|
11
-
|**Run all**| All queries from all installed packs via `security-and-quality`suite|[run-all-suite.md](../references/run-all-suite.md)|
11
+
|**Run all**| All queries from all installed packs via `security-and-quality`+ `security-experimental` suites|[run-all-suite.md](../references/run-all-suite.md)|
12
12
|**Important only**| Security queries filtered by precision and security-severity threshold |[important-only-suite.md](../references/important-only-suite.md)|
13
13
14
14
> **WARNING:** Do NOT pass pack names directly to `codeql database analyze` (e.g., `-- codeql/cpp-queries`). Each pack's `defaultSuiteFile` silently applies strict filters and can produce zero results. Always use an explicit suite reference.
| Step 2 |**SOFT GATE**| User selects mode; confirms installed/ignored for each missing pack |
35
-
| Step 3 |**SOFT GATE**| User approves query packs, model packs, and threat model selection |
34
+
| Step 2a |**SOFT GATE**| User selects scan mode. Skip only if user said "run all" or "important only" verbatim. |
35
+
| Step 3a |**HARD GATE**| User confirms query pack selection. Always ask — no auto-skip. |
36
+
| Step 3c |**HARD GATE**| User selects threat model. Always ask — no auto-skip. |
36
37
37
-
**Auto-skip rule:**If the user already specified a choice in the invocation, skip the corresponding `AskUserQuestion` and use the provided value directly.
38
+
**Auto-skip rules are per-gate.**Each gate documents its own skip condition. Choosing "full scan" or "run all" satisfies the scan mode gate (2a) but does not satisfy pack confirmation (3a) or threat model selection (3c).
38
39
39
40
---
40
41
@@ -94,7 +95,7 @@ If multi-language database, ask which language to analyze.
94
95
95
96
#### 2a: Select Scan Mode
96
97
97
-
**Skip if user already specified.**Otherwise use `AskUserQuestion`:
98
+
**Skip only if user said "run all" or "important only" in their prompt.**"Full scan", "scan", or "analyze" do NOT count — ask.
98
99
99
100
```
100
101
header: "Scan Mode"
@@ -139,13 +140,13 @@ Record all detected packs for Step 3.
139
140
**Exit:** User confirmed query packs, model packs, and threat model selection; all flags built (`THREAT_MODEL_FLAG`, `MODEL_PACK_FLAGS`, `ADDITIONAL_PACK_FLAGS`)
140
141
141
142
> **CHECKPOINT** — Present available packs to user for confirmation.
142
-
> **Skip if user already specified pack preferences.**
143
+
> **Always ask. Do not auto-skip.**
143
144
144
145
#### 3a: Confirm Query Packs
145
146
146
147
**Important-only mode:** Inform user all installed packs included with filtering. Proceed to 3b.
147
148
148
-
**Run-all mode:** Use `AskUserQuestion` to confirm "Use all" or "Select individually".
149
+
**Run-all mode:** Use `AskUserQuestion` to confirm "Use all" or "Select individually". Always ask — the user needs to see which packs will run.
149
150
150
151
#### 3b: Select Model Packs (if any detected)
151
152
@@ -162,7 +163,7 @@ Use `AskUserQuestion`: "Use all (Recommended)" / "Select individually" / "Skip".
162
163
163
164
Threat models control which input sources CodeQL treats as tainted. See [threat-models.md](../references/threat-models.md).
164
165
165
-
Use `AskUserQuestion`:
166
+
**Always ask.** Do not default to "remote only" without user confirmation. Use `AskUserQuestion`:
0 commit comments