diff --git a/bootstrap.md b/bootstrap.md index 3547c03..cbe3e0a 100644 --- a/bootstrap.md +++ b/bootstrap.md @@ -350,6 +350,37 @@ If no naming mechanism is available, skip session naming. for a code review of C code, suggest adding the `memory-safety-c` protocol. - **Suggest taxonomies** when the task involves classification. For example, if investigating stack corruption, suggest the `stack-lifetime-hazards` taxonomy. +- **Ask for the audit domain** when the selected template is + `investigate-security`, `review-code`, `review-cpp-code`, or + `exhaustive-bug-hunt`. The library includes CWE-derived per-domain + taxonomies that scope findings to domain-relevant vulnerability classes. + Ask the user which domain best describes the code under review: + + | Domain | Taxonomy | Description | + |--------|----------|-------------| + | `kernel-mode-c-cpp` | `cwe-kernel-mode-c-cpp` | OS kernel and driver code in C/C++ | + | `native-user-mode-c-cpp` | `cwe-native-user-mode-c-cpp` | User-mode native applications in C/C++ | + | `managed-dotnet` | `cwe-managed-dotnet` | .NET managed code (C#, F#, VB.NET) | + | `web-js-ts` | `cwe-web-js-ts` | Web frontend JavaScript/TypeScript | + | `web-backend` | `cwe-web-backend` | Server-side web applications (any language) | + | `cloud-service` | `cwe-cloud-service` | Cloud-hosted services and APIs | + | `iac` | `cwe-iac` | Infrastructure as Code (Terraform, Bicep, ARM, etc.) | + | `firmware-embedded` | `cwe-firmware-embedded` | Firmware and embedded systems | + | `crypto-protocols` | `cwe-crypto-protocols` | Cryptographic protocol design and implementation | + | `data-processing` | `cwe-data-processing` | Data pipelines, ETL, batch processing | + | `cli-tools` | `cwe-cli-tools` | Command-line tools and utilities | + | `mobile-app` | `cwe-mobile-app` | Mobile applications (iOS, Android) | + | `container-k8s` | `cwe-container-k8s` | Container and Kubernetes workloads | + | *(none)* | *(skip)* | Do not scope by CWE domain | + + If the user has already provided enough context to infer the domain + (e.g., "review this C kernel driver" → `kernel-mode-c-cpp`), suggest + the inferred domain and ask for confirmation instead of presenting the + full table. If the user declines CWE scoping, skip it — the template's + existing taxonomies still apply. When a domain is selected, add the + corresponding `cwe-` taxonomy to the assembled prompt's + `# Classification Taxonomy` section alongside any taxonomies already + declared by the template. - **Include non-goals** in every assembled prompt. Ask the user what should be explicitly out of scope, or suggest sensible defaults from the template. - **Allow customization.** If the user wants to modify a component (e.g., diff --git a/scripts/ingest-cwe.py b/scripts/ingest-cwe.py index bad4100..a4b7d6d 100644 --- a/scripts/ingest-cwe.py +++ b/scripts/ingest-cwe.py @@ -751,10 +751,6 @@ def generate_taxonomy_file(domain_key, cwes, weaknesses, version): f" {n} weakness classes from CWE version {version}. Use to scope", " security audits to domain-relevant vulnerability classes only.", f'cwe_version: "{version}"', - "applicable_to:", - " - investigate-security", - " - review-code", - " - exhaustive-bug-hunt", "---", "", f"# Taxonomy: CWE {info['display_name']}", diff --git a/taxonomies/cwe-cli-tools.md b/taxonomies/cwe-cli-tools.md index a7fc8ca..1450e28 100644 --- a/taxonomies/cwe-cli-tools.md +++ b/taxonomies/cwe-cli-tools.md @@ -10,10 +10,6 @@ description: > 65 weakness classes from CWE version 4.19.1. Use to scope security audits to domain-relevant vulnerability classes only. cwe_version: "4.19.1" -applicable_to: - - investigate-security - - review-code - - exhaustive-bug-hunt --- # Taxonomy: CWE CLI Tools diff --git a/taxonomies/cwe-cloud-service.md b/taxonomies/cwe-cloud-service.md index aec9bbd..9ea3fa8 100644 --- a/taxonomies/cwe-cloud-service.md +++ b/taxonomies/cwe-cloud-service.md @@ -10,10 +10,6 @@ description: > 113 weakness classes from CWE version 4.19.1. Use to scope security audits to domain-relevant vulnerability classes only. cwe_version: "4.19.1" -applicable_to: - - investigate-security - - review-code - - exhaustive-bug-hunt --- # Taxonomy: CWE Cloud Service diff --git a/taxonomies/cwe-container-k8s.md b/taxonomies/cwe-container-k8s.md index 7f675e8..3826b3d 100644 --- a/taxonomies/cwe-container-k8s.md +++ b/taxonomies/cwe-container-k8s.md @@ -10,10 +10,6 @@ description: > 5 weakness classes from CWE version 4.19.1. Use to scope security audits to domain-relevant vulnerability classes only. cwe_version: "4.19.1" -applicable_to: - - investigate-security - - review-code - - exhaustive-bug-hunt --- # Taxonomy: CWE Container and Kubernetes diff --git a/taxonomies/cwe-crypto-protocols.md b/taxonomies/cwe-crypto-protocols.md index 9b53fe9..14b204d 100644 --- a/taxonomies/cwe-crypto-protocols.md +++ b/taxonomies/cwe-crypto-protocols.md @@ -10,10 +10,6 @@ description: > 63 weakness classes from CWE version 4.19.1. Use to scope security audits to domain-relevant vulnerability classes only. cwe_version: "4.19.1" -applicable_to: - - investigate-security - - review-code - - exhaustive-bug-hunt --- # Taxonomy: CWE Cryptographic Protocols diff --git a/taxonomies/cwe-data-processing.md b/taxonomies/cwe-data-processing.md index 8bb8dbf..458b371 100644 --- a/taxonomies/cwe-data-processing.md +++ b/taxonomies/cwe-data-processing.md @@ -10,10 +10,6 @@ description: > 69 weakness classes from CWE version 4.19.1. Use to scope security audits to domain-relevant vulnerability classes only. cwe_version: "4.19.1" -applicable_to: - - investigate-security - - review-code - - exhaustive-bug-hunt --- # Taxonomy: CWE Data Processing diff --git a/taxonomies/cwe-firmware-embedded.md b/taxonomies/cwe-firmware-embedded.md index 03574e8..91594cb 100644 --- a/taxonomies/cwe-firmware-embedded.md +++ b/taxonomies/cwe-firmware-embedded.md @@ -10,10 +10,6 @@ description: > 226 weakness classes from CWE version 4.19.1. Use to scope security audits to domain-relevant vulnerability classes only. cwe_version: "4.19.1" -applicable_to: - - investigate-security - - review-code - - exhaustive-bug-hunt --- # Taxonomy: CWE Firmware and Embedded Systems diff --git a/taxonomies/cwe-iac.md b/taxonomies/cwe-iac.md index 2c857af..beccb81 100644 --- a/taxonomies/cwe-iac.md +++ b/taxonomies/cwe-iac.md @@ -10,10 +10,6 @@ description: > 8 weakness classes from CWE version 4.19.1. Use to scope security audits to domain-relevant vulnerability classes only. cwe_version: "4.19.1" -applicable_to: - - investigate-security - - review-code - - exhaustive-bug-hunt --- # Taxonomy: CWE Infrastructure as Code diff --git a/taxonomies/cwe-kernel-mode-c-cpp.md b/taxonomies/cwe-kernel-mode-c-cpp.md index aa15789..5fe5b41 100644 --- a/taxonomies/cwe-kernel-mode-c-cpp.md +++ b/taxonomies/cwe-kernel-mode-c-cpp.md @@ -10,10 +10,6 @@ description: > 113 weakness classes from CWE version 4.19.1. Use to scope security audits to domain-relevant vulnerability classes only. cwe_version: "4.19.1" -applicable_to: - - investigate-security - - review-code - - exhaustive-bug-hunt --- # Taxonomy: CWE Kernel-Mode C/C++ diff --git a/taxonomies/cwe-managed-dotnet.md b/taxonomies/cwe-managed-dotnet.md index 7894081..69c531c 100644 --- a/taxonomies/cwe-managed-dotnet.md +++ b/taxonomies/cwe-managed-dotnet.md @@ -10,10 +10,6 @@ description: > 92 weakness classes from CWE version 4.19.1. Use to scope security audits to domain-relevant vulnerability classes only. cwe_version: "4.19.1" -applicable_to: - - investigate-security - - review-code - - exhaustive-bug-hunt --- # Taxonomy: CWE Managed .NET diff --git a/taxonomies/cwe-mobile-app.md b/taxonomies/cwe-mobile-app.md index 49bd79b..1225ae3 100644 --- a/taxonomies/cwe-mobile-app.md +++ b/taxonomies/cwe-mobile-app.md @@ -10,10 +10,6 @@ description: > 23 weakness classes from CWE version 4.19.1. Use to scope security audits to domain-relevant vulnerability classes only. cwe_version: "4.19.1" -applicable_to: - - investigate-security - - review-code - - exhaustive-bug-hunt --- # Taxonomy: CWE Mobile Applications diff --git a/taxonomies/cwe-native-user-mode-c-cpp.md b/taxonomies/cwe-native-user-mode-c-cpp.md index db8d0b0..0d37d10 100644 --- a/taxonomies/cwe-native-user-mode-c-cpp.md +++ b/taxonomies/cwe-native-user-mode-c-cpp.md @@ -10,10 +10,6 @@ description: > 172 weakness classes from CWE version 4.19.1. Use to scope security audits to domain-relevant vulnerability classes only. cwe_version: "4.19.1" -applicable_to: - - investigate-security - - review-code - - exhaustive-bug-hunt --- # Taxonomy: CWE Native User-Mode C/C++ diff --git a/taxonomies/cwe-web-backend.md b/taxonomies/cwe-web-backend.md index e42ff3a..9d47cb8 100644 --- a/taxonomies/cwe-web-backend.md +++ b/taxonomies/cwe-web-backend.md @@ -10,10 +10,6 @@ description: > 423 weakness classes from CWE version 4.19.1. Use to scope security audits to domain-relevant vulnerability classes only. cwe_version: "4.19.1" -applicable_to: - - investigate-security - - review-code - - exhaustive-bug-hunt --- # Taxonomy: CWE Web Backend diff --git a/taxonomies/cwe-web-js-ts.md b/taxonomies/cwe-web-js-ts.md index 6dd210b..5ebc9d2 100644 --- a/taxonomies/cwe-web-js-ts.md +++ b/taxonomies/cwe-web-js-ts.md @@ -10,10 +10,6 @@ description: > 265 weakness classes from CWE version 4.19.1. Use to scope security audits to domain-relevant vulnerability classes only. cwe_version: "4.19.1" -applicable_to: - - investigate-security - - review-code - - exhaustive-bug-hunt --- # Taxonomy: CWE Web Frontend JavaScript/TypeScript