mason-keller commited on
Commit ·
7aeb77d
1
Parent(s): d946e39
feat: add distributed eBPF microsegmentation & policy synthesis engine v1.12.0
Browse files- CHANGELOG.md +31 -0
- README.md +24 -24
- ROADMAP.md +2 -1
- docs/assets/locales/ar/architecture.svg +71 -65
- docs/assets/locales/ar/banner.svg +1 -1
- docs/assets/locales/en/architecture.svg +71 -65
- docs/assets/locales/en/banner.svg +1 -1
- docs/assets/locales/es/architecture.svg +71 -65
- docs/assets/locales/es/banner.svg +1 -1
- docs/assets/locales/fr/architecture.svg +71 -65
- docs/assets/locales/fr/banner.svg +1 -1
- docs/assets/locales/hi/architecture.svg +71 -65
- docs/assets/locales/hi/banner.svg +1 -1
- docs/assets/locales/id/architecture.svg +71 -65
- docs/assets/locales/id/banner.svg +1 -1
- docs/assets/locales/ko/architecture.svg +71 -65
- docs/assets/locales/ko/banner.svg +1 -1
- docs/assets/locales/pt-BR/architecture.svg +71 -65
- docs/assets/locales/pt-BR/banner.svg +1 -1
- docs/assets/locales/ru/architecture.svg +71 -65
- docs/assets/locales/ru/banner.svg +1 -1
- docs/assets/locales/zh-CN/architecture.svg +71 -65
- docs/assets/locales/zh-CN/banner.svg +1 -1
- docs/locales/ar.md +24 -24
- docs/locales/es.md +24 -24
- docs/locales/fr.md +24 -24
- docs/locales/hi.md +24 -24
- docs/locales/id.md +24 -24
- docs/locales/ko.md +24 -24
- docs/locales/pt-BR.md +24 -24
- docs/locales/ru.md +24 -24
- docs/locales/zh-CN.md +24 -24
- package.json +1 -1
- src/ebpf/microsegmentation_audit.ts +654 -0
- src/index.ts +104 -1
- src/mcp/server.ts +44 -1
- src/patch/patch_engine.ts +239 -0
- src/sandbox/canary_runner.ts +46 -0
- src/sandbox/canary_sandbox.ts +342 -0
- src/types/index.ts +108 -2
- tests/microsegmentation_audit.test.js +534 -0
CHANGELOG.md
CHANGED
|
@@ -5,6 +5,37 @@ All notable changes to this project will be documented in this file.
|
|
| 5 |
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
| 6 |
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
| 7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
## [1.11.0] - 2026-10-22
|
| 9 |
|
| 10 |
### Added
|
|
|
|
| 5 |
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
| 6 |
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
| 7 |
|
| 8 |
+
## [1.12.0] - 2026-10-22
|
| 9 |
+
|
| 10 |
+
### Added
|
| 11 |
+
- **Distributed eBPF Microsegmentation & Policy Synthesis Engine (`vulnforge_audit_microsegmentation`)**:
|
| 12 |
+
- Multi-Format Microsegmentation & Flow Telemetry Auto-Detection:
|
| 13 |
+
- Automatically parses and validates CiliumNetworkPolicy (`cilium.io/v2`), Kubernetes NetworkPolicy (`networking.k8s.io/v1`), Calico NetworkPolicy/GlobalNetworkPolicy (`projectcalico.org/v3`), and eBPF kernel flow telemetry streams (Cilium Hubble JSON / NetFlow telemetry).
|
| 14 |
+
- 8 Core Microsegmentation & Kernel Flow Vulnerability Audit Checks:
|
| 15 |
+
- Permissive Ingress Wildcard Policy (CWE-284, CWE-923): Detects empty ingress selectors (`ingress: [{}]`) or unqualified CIDR allowances (`0.0.0.0/0`) allowing unrestricted traffic from any source into sensitive workloads.
|
| 16 |
+
- Unrestricted Cloud Metadata API Access (CWE-200): Flags egress policies lacking explicit deny blocks for cloud provider metadata endpoints (`169.254.169.254/32` AWS/GCP/Azure IMDSv1/v2), preventing SSRF credential theft.
|
| 17 |
+
- Missing Default-Deny Isolation (CWE-276): Scans workloads and namespace configurations lacking explicit default-deny ingress/egress isolation policies, leaving pods open to unmonitored lateral traversal.
|
| 18 |
+
- Unencrypted Cross-Node Traffic (CWE-319): Audits network policy manifests for missing WireGuard (`encryption: wireguard`) or IPsec mesh transit encryption annotations for inter-node communication.
|
| 19 |
+
- Permissive Host Namespace Network Access (CWE-269): Identifies workload specifications configured with `hostNetwork: true`, bypassing cluster network policies and exposing host loopback interfaces.
|
| 20 |
+
- Unrestricted Egress Wildcards (CWE-668, CWE-284): Identifies wide-open egress rules (`toCIDR: 0.0.0.0/0`) permitting unmonitored command-and-control (C2) callbacks and data exfiltration.
|
| 21 |
+
- Unmonitored Cross-Namespace Traffic Flows (CWE-778): Detects cross-namespace flows and Hubble telemetry configurations lacking audit logging and namespace isolation constraints.
|
| 22 |
+
- Missing L7 Protocol Enforcement (CWE-284): Flags ingress/egress rules defined purely at L4 (TCP/UDP) without fine-grained L7 HTTP method/path filtering, permitting arbitrary API payloads across trusted ports.
|
| 23 |
+
- Automated Policy Synthesis Engine from Kernel Flow Telemetry:
|
| 24 |
+
- Synthesizes tight, least-privilege CiliumNetworkPolicy and Kubernetes NetworkPolicy definitions directly from captured eBPF Hubble kernel flow events.
|
| 25 |
+
- Generates precise `toEndpoints`, `toPorts` with L7 HTTP rules (exact HTTP methods and path prefixes), DNS egress allowances, and explicit cloud metadata deny blocks.
|
| 26 |
+
- Automated Defensive Patch Synthesis:
|
| 27 |
+
- Converts permissive ingress rules to strict label-selector matched ingress policies.
|
| 28 |
+
- Injects explicit egress deny rules for the link-local metadata address `169.254.169.254/32`.
|
| 29 |
+
- Injects L7 HTTP method and path filtering blocks into CiliumNetworkPolicy specifications.
|
| 30 |
+
- Injects WireGuard encryption annotations (`cilium.io/encryption: wireguard`).
|
| 31 |
+
- Revokes `hostNetwork: true` and isolates container network namespaces.
|
| 32 |
+
- In-Memory Microsegmentation Canary Sandbox (`MockMicrosegmentationHarness`):
|
| 33 |
+
- Evaluates network endpoint labels, policy evaluation matrices, L7 HTTP filtering, and metadata CIDR interception across dual-phase canaries.
|
| 34 |
+
- Dual-phase canary verification: Phase 1 evaluates attack blocking (confirms metadata access, unauthorized L7 methods, and cross-namespace spoofing are rejected); Phase 2 evaluates benign non-regression (confirms valid application traffic passes cleanly with zero regressions).
|
| 35 |
+
- CLI Flags & MCP Integration:
|
| 36 |
+
- Added `--audit-microsegmentation [--file <path>]` CLI command and registered 17th core MCP tool `vulnforge_audit_microsegmentation`.
|
| 37 |
+
- Integrated with `vulnforge_full_scan` via `microsegmentationContent`, `microsegmentationFormat`, and `flowTelemetryStream` parameters, and added Tier 13 demonstration to `--test-demo`.
|
| 38 |
+
|
| 39 |
## [1.11.0] - 2026-10-22
|
| 40 |
|
| 41 |
### Added
|
README.md
CHANGED
|
@@ -11,7 +11,7 @@
|
|
| 11 |
|
| 12 |
# 🛡️ VulnForge MCP
|
| 13 |
|
| 14 |
-
**Universal AI-Native Web, API, Database, CI/CD, Container/K8s, eBPF, Dynamic API Fuzzing, Supply Chain SBOM, Cosign Signature &
|
| 15 |
|
| 16 |
[](./LICENSE)
|
| 17 |
[](https://modelcontextprotocol.io/)
|
|
@@ -66,6 +66,9 @@ npx vulnforge-mcp --audit-cosign --file k8s/kyverno-verify.yaml
|
|
| 66 |
|
| 67 |
# 11. Direct WebAssembly eBPF & Host Telemetry Audit CLI Execution
|
| 68 |
npx vulnforge-mcp --audit-wasm-ebpf --file wasm-config.yaml
|
|
|
|
|
|
|
|
|
|
| 69 |
```
|
| 70 |
|
| 71 |
### Adding to Claude Desktop / Antigravity (`claude_desktop_config.json`)
|
|
@@ -84,7 +87,7 @@ npx vulnforge-mcp --audit-wasm-ebpf --file wasm-config.yaml
|
|
| 84 |
|
| 85 |
---
|
| 86 |
|
| 87 |
-
## 🏛️ The
|
| 88 |
|
| 89 |
<details open>
|
| 90 |
<summary><b>🏛️ View Architecture Pipeline Diagram (Click to toggle / 접기·펼치기)</b></summary>
|
|
@@ -110,18 +113,19 @@ npx vulnforge-mcp --audit-wasm-ebpf --file wasm-config.yaml
|
|
| 110 |
| **12** | **Supply Chain & SBOM Gate** | CycloneDX/SPDX SBOM and manifest auditing, internal scope dependency confusion (CWE-427), Levenshtein typosquatting heuristics (CWE-829), unpinned wildcards (CWE-1104), dangerous install script hooks (CWE-78), mutable Git branches, missing lockfile hashes (CWE-353), and NTIA EO 14028 minimum elements | Automated `.npmrc` scoped registry injection, canonical package replacement, semantic version pinning, `ignore-scripts=true` suppression, immutable Git commit SHA pinning, and NTIA metadata enrichment |
|
| 111 |
| **13** | **Cosign & Artifact Attestation** | OCI container image signature verification, Sigstore keyless Fulcio OIDC SAN validation, Rekor transparency log inclusion proofs, In-toto SLSA provenance level verification, and Kyverno/Gatekeeper admission policy auditing | Kyverno ClusterPolicy enforcement rules (`validationFailureAction: Enforce`), OPA Gatekeeper constraints, Rekor proof mandates, and immutable SHA-256 image digest pinning |
|
| 112 |
| **14** | **Wasm & eBPF Telemetry** | WebAssembly linear memory bounds (CWE-119), WASI host root preopen exposure (CWE-284), instruction fuel/CPU DoS (CWE-400), unpinned bytecode digests (CWE-345), dropped telemetry (CWE-778), and kernel credential leakage (CWE-209) | Memory page clamps (max: 256), scoped ephemeral preopens (`/sandbox`), instruction fuel budgeting (100k), digest pins, and PII scrubbing filters |
|
|
|
|
| 113 |
|
| 114 |
</details>
|
| 115 |
|
| 116 |
---
|
| 117 |
|
| 118 |
-
## 🛠️
|
| 119 |
|
| 120 |
<details open>
|
| 121 |
-
<summary><b>🛠️
|
| 122 |
<br>
|
| 123 |
|
| 124 |
-
VulnForge MCP exposes
|
| 125 |
|
| 126 |
1. **`vulnforge_audit_web`**:
|
| 127 |
- Analyzes HTTP response headers, cookie flags, and DOM client code.
|
|
@@ -169,16 +173,27 @@ VulnForge MCP exposes 16 specialized security audit tools to your AI agent:
|
|
| 169 |
- Detects unbounded linear memory growth, overprivileged WASI root preopens, missing execution fuel limits, unpinned Wasm module digests, dropped kernel telemetry without counters, plaintext credential leakage in argv, insecure shared memory state, and unconfined host root privileges.
|
| 170 |
- Correlates multi-host causal attack chains (dropper downloads, namespace unshare privesc, interactive reverse shells) and applies automated credential scrubbing.
|
| 171 |
- Parameters: `content` (string, optional raw config or manifest), `filePath` (string, optional path to file), `format` (optional string), `telemetryEvents` (optional array or JSON lines string), `strictCorrelation` (boolean, default true), `sanitizeTelemetry` (boolean, default true).
|
| 172 |
-
14. **`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 173 |
- Takes vulnerable code and automatically synthesizes a secure drop-in replacement with unified git diff and optional canary verification.
|
| 174 |
-
|
| 175 |
- Executes isolated Canary Sandbox verification on synthesized or custom defensive patches using native Node.js `vm`.
|
| 176 |
- Runs dual-phase validation: Phase 1 evaluates attack payload containment (confirms exploit is blocked); Phase 2 evaluates benign functional input (ensures zero regression).
|
| 177 |
- Returns structured `CanaryVerificationReport` (`VERIFIED_SAFE`, `ATTACK_LEAKED`, `REGRESSION_DETECTED`, `SYNTAX_ERROR`, `SANDBOX_TIMEOUT`).
|
| 178 |
-
|
| 179 |
-
- Executes an end-to-end 360-degree security audit across Web, API, Database, GraphQL, CI/CD, Container/Kubernetes, eBPF, Dynamic API Fuzzing, Cloud IAM, Cryptographic Vaults, Supply Chain SBOM, Cosign Signature Attestation,
|
| 180 |
|
| 181 |
### 📋 Sample Vulnerability Findings & CWE Classification
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 182 |
- `[CRITICAL] Unbounded WebAssembly Linear Memory Bounds / Missing Heap Limit (CWE-119 / Improper Memory Buffer Restriction)`
|
| 183 |
- `[CRITICAL] Overprivileged WASI Host Filesystem Preopens / Root Directory Exposure (CWE-284 / Improper Access Control)`
|
| 184 |
- `[CRITICAL] Unsigned Container Image / Missing Cryptographic Cosign Signature (CWE-347 / Improper Verification of Cryptographic Signature)`
|
|
@@ -200,21 +215,6 @@ VulnForge MCP exposes 16 specialized security audit tools to your AI agent:
|
|
| 200 |
- `[HIGH] Missing Explicit Workflow Permissions - Risk of Default Write Privileges (CWE-276 / Default Permissions)`
|
| 201 |
- `[HIGH] Script Injection via Context Expression in Run Step (CWE-78 / Command Injection)`
|
| 202 |
- `[HIGH] Hardcoded Secret / Plaintext Personal Access Token Detected (CWE-798 / Hard-coded Credentials)`
|
| 203 |
-
- `[CRITICAL] Untrusted PR Checkout via pull_request_target with Head SHA (CWE-250 / Privileged Execution)`
|
| 204 |
-
- `[CRITICAL] GraphQL Introspection Enabled in Production (CWE-200 / Information Exposure)`
|
| 205 |
-
- `[CRITICAL] Dependency Confusion Vulnerability - Missing Scoped Private Registry (CWE-427 / Uncontrolled Search Path Element)`
|
| 206 |
-
- `[HIGH] Keyless Attestation SAN Identity Mismatch / Untrusted OIDC Issuer (CWE-295 / Improper Certificate Validation)`
|
| 207 |
-
- `[HIGH] Missing Rekor Transparency Log Inclusion Proof - Rollback Vulnerability (CWE-353 / Missing Support for Integrity Check)`
|
| 208 |
-
- `[HIGH] Typosquatting Package Vector Detected: Possible Impersonation of Canonical Library (CWE-829 / Untrusted Control Sphere)`
|
| 209 |
-
- `[HIGH] Dangerous Install Lifecycle Script Hook - Remote Code Execution Risk (CWE-78 / Command Injection)`
|
| 210 |
-
- `[HIGH] Non-Compliant SBOM - Missing Mandatory NTIA Minimum Elements (Executive Order 14028 Non-Compliance)`
|
| 211 |
-
- `[MEDIUM] Mutable Container Image Tag Reference Lacking SHA-256 Digest Pin (CWE-1104 / Use of Unmaintained Third Party Component)`
|
| 212 |
-
- `[MEDIUM] Unpinned Dependency Wildcard Version Range in Production Manifest (CWE-1104 / Unmaintained Third Party Component)`
|
| 213 |
-
- `[HIGH] Missing runAsNonRoot & Container Running as Root User (CWE-276 / Incorrect Default Permissions)`
|
| 214 |
-
- `[HIGH] Kubernetes RBAC Wildcard Permissions Allocated (CWE-269 / Improper Privilege Management)`
|
| 215 |
-
- `[HIGH] Missing Explicit Workflow Permissions - Risk of Default Write Privileges (CWE-276 / Default Permissions)`
|
| 216 |
-
- `[HIGH] Script Injection via Context Expression in Run Step (CWE-78 / Command Injection)`
|
| 217 |
-
- `[HIGH] Hardcoded Secret / Plaintext Personal Access Token Detected (CWE-798 / Hard-coded Credentials)`
|
| 218 |
- `[MEDIUM] Unpinned Third-Party Action Mutable Tag @v4 - Supply Chain Attack Risk (CWE-829 / Untrusted Control Sphere)`
|
| 219 |
- `[MEDIUM] Container Root Filesystem Writable / Missing readOnlyRootFilesystem (CWE-732 / Incorrect Permission Assignment)`
|
| 220 |
|
|
|
|
| 11 |
|
| 12 |
# 🛡️ VulnForge MCP
|
| 13 |
|
| 14 |
+
**Universal AI-Native Web, API, Database, CI/CD, Container/K8s, eBPF, Dynamic API Fuzzing, Supply Chain SBOM, Cosign Signature, Wasm Telemetry & Microsegmentation Vulnerability Auditing with Automated Patch Injection MCP Server**
|
| 15 |
|
| 16 |
[](./LICENSE)
|
| 17 |
[](https://modelcontextprotocol.io/)
|
|
|
|
| 66 |
|
| 67 |
# 11. Direct WebAssembly eBPF & Host Telemetry Audit CLI Execution
|
| 68 |
npx vulnforge-mcp --audit-wasm-ebpf --file wasm-config.yaml
|
| 69 |
+
|
| 70 |
+
# 12. Direct eBPF Microsegmentation & Zero Trust Flow Policy Audit CLI Execution
|
| 71 |
+
npx vulnforge-mcp --audit-microsegmentation --file policies/cilium.yaml
|
| 72 |
```
|
| 73 |
|
| 74 |
### Adding to Claude Desktop / Antigravity (`claude_desktop_config.json`)
|
|
|
|
| 87 |
|
| 88 |
---
|
| 89 |
|
| 90 |
+
## 🏛️ The 15 Vulnerability Auditing Pillars
|
| 91 |
|
| 92 |
<details open>
|
| 93 |
<summary><b>🏛️ View Architecture Pipeline Diagram (Click to toggle / 접기·펼치기)</b></summary>
|
|
|
|
| 113 |
| **12** | **Supply Chain & SBOM Gate** | CycloneDX/SPDX SBOM and manifest auditing, internal scope dependency confusion (CWE-427), Levenshtein typosquatting heuristics (CWE-829), unpinned wildcards (CWE-1104), dangerous install script hooks (CWE-78), mutable Git branches, missing lockfile hashes (CWE-353), and NTIA EO 14028 minimum elements | Automated `.npmrc` scoped registry injection, canonical package replacement, semantic version pinning, `ignore-scripts=true` suppression, immutable Git commit SHA pinning, and NTIA metadata enrichment |
|
| 114 |
| **13** | **Cosign & Artifact Attestation** | OCI container image signature verification, Sigstore keyless Fulcio OIDC SAN validation, Rekor transparency log inclusion proofs, In-toto SLSA provenance level verification, and Kyverno/Gatekeeper admission policy auditing | Kyverno ClusterPolicy enforcement rules (`validationFailureAction: Enforce`), OPA Gatekeeper constraints, Rekor proof mandates, and immutable SHA-256 image digest pinning |
|
| 115 |
| **14** | **Wasm & eBPF Telemetry** | WebAssembly linear memory bounds (CWE-119), WASI host root preopen exposure (CWE-284), instruction fuel/CPU DoS (CWE-400), unpinned bytecode digests (CWE-345), dropped telemetry (CWE-778), and kernel credential leakage (CWE-209) | Memory page clamps (max: 256), scoped ephemeral preopens (`/sandbox`), instruction fuel budgeting (100k), digest pins, and PII scrubbing filters |
|
| 116 |
+
| **15** | **Microsegmentation & eBPF Flow** | CiliumNetworkPolicy, K8s NetworkPolicy, Calico & eBPF kernel flow telemetry (CWE-284, CWE-923, CWE-200, CWE-276, CWE-269, CWE-319, CWE-668, CWE-778) | Automated Zero Trust ingress isolation, L7 HTTP rules, metadata endpoint blocking, and Hubble flow telemetry policy synthesis |
|
| 117 |
|
| 118 |
</details>
|
| 119 |
|
| 120 |
---
|
| 121 |
|
| 122 |
+
## 🛠️ 17 Core MCP Security Tools
|
| 123 |
|
| 124 |
<details open>
|
| 125 |
+
<summary><b>🛠️ 17 Core MCP Security Tools (Click to toggle / 접기·펼치기)</b></summary>
|
| 126 |
<br>
|
| 127 |
|
| 128 |
+
VulnForge MCP exposes 17 specialized security audit tools to your AI agent:
|
| 129 |
|
| 130 |
1. **`vulnforge_audit_web`**:
|
| 131 |
- Analyzes HTTP response headers, cookie flags, and DOM client code.
|
|
|
|
| 173 |
- Detects unbounded linear memory growth, overprivileged WASI root preopens, missing execution fuel limits, unpinned Wasm module digests, dropped kernel telemetry without counters, plaintext credential leakage in argv, insecure shared memory state, and unconfined host root privileges.
|
| 174 |
- Correlates multi-host causal attack chains (dropper downloads, namespace unshare privesc, interactive reverse shells) and applies automated credential scrubbing.
|
| 175 |
- Parameters: `content` (string, optional raw config or manifest), `filePath` (string, optional path to file), `format` (optional string), `telemetryEvents` (optional array or JSON lines string), `strictCorrelation` (boolean, default true), `sanitizeTelemetry` (boolean, default true).
|
| 176 |
+
14. **`vulnforge_audit_microsegmentation`**:
|
| 177 |
+
- Deep inspection of CiliumNetworkPolicy, Kubernetes NetworkPolicy, Calico specifications, and eBPF kernel flow telemetry streams (Cilium Hubble / flow logs).
|
| 178 |
+
- Detects permissive ingress wildcards (CWE-284/CWE-923), unrestricted cloud metadata API access (`169.254.169.254` / CWE-200), missing default-deny isolation (CWE-276), unencrypted cross-node pod-to-pod traffic (CWE-319), permissive host namespace access (CWE-269), unrestricted egress wildcards (CWE-668), unmonitored cross-namespace flows (CWE-778), and missing L7 protocol enforcement (CWE-284).
|
| 179 |
+
- Automatically synthesizes least-privilege Cilium and Kubernetes NetworkPolicies directly from observed eBPF kernel flow telemetry events.
|
| 180 |
+
- Synthesizes automated drop-in hardening patches (default-deny rules, metadata CIDR blocks, L7 HTTP method/path filters, WireGuard annotations) with dual canary sandbox validation.
|
| 181 |
+
- Parameters: `content` (string, optional raw policy YAML text), `filePath` (string, optional path to file), `format` (optional string), `flowTelemetryStream` (optional array or JSON lines string), `strictIngress` (boolean, default true), `blockCloudMetadata` (boolean, default true).
|
| 182 |
+
15. **`vulnforge_inject_patch`**:
|
| 183 |
- Takes vulnerable code and automatically synthesizes a secure drop-in replacement with unified git diff and optional canary verification.
|
| 184 |
+
16. **`vulnforge_verify_patch`**:
|
| 185 |
- Executes isolated Canary Sandbox verification on synthesized or custom defensive patches using native Node.js `vm`.
|
| 186 |
- Runs dual-phase validation: Phase 1 evaluates attack payload containment (confirms exploit is blocked); Phase 2 evaluates benign functional input (ensures zero regression).
|
| 187 |
- Returns structured `CanaryVerificationReport` (`VERIFIED_SAFE`, `ATTACK_LEAKED`, `REGRESSION_DETECTED`, `SYNTAX_ERROR`, `SANDBOX_TIMEOUT`).
|
| 188 |
+
17. **`vulnforge_full_scan`**:
|
| 189 |
+
- Executes an end-to-end 360-degree security audit across Web, API, Database, GraphQL, CI/CD, Container/Kubernetes, eBPF, Dynamic API Fuzzing, Cloud IAM, Cryptographic Vaults, Supply Chain SBOM, Cosign Signature Attestation, WebAssembly eBPF Telemetry, and Distributed eBPF Microsegmentation layers simultaneously with automated patch synthesis and canary verification.
|
| 190 |
|
| 191 |
### 📋 Sample Vulnerability Findings & CWE Classification
|
| 192 |
+
- `[CRITICAL] Permissive Ingress Wildcard Policy - Default Ingress Allow All (CWE-284 / Improper Access Control)`
|
| 193 |
+
- `[CRITICAL] Unrestricted Cloud Metadata API Access - Missing 169.254.169.254 Egress Block (CWE-200 / Exposure of Sensitive Information)`
|
| 194 |
+
- `[HIGH] Missing Default-Deny Isolation - Permissive Pod Ingress Traffic (CWE-276 / Incorrect Default Permissions)`
|
| 195 |
+
- `[HIGH] Unencrypted Pod-to-Pod Cross-Node Network Traffic (CWE-319 / Cleartext Transmission)`
|
| 196 |
+
- `[HIGH] Permissive Host Namespace Network Access in Workload Spec (CWE-269 / Improper Privilege Management)`
|
| 197 |
- `[CRITICAL] Unbounded WebAssembly Linear Memory Bounds / Missing Heap Limit (CWE-119 / Improper Memory Buffer Restriction)`
|
| 198 |
- `[CRITICAL] Overprivileged WASI Host Filesystem Preopens / Root Directory Exposure (CWE-284 / Improper Access Control)`
|
| 199 |
- `[CRITICAL] Unsigned Container Image / Missing Cryptographic Cosign Signature (CWE-347 / Improper Verification of Cryptographic Signature)`
|
|
|
|
| 215 |
- `[HIGH] Missing Explicit Workflow Permissions - Risk of Default Write Privileges (CWE-276 / Default Permissions)`
|
| 216 |
- `[HIGH] Script Injection via Context Expression in Run Step (CWE-78 / Command Injection)`
|
| 217 |
- `[HIGH] Hardcoded Secret / Plaintext Personal Access Token Detected (CWE-798 / Hard-coded Credentials)`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 218 |
- `[MEDIUM] Unpinned Third-Party Action Mutable Tag @v4 - Supply Chain Attack Risk (CWE-829 / Untrusted Control Sphere)`
|
| 219 |
- `[MEDIUM] Container Root Filesystem Writable / Missing readOnlyRootFilesystem (CWE-732 / Incorrect Permission Assignment)`
|
| 220 |
|
ROADMAP.md
CHANGED
|
@@ -23,12 +23,13 @@ This document tracks shipped capabilities and planned architectural milestones f
|
|
| 23 |
- [x] **Supply Chain SBOM Verification & Dependency Confusion Defense Gate** — Automated CycloneDX (v1.4/1.5 JSON/XML), SPDX (v2.2/2.3 JSON/Tag-Value), npm package.json, package-lock.json, and Cargo/Python manifest security auditing, dependency confusion prevention for internal scopes, typosquatting heuristic detection (Levenshtein distance), unpinned wildcard range defense, dangerous install lifecycle hook suppression (`ignore-scripts=true`), mutable Git branch resolution, NTIA minimum elements verification (EO 14028 compliance), automated defensive patch synthesis, and canary sandbox verification (`vulnforge_audit_sbom`).
|
| 24 |
- [x] **Artifact Cosign Signature Attestation & Rekor Transparency Log Verification Gate** — Static analysis and policy enforcement for Cosign signatures, Sigstore keyless bundles, Kyverno ClusterPolicies, Gatekeeper constraints, and container workload manifests. Evaluates 8 vulnerability vectors including unsigned container images, keyless SAN/issuer mismatch, missing Rekor Signed Entry Timestamp (SET) proofs, absent in-toto SLSA Build Level 3 provenance, expired certificates, deprecated digest algorithms (MD5/SHA-1), mutable tag references without immutable SHA-256 digest pins, and permissive admission bypasses (`validationFailureAction: audit`). Includes automated Kyverno policy generation, digest pin injection, MockCosignHarness canary sandbox verification, and the 15th core MCP tool (`vulnforge_audit_cosign`).
|
| 25 |
- [x] **Wasm eBPF Extension & Distributed Host Telemetry Correlator** — Static analysis and policy enforcement for WebAssembly Envoy filters, Wasm runtime manifests (Wasmtime, WasmEdge, Wasmer), eBPF-Wasm hybrid telemetry pipelines, binary module metadata, and distributed host JSON telemetry streams. Evaluates 8 vulnerability vectors: unbounded linear memory bounds (CWE-119), overprivileged WASI host root preopens (CWE-284), missing fuel limits and execution timeouts (CWE-400), unpinned remote module digest references (CWE-345), dropped telemetry and ring buffer losses (CWE-778), plaintext credential leaks in telemetry (CWE-209), permissive shared memory segment permissions (CWE-276), and unconfined host privileges on eBPF bridges (CWE-693). Includes multi-host causal attack chain correlation with credential redaction, automated defensive patch synthesis (memory bounds, WASI ephemeral restricts, fuel metering, digest pinning), MockWasmEbpfHarness canary sandbox verification, and the 16th core MCP tool (`vulnforge_audit_wasm_ebpf`).
|
|
|
|
| 26 |
|
| 27 |
---
|
| 28 |
|
| 29 |
## Planned Milestones
|
| 30 |
|
| 31 |
-
|
| 32 |
- [ ] **Automated Cryptographic Zero-Knowledge Attestation Gateway** — Decentralized identity and zero-knowledge proof (ZKP) API endpoint integrity verification.
|
| 33 |
- [ ] **AI Model Supply Chain & Safetensors Weight Integrity Attestation** — Cryptographic attestation of safetensors tensor headers, malicious pickle deserialization scanners, and model provenance verification.
|
| 34 |
- [ ] **Automated Attestation Transparency & In-Toto Supply Chain Attestation Framework** — In-toto supply chain metadata verification, cryptographic provenance attestations, and transparency log auditing.
|
|
|
|
| 23 |
- [x] **Supply Chain SBOM Verification & Dependency Confusion Defense Gate** — Automated CycloneDX (v1.4/1.5 JSON/XML), SPDX (v2.2/2.3 JSON/Tag-Value), npm package.json, package-lock.json, and Cargo/Python manifest security auditing, dependency confusion prevention for internal scopes, typosquatting heuristic detection (Levenshtein distance), unpinned wildcard range defense, dangerous install lifecycle hook suppression (`ignore-scripts=true`), mutable Git branch resolution, NTIA minimum elements verification (EO 14028 compliance), automated defensive patch synthesis, and canary sandbox verification (`vulnforge_audit_sbom`).
|
| 24 |
- [x] **Artifact Cosign Signature Attestation & Rekor Transparency Log Verification Gate** — Static analysis and policy enforcement for Cosign signatures, Sigstore keyless bundles, Kyverno ClusterPolicies, Gatekeeper constraints, and container workload manifests. Evaluates 8 vulnerability vectors including unsigned container images, keyless SAN/issuer mismatch, missing Rekor Signed Entry Timestamp (SET) proofs, absent in-toto SLSA Build Level 3 provenance, expired certificates, deprecated digest algorithms (MD5/SHA-1), mutable tag references without immutable SHA-256 digest pins, and permissive admission bypasses (`validationFailureAction: audit`). Includes automated Kyverno policy generation, digest pin injection, MockCosignHarness canary sandbox verification, and the 15th core MCP tool (`vulnforge_audit_cosign`).
|
| 25 |
- [x] **Wasm eBPF Extension & Distributed Host Telemetry Correlator** — Static analysis and policy enforcement for WebAssembly Envoy filters, Wasm runtime manifests (Wasmtime, WasmEdge, Wasmer), eBPF-Wasm hybrid telemetry pipelines, binary module metadata, and distributed host JSON telemetry streams. Evaluates 8 vulnerability vectors: unbounded linear memory bounds (CWE-119), overprivileged WASI host root preopens (CWE-284), missing fuel limits and execution timeouts (CWE-400), unpinned remote module digest references (CWE-345), dropped telemetry and ring buffer losses (CWE-778), plaintext credential leaks in telemetry (CWE-209), permissive shared memory segment permissions (CWE-276), and unconfined host privileges on eBPF bridges (CWE-693). Includes multi-host causal attack chain correlation with credential redaction, automated defensive patch synthesis (memory bounds, WASI ephemeral restricts, fuel metering, digest pinning), MockWasmEbpfHarness canary sandbox verification, and the 16th core MCP tool (`vulnforge_audit_wasm_ebpf`).
|
| 26 |
+
- [x] **Distributed eBPF Microsegmentation & Policy Synthesis Engine** — Static analysis and policy enforcement for CiliumNetworkPolicy, Kubernetes NetworkPolicy, Calico specifications, and eBPF kernel flow telemetry streams. Evaluates 8 vulnerability vectors: permissive ingress wildcards (CWE-284, CWE-923), unrestricted cloud metadata API access (`169.254.169.254` / CWE-200), missing default-deny isolation (CWE-276), unencrypted cross-node traffic (CWE-319), permissive host namespace access (CWE-269), unrestricted egress wildcards (CWE-668), unmonitored cross-namespace flows (CWE-778), and missing L7 protocol enforcement (CWE-284). Includes automated least-privilege policy synthesis from kernel flow telemetry, drop-in hardening patches (default-deny rules, metadata blocks, L7 HTTP filters, WireGuard annotations), MockMicrosegmentationHarness canary sandbox verification, and the 17th core MCP tool (`vulnforge_audit_microsegmentation`).
|
| 27 |
|
| 28 |
---
|
| 29 |
|
| 30 |
## Planned Milestones
|
| 31 |
|
| 32 |
+
|
| 33 |
- [ ] **Automated Cryptographic Zero-Knowledge Attestation Gateway** — Decentralized identity and zero-knowledge proof (ZKP) API endpoint integrity verification.
|
| 34 |
- [ ] **AI Model Supply Chain & Safetensors Weight Integrity Attestation** — Cryptographic attestation of safetensors tensor headers, malicious pickle deserialization scanners, and model provenance verification.
|
| 35 |
- [ ] **Automated Attestation Transparency & In-Toto Supply Chain Attestation Framework** — In-toto supply chain metadata verification, cryptographic provenance attestations, and transparency log auditing.
|
docs/assets/locales/ar/architecture.svg
CHANGED
|
|
|
|
docs/assets/locales/ar/banner.svg
CHANGED
|
|
|
|
docs/assets/locales/en/architecture.svg
CHANGED
|
|
|
|
docs/assets/locales/en/banner.svg
CHANGED
|
|
|
|
docs/assets/locales/es/architecture.svg
CHANGED
|
|
|
|
docs/assets/locales/es/banner.svg
CHANGED
|
|
|
|
docs/assets/locales/fr/architecture.svg
CHANGED
|
|
|
|
docs/assets/locales/fr/banner.svg
CHANGED
|
|
|
|
docs/assets/locales/hi/architecture.svg
CHANGED
|
|
|
|
docs/assets/locales/hi/banner.svg
CHANGED
|
|
|
|
docs/assets/locales/id/architecture.svg
CHANGED
|
|
|
|
docs/assets/locales/id/banner.svg
CHANGED
|
|
|
|
docs/assets/locales/ko/architecture.svg
CHANGED
|
|
|
|
docs/assets/locales/ko/banner.svg
CHANGED
|
|
|
|
docs/assets/locales/pt-BR/architecture.svg
CHANGED
|
|
|
|
docs/assets/locales/pt-BR/banner.svg
CHANGED
|
|
|
|
docs/assets/locales/ru/architecture.svg
CHANGED
|
|
|
|
docs/assets/locales/ru/banner.svg
CHANGED
|
|
|
|
docs/assets/locales/zh-CN/architecture.svg
CHANGED
|
|
|
|
docs/assets/locales/zh-CN/banner.svg
CHANGED
|
|
|
|
docs/locales/ar.md
CHANGED
|
@@ -11,7 +11,7 @@
|
|
| 11 |
|
| 12 |
# 🛡️ VulnForge MCP
|
| 13 |
|
| 14 |
-
**خادم MCP شامل مدعوم بالذكاء الاصطناعي لتدقيق ثغرات الويب وواجهات البرمجة وقواعد البيانات وخطوط CI/CD وحاويات K8s وسياسات eBPF وفحص التشويش وسلسلة التوريد SBOM وتوثيق توقيعات Cosign وبيانات Wasm مع حقن التحديثات تلقائيًا**
|
| 15 |
|
| 16 |
[](../../LICENSE)
|
| 17 |
[](https://modelcontextprotocol.io/)
|
|
@@ -66,6 +66,9 @@ npx vulnforge-mcp --audit-cosign --file k8s/kyverno-verify.yaml
|
|
| 66 |
|
| 67 |
# 11. Direct WebAssembly eBPF & Host Telemetry Audit CLI Execution
|
| 68 |
npx vulnforge-mcp --audit-wasm-ebpf --file wasm-config.yaml
|
|
|
|
|
|
|
|
|
|
| 69 |
```
|
| 70 |
|
| 71 |
### Adding to Claude Desktop / Antigravity (`claude_desktop_config.json`)
|
|
@@ -84,7 +87,7 @@ npx vulnforge-mcp --audit-wasm-ebpf --file wasm-config.yaml
|
|
| 84 |
|
| 85 |
---
|
| 86 |
|
| 87 |
-
## 🏛️ الأركان ال
|
| 88 |
|
| 89 |
<details open>
|
| 90 |
<summary><b>🏛️ View Architecture Pipeline Diagram (Click to toggle / 접기·펼치기)</b></summary>
|
|
@@ -110,18 +113,19 @@ npx vulnforge-mcp --audit-wasm-ebpf --file wasm-config.yaml
|
|
| 110 |
| **12** | **Supply Chain & SBOM Gate** | CycloneDX/SPDX SBOM and manifest auditing, internal scope dependency confusion (CWE-427), Levenshtein typosquatting heuristics (CWE-829), unpinned wildcards (CWE-1104), dangerous install script hooks (CWE-78), mutable Git branches, missing lockfile hashes (CWE-353), and NTIA EO 14028 minimum elements | Automated `.npmrc` scoped registry injection, canonical package replacement, semantic version pinning, `ignore-scripts=true` suppression, immutable Git commit SHA pinning, and NTIA metadata enrichment |
|
| 111 |
| **13** | **Cosign & Artifact Attestation** | OCI container image signature verification, Sigstore keyless Fulcio OIDC SAN validation, Rekor transparency log inclusion proofs, In-toto SLSA provenance level verification, and Kyverno/Gatekeeper admission policy auditing | Kyverno ClusterPolicy enforcement rules (`validationFailureAction: Enforce`), OPA Gatekeeper constraints, Rekor proof mandates, and immutable SHA-256 image digest pinning |
|
| 112 |
| **14** | **Wasm & eBPF Telemetry** | WebAssembly linear memory bounds (CWE-119), WASI host root preopen exposure (CWE-284), instruction fuel/CPU DoS (CWE-400), unpinned bytecode digests (CWE-345), dropped telemetry (CWE-778), and kernel credential leakage (CWE-209) | Memory page clamps (max: 256), scoped ephemeral preopens (`/sandbox`), instruction fuel budgeting (100k), digest pins, and PII scrubbing filters |
|
|
|
|
| 113 |
|
| 114 |
</details>
|
| 115 |
|
| 116 |
---
|
| 117 |
|
| 118 |
-
## 🛠️
|
| 119 |
|
| 120 |
<details open>
|
| 121 |
-
<summary><b>🛠️
|
| 122 |
<br>
|
| 123 |
|
| 124 |
-
VulnForge MCP exposes
|
| 125 |
|
| 126 |
1. **`vulnforge_audit_web`**:
|
| 127 |
- Analyzes HTTP response headers, cookie flags, and DOM client code.
|
|
@@ -169,16 +173,27 @@ VulnForge MCP exposes 16 specialized security audit tools to your AI agent:
|
|
| 169 |
- Detects unbounded linear memory growth, overprivileged WASI root preopens, missing execution fuel limits, unpinned Wasm module digests, dropped kernel telemetry without counters, plaintext credential leakage in argv, insecure shared memory state, and unconfined host root privileges.
|
| 170 |
- Correlates multi-host causal attack chains (dropper downloads, namespace unshare privesc, interactive reverse shells) and applies automated credential scrubbing.
|
| 171 |
- Parameters: `content` (string, optional raw config or manifest), `filePath` (string, optional path to file), `format` (optional string), `telemetryEvents` (optional array or JSON lines string), `strictCorrelation` (boolean, default true), `sanitizeTelemetry` (boolean, default true).
|
| 172 |
-
14. **`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 173 |
- Takes vulnerable code and automatically synthesizes a secure drop-in replacement with unified git diff and optional canary verification.
|
| 174 |
-
|
| 175 |
- Executes isolated Canary Sandbox verification on synthesized or custom defensive patches using native Node.js `vm`.
|
| 176 |
- Runs dual-phase validation: Phase 1 evaluates attack payload containment (confirms exploit is blocked); Phase 2 evaluates benign functional input (ensures zero regression).
|
| 177 |
- Returns structured `CanaryVerificationReport` (`VERIFIED_SAFE`, `ATTACK_LEAKED`, `REGRESSION_DETECTED`, `SYNTAX_ERROR`, `SANDBOX_TIMEOUT`).
|
| 178 |
-
|
| 179 |
-
- Executes an end-to-end 360-degree security audit across Web, API, Database, GraphQL, CI/CD, Container/Kubernetes, eBPF, Dynamic API Fuzzing, Cloud IAM, Cryptographic Vaults, Supply Chain SBOM, Cosign Signature Attestation,
|
| 180 |
|
| 181 |
### 📋 Sample Vulnerability Findings & CWE Classification
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 182 |
- `[CRITICAL] Unbounded WebAssembly Linear Memory Bounds / Missing Heap Limit (CWE-119 / Improper Memory Buffer Restriction)`
|
| 183 |
- `[CRITICAL] Overprivileged WASI Host Filesystem Preopens / Root Directory Exposure (CWE-284 / Improper Access Control)`
|
| 184 |
- `[CRITICAL] Unsigned Container Image / Missing Cryptographic Cosign Signature (CWE-347 / Improper Verification of Cryptographic Signature)`
|
|
@@ -200,21 +215,6 @@ VulnForge MCP exposes 16 specialized security audit tools to your AI agent:
|
|
| 200 |
- `[HIGH] Missing Explicit Workflow Permissions - Risk of Default Write Privileges (CWE-276 / Default Permissions)`
|
| 201 |
- `[HIGH] Script Injection via Context Expression in Run Step (CWE-78 / Command Injection)`
|
| 202 |
- `[HIGH] Hardcoded Secret / Plaintext Personal Access Token Detected (CWE-798 / Hard-coded Credentials)`
|
| 203 |
-
- `[CRITICAL] Untrusted PR Checkout via pull_request_target with Head SHA (CWE-250 / Privileged Execution)`
|
| 204 |
-
- `[CRITICAL] GraphQL Introspection Enabled in Production (CWE-200 / Information Exposure)`
|
| 205 |
-
- `[CRITICAL] Dependency Confusion Vulnerability - Missing Scoped Private Registry (CWE-427 / Uncontrolled Search Path Element)`
|
| 206 |
-
- `[HIGH] Keyless Attestation SAN Identity Mismatch / Untrusted OIDC Issuer (CWE-295 / Improper Certificate Validation)`
|
| 207 |
-
- `[HIGH] Missing Rekor Transparency Log Inclusion Proof - Rollback Vulnerability (CWE-353 / Missing Support for Integrity Check)`
|
| 208 |
-
- `[HIGH] Typosquatting Package Vector Detected: Possible Impersonation of Canonical Library (CWE-829 / Untrusted Control Sphere)`
|
| 209 |
-
- `[HIGH] Dangerous Install Lifecycle Script Hook - Remote Code Execution Risk (CWE-78 / Command Injection)`
|
| 210 |
-
- `[HIGH] Non-Compliant SBOM - Missing Mandatory NTIA Minimum Elements (Executive Order 14028 Non-Compliance)`
|
| 211 |
-
- `[MEDIUM] Mutable Container Image Tag Reference Lacking SHA-256 Digest Pin (CWE-1104 / Use of Unmaintained Third Party Component)`
|
| 212 |
-
- `[MEDIUM] Unpinned Dependency Wildcard Version Range in Production Manifest (CWE-1104 / Unmaintained Third Party Component)`
|
| 213 |
-
- `[HIGH] Missing runAsNonRoot & Container Running as Root User (CWE-276 / Incorrect Default Permissions)`
|
| 214 |
-
- `[HIGH] Kubernetes RBAC Wildcard Permissions Allocated (CWE-269 / Improper Privilege Management)`
|
| 215 |
-
- `[HIGH] Missing Explicit Workflow Permissions - Risk of Default Write Privileges (CWE-276 / Default Permissions)`
|
| 216 |
-
- `[HIGH] Script Injection via Context Expression in Run Step (CWE-78 / Command Injection)`
|
| 217 |
-
- `[HIGH] Hardcoded Secret / Plaintext Personal Access Token Detected (CWE-798 / Hard-coded Credentials)`
|
| 218 |
- `[MEDIUM] Unpinned Third-Party Action Mutable Tag @v4 - Supply Chain Attack Risk (CWE-829 / Untrusted Control Sphere)`
|
| 219 |
- `[MEDIUM] Container Root Filesystem Writable / Missing readOnlyRootFilesystem (CWE-732 / Incorrect Permission Assignment)`
|
| 220 |
|
|
|
|
| 11 |
|
| 12 |
# 🛡️ VulnForge MCP
|
| 13 |
|
| 14 |
+
**خادم MCP شامل مدعوم بالذكاء الاصطناعي لتدقيق ثغرات الويب وواجهات البرمجة وقواعد البيانات وخطوط CI/CD وحاويات K8s وسياسات eBPF وفحص التشويش وسلسلة التوريد SBOM وتوثيق توقيعات Cosign وبيانات Wasm والتقسيم الدقيق مع حقن التحديثات تلقائيًا**
|
| 15 |
|
| 16 |
[](../../LICENSE)
|
| 17 |
[](https://modelcontextprotocol.io/)
|
|
|
|
| 66 |
|
| 67 |
# 11. Direct WebAssembly eBPF & Host Telemetry Audit CLI Execution
|
| 68 |
npx vulnforge-mcp --audit-wasm-ebpf --file wasm-config.yaml
|
| 69 |
+
|
| 70 |
+
# 12. Direct eBPF Microsegmentation & Zero Trust Flow Policy Audit CLI Execution
|
| 71 |
+
npx vulnforge-mcp --audit-microsegmentation --file policies/cilium.yaml
|
| 72 |
```
|
| 73 |
|
| 74 |
### Adding to Claude Desktop / Antigravity (`claude_desktop_config.json`)
|
|
|
|
| 87 |
|
| 88 |
---
|
| 89 |
|
| 90 |
+
## 🏛️ الأركان الخمسة عشر لتدقيق الثغرات الأمنية
|
| 91 |
|
| 92 |
<details open>
|
| 93 |
<summary><b>🏛️ View Architecture Pipeline Diagram (Click to toggle / 접기·펼치기)</b></summary>
|
|
|
|
| 113 |
| **12** | **Supply Chain & SBOM Gate** | CycloneDX/SPDX SBOM and manifest auditing, internal scope dependency confusion (CWE-427), Levenshtein typosquatting heuristics (CWE-829), unpinned wildcards (CWE-1104), dangerous install script hooks (CWE-78), mutable Git branches, missing lockfile hashes (CWE-353), and NTIA EO 14028 minimum elements | Automated `.npmrc` scoped registry injection, canonical package replacement, semantic version pinning, `ignore-scripts=true` suppression, immutable Git commit SHA pinning, and NTIA metadata enrichment |
|
| 114 |
| **13** | **Cosign & Artifact Attestation** | OCI container image signature verification, Sigstore keyless Fulcio OIDC SAN validation, Rekor transparency log inclusion proofs, In-toto SLSA provenance level verification, and Kyverno/Gatekeeper admission policy auditing | Kyverno ClusterPolicy enforcement rules (`validationFailureAction: Enforce`), OPA Gatekeeper constraints, Rekor proof mandates, and immutable SHA-256 image digest pinning |
|
| 115 |
| **14** | **Wasm & eBPF Telemetry** | WebAssembly linear memory bounds (CWE-119), WASI host root preopen exposure (CWE-284), instruction fuel/CPU DoS (CWE-400), unpinned bytecode digests (CWE-345), dropped telemetry (CWE-778), and kernel credential leakage (CWE-209) | Memory page clamps (max: 256), scoped ephemeral preopens (`/sandbox`), instruction fuel budgeting (100k), digest pins, and PII scrubbing filters |
|
| 116 |
+
| **15** | **Microsegmentation & eBPF Flow** | CiliumNetworkPolicy, K8s NetworkPolicy, Calico & eBPF kernel flow telemetry (CWE-284, CWE-923, CWE-200, CWE-276, CWE-269, CWE-319, CWE-668, CWE-778) | Automated Zero Trust ingress isolation, L7 HTTP rules, metadata endpoint blocking, and Hubble flow telemetry policy synthesis |
|
| 117 |
|
| 118 |
</details>
|
| 119 |
|
| 120 |
---
|
| 121 |
|
| 122 |
+
## 🛠️ 17 أداة أمان رئيسية لبروتوكول MCP
|
| 123 |
|
| 124 |
<details open>
|
| 125 |
+
<summary><b>🛠️ 17 أداة أمان رئيسية لبروتوكول MCP (Click to toggle / 접기·펼치기)</b></summary>
|
| 126 |
<br>
|
| 127 |
|
| 128 |
+
VulnForge MCP exposes 17 specialized security audit tools to your AI agent:
|
| 129 |
|
| 130 |
1. **`vulnforge_audit_web`**:
|
| 131 |
- Analyzes HTTP response headers, cookie flags, and DOM client code.
|
|
|
|
| 173 |
- Detects unbounded linear memory growth, overprivileged WASI root preopens, missing execution fuel limits, unpinned Wasm module digests, dropped kernel telemetry without counters, plaintext credential leakage in argv, insecure shared memory state, and unconfined host root privileges.
|
| 174 |
- Correlates multi-host causal attack chains (dropper downloads, namespace unshare privesc, interactive reverse shells) and applies automated credential scrubbing.
|
| 175 |
- Parameters: `content` (string, optional raw config or manifest), `filePath` (string, optional path to file), `format` (optional string), `telemetryEvents` (optional array or JSON lines string), `strictCorrelation` (boolean, default true), `sanitizeTelemetry` (boolean, default true).
|
| 176 |
+
14. **`vulnforge_audit_microsegmentation`**:
|
| 177 |
+
- Deep inspection of CiliumNetworkPolicy, Kubernetes NetworkPolicy, Calico specifications, and eBPF kernel flow telemetry streams (Cilium Hubble / flow logs).
|
| 178 |
+
- Detects permissive ingress wildcards (CWE-284/CWE-923), unrestricted cloud metadata API access (`169.254.169.254` / CWE-200), missing default-deny isolation (CWE-276), unencrypted cross-node pod-to-pod traffic (CWE-319), permissive host namespace access (CWE-269), unrestricted egress wildcards (CWE-668), unmonitored cross-namespace flows (CWE-778), and missing L7 protocol enforcement (CWE-284).
|
| 179 |
+
- Automatically synthesizes least-privilege Cilium and Kubernetes NetworkPolicies directly from observed eBPF kernel flow telemetry events.
|
| 180 |
+
- Synthesizes automated drop-in hardening patches (default-deny rules, metadata CIDR blocks, L7 HTTP method/path filters, WireGuard annotations) with dual canary sandbox validation.
|
| 181 |
+
- Parameters: `content` (string, optional raw policy YAML text), `filePath` (string, optional path to file), `format` (optional string), `flowTelemetryStream` (optional array or JSON lines string), `strictIngress` (boolean, default true), `blockCloudMetadata` (boolean, default true).
|
| 182 |
+
15. **`vulnforge_inject_patch`**:
|
| 183 |
- Takes vulnerable code and automatically synthesizes a secure drop-in replacement with unified git diff and optional canary verification.
|
| 184 |
+
16. **`vulnforge_verify_patch`**:
|
| 185 |
- Executes isolated Canary Sandbox verification on synthesized or custom defensive patches using native Node.js `vm`.
|
| 186 |
- Runs dual-phase validation: Phase 1 evaluates attack payload containment (confirms exploit is blocked); Phase 2 evaluates benign functional input (ensures zero regression).
|
| 187 |
- Returns structured `CanaryVerificationReport` (`VERIFIED_SAFE`, `ATTACK_LEAKED`, `REGRESSION_DETECTED`, `SYNTAX_ERROR`, `SANDBOX_TIMEOUT`).
|
| 188 |
+
17. **`vulnforge_full_scan`**:
|
| 189 |
+
- Executes an end-to-end 360-degree security audit across Web, API, Database, GraphQL, CI/CD, Container/Kubernetes, eBPF, Dynamic API Fuzzing, Cloud IAM, Cryptographic Vaults, Supply Chain SBOM, Cosign Signature Attestation, WebAssembly eBPF Telemetry, and Distributed eBPF Microsegmentation layers simultaneously with automated patch synthesis and canary verification.
|
| 190 |
|
| 191 |
### 📋 Sample Vulnerability Findings & CWE Classification
|
| 192 |
+
- `[CRITICAL] Permissive Ingress Wildcard Policy - Default Ingress Allow All (CWE-284 / Improper Access Control)`
|
| 193 |
+
- `[CRITICAL] Unrestricted Cloud Metadata API Access - Missing 169.254.169.254 Egress Block (CWE-200 / Exposure of Sensitive Information)`
|
| 194 |
+
- `[HIGH] Missing Default-Deny Isolation - Permissive Pod Ingress Traffic (CWE-276 / Incorrect Default Permissions)`
|
| 195 |
+
- `[HIGH] Unencrypted Pod-to-Pod Cross-Node Network Traffic (CWE-319 / Cleartext Transmission)`
|
| 196 |
+
- `[HIGH] Permissive Host Namespace Network Access in Workload Spec (CWE-269 / Improper Privilege Management)`
|
| 197 |
- `[CRITICAL] Unbounded WebAssembly Linear Memory Bounds / Missing Heap Limit (CWE-119 / Improper Memory Buffer Restriction)`
|
| 198 |
- `[CRITICAL] Overprivileged WASI Host Filesystem Preopens / Root Directory Exposure (CWE-284 / Improper Access Control)`
|
| 199 |
- `[CRITICAL] Unsigned Container Image / Missing Cryptographic Cosign Signature (CWE-347 / Improper Verification of Cryptographic Signature)`
|
|
|
|
| 215 |
- `[HIGH] Missing Explicit Workflow Permissions - Risk of Default Write Privileges (CWE-276 / Default Permissions)`
|
| 216 |
- `[HIGH] Script Injection via Context Expression in Run Step (CWE-78 / Command Injection)`
|
| 217 |
- `[HIGH] Hardcoded Secret / Plaintext Personal Access Token Detected (CWE-798 / Hard-coded Credentials)`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 218 |
- `[MEDIUM] Unpinned Third-Party Action Mutable Tag @v4 - Supply Chain Attack Risk (CWE-829 / Untrusted Control Sphere)`
|
| 219 |
- `[MEDIUM] Container Root Filesystem Writable / Missing readOnlyRootFilesystem (CWE-732 / Incorrect Permission Assignment)`
|
| 220 |
|
docs/locales/es.md
CHANGED
|
@@ -11,7 +11,7 @@
|
|
| 11 |
|
| 12 |
# 🛡️ VulnForge MCP
|
| 13 |
|
| 14 |
-
**Servidor MCP universal nativo de IA para auditoría de vulnerabilidades web, API, bases de datos, CI/CD, contenedores/K8s, eBPF, fuzzing dinámico de API, SBOM de cadena de suministro, firmas Cosign
|
| 15 |
|
| 16 |
[](../../LICENSE)
|
| 17 |
[](https://modelcontextprotocol.io/)
|
|
@@ -66,6 +66,9 @@ npx vulnforge-mcp --audit-cosign --file k8s/kyverno-verify.yaml
|
|
| 66 |
|
| 67 |
# 11. Direct WebAssembly eBPF & Host Telemetry Audit CLI Execution
|
| 68 |
npx vulnforge-mcp --audit-wasm-ebpf --file wasm-config.yaml
|
|
|
|
|
|
|
|
|
|
| 69 |
```
|
| 70 |
|
| 71 |
### Adding to Claude Desktop / Antigravity (`claude_desktop_config.json`)
|
|
@@ -84,7 +87,7 @@ npx vulnforge-mcp --audit-wasm-ebpf --file wasm-config.yaml
|
|
| 84 |
|
| 85 |
---
|
| 86 |
|
| 87 |
-
## 🏛️ Los
|
| 88 |
|
| 89 |
<details open>
|
| 90 |
<summary><b>🏛️ View Architecture Pipeline Diagram (Click to toggle / 접기·펼치기)</b></summary>
|
|
@@ -110,18 +113,19 @@ npx vulnforge-mcp --audit-wasm-ebpf --file wasm-config.yaml
|
|
| 110 |
| **12** | **Supply Chain & SBOM Gate** | CycloneDX/SPDX SBOM and manifest auditing, internal scope dependency confusion (CWE-427), Levenshtein typosquatting heuristics (CWE-829), unpinned wildcards (CWE-1104), dangerous install script hooks (CWE-78), mutable Git branches, missing lockfile hashes (CWE-353), and NTIA EO 14028 minimum elements | Automated `.npmrc` scoped registry injection, canonical package replacement, semantic version pinning, `ignore-scripts=true` suppression, immutable Git commit SHA pinning, and NTIA metadata enrichment |
|
| 111 |
| **13** | **Cosign & Artifact Attestation** | OCI container image signature verification, Sigstore keyless Fulcio OIDC SAN validation, Rekor transparency log inclusion proofs, In-toto SLSA provenance level verification, and Kyverno/Gatekeeper admission policy auditing | Kyverno ClusterPolicy enforcement rules (`validationFailureAction: Enforce`), OPA Gatekeeper constraints, Rekor proof mandates, and immutable SHA-256 image digest pinning |
|
| 112 |
| **14** | **Wasm & eBPF Telemetry** | WebAssembly linear memory bounds (CWE-119), WASI host root preopen exposure (CWE-284), instruction fuel/CPU DoS (CWE-400), unpinned bytecode digests (CWE-345), dropped telemetry (CWE-778), and kernel credential leakage (CWE-209) | Memory page clamps (max: 256), scoped ephemeral preopens (`/sandbox`), instruction fuel budgeting (100k), digest pins, and PII scrubbing filters |
|
|
|
|
| 113 |
|
| 114 |
</details>
|
| 115 |
|
| 116 |
---
|
| 117 |
|
| 118 |
-
## 🛠️
|
| 119 |
|
| 120 |
<details open>
|
| 121 |
-
<summary><b>🛠️
|
| 122 |
<br>
|
| 123 |
|
| 124 |
-
VulnForge MCP exposes
|
| 125 |
|
| 126 |
1. **`vulnforge_audit_web`**:
|
| 127 |
- Analyzes HTTP response headers, cookie flags, and DOM client code.
|
|
@@ -169,16 +173,27 @@ VulnForge MCP exposes 16 specialized security audit tools to your AI agent:
|
|
| 169 |
- Detects unbounded linear memory growth, overprivileged WASI root preopens, missing execution fuel limits, unpinned Wasm module digests, dropped kernel telemetry without counters, plaintext credential leakage in argv, insecure shared memory state, and unconfined host root privileges.
|
| 170 |
- Correlates multi-host causal attack chains (dropper downloads, namespace unshare privesc, interactive reverse shells) and applies automated credential scrubbing.
|
| 171 |
- Parameters: `content` (string, optional raw config or manifest), `filePath` (string, optional path to file), `format` (optional string), `telemetryEvents` (optional array or JSON lines string), `strictCorrelation` (boolean, default true), `sanitizeTelemetry` (boolean, default true).
|
| 172 |
-
14. **`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 173 |
- Takes vulnerable code and automatically synthesizes a secure drop-in replacement with unified git diff and optional canary verification.
|
| 174 |
-
|
| 175 |
- Executes isolated Canary Sandbox verification on synthesized or custom defensive patches using native Node.js `vm`.
|
| 176 |
- Runs dual-phase validation: Phase 1 evaluates attack payload containment (confirms exploit is blocked); Phase 2 evaluates benign functional input (ensures zero regression).
|
| 177 |
- Returns structured `CanaryVerificationReport` (`VERIFIED_SAFE`, `ATTACK_LEAKED`, `REGRESSION_DETECTED`, `SYNTAX_ERROR`, `SANDBOX_TIMEOUT`).
|
| 178 |
-
|
| 179 |
-
- Executes an end-to-end 360-degree security audit across Web, API, Database, GraphQL, CI/CD, Container/Kubernetes, eBPF, Dynamic API Fuzzing, Cloud IAM, Cryptographic Vaults, Supply Chain SBOM, Cosign Signature Attestation,
|
| 180 |
|
| 181 |
### 📋 Sample Vulnerability Findings & CWE Classification
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 182 |
- `[CRITICAL] Unbounded WebAssembly Linear Memory Bounds / Missing Heap Limit (CWE-119 / Improper Memory Buffer Restriction)`
|
| 183 |
- `[CRITICAL] Overprivileged WASI Host Filesystem Preopens / Root Directory Exposure (CWE-284 / Improper Access Control)`
|
| 184 |
- `[CRITICAL] Unsigned Container Image / Missing Cryptographic Cosign Signature (CWE-347 / Improper Verification of Cryptographic Signature)`
|
|
@@ -200,21 +215,6 @@ VulnForge MCP exposes 16 specialized security audit tools to your AI agent:
|
|
| 200 |
- `[HIGH] Missing Explicit Workflow Permissions - Risk of Default Write Privileges (CWE-276 / Default Permissions)`
|
| 201 |
- `[HIGH] Script Injection via Context Expression in Run Step (CWE-78 / Command Injection)`
|
| 202 |
- `[HIGH] Hardcoded Secret / Plaintext Personal Access Token Detected (CWE-798 / Hard-coded Credentials)`
|
| 203 |
-
- `[CRITICAL] Untrusted PR Checkout via pull_request_target with Head SHA (CWE-250 / Privileged Execution)`
|
| 204 |
-
- `[CRITICAL] GraphQL Introspection Enabled in Production (CWE-200 / Information Exposure)`
|
| 205 |
-
- `[CRITICAL] Dependency Confusion Vulnerability - Missing Scoped Private Registry (CWE-427 / Uncontrolled Search Path Element)`
|
| 206 |
-
- `[HIGH] Keyless Attestation SAN Identity Mismatch / Untrusted OIDC Issuer (CWE-295 / Improper Certificate Validation)`
|
| 207 |
-
- `[HIGH] Missing Rekor Transparency Log Inclusion Proof - Rollback Vulnerability (CWE-353 / Missing Support for Integrity Check)`
|
| 208 |
-
- `[HIGH] Typosquatting Package Vector Detected: Possible Impersonation of Canonical Library (CWE-829 / Untrusted Control Sphere)`
|
| 209 |
-
- `[HIGH] Dangerous Install Lifecycle Script Hook - Remote Code Execution Risk (CWE-78 / Command Injection)`
|
| 210 |
-
- `[HIGH] Non-Compliant SBOM - Missing Mandatory NTIA Minimum Elements (Executive Order 14028 Non-Compliance)`
|
| 211 |
-
- `[MEDIUM] Mutable Container Image Tag Reference Lacking SHA-256 Digest Pin (CWE-1104 / Use of Unmaintained Third Party Component)`
|
| 212 |
-
- `[MEDIUM] Unpinned Dependency Wildcard Version Range in Production Manifest (CWE-1104 / Unmaintained Third Party Component)`
|
| 213 |
-
- `[HIGH] Missing runAsNonRoot & Container Running as Root User (CWE-276 / Incorrect Default Permissions)`
|
| 214 |
-
- `[HIGH] Kubernetes RBAC Wildcard Permissions Allocated (CWE-269 / Improper Privilege Management)`
|
| 215 |
-
- `[HIGH] Missing Explicit Workflow Permissions - Risk of Default Write Privileges (CWE-276 / Default Permissions)`
|
| 216 |
-
- `[HIGH] Script Injection via Context Expression in Run Step (CWE-78 / Command Injection)`
|
| 217 |
-
- `[HIGH] Hardcoded Secret / Plaintext Personal Access Token Detected (CWE-798 / Hard-coded Credentials)`
|
| 218 |
- `[MEDIUM] Unpinned Third-Party Action Mutable Tag @v4 - Supply Chain Attack Risk (CWE-829 / Untrusted Control Sphere)`
|
| 219 |
- `[MEDIUM] Container Root Filesystem Writable / Missing readOnlyRootFilesystem (CWE-732 / Incorrect Permission Assignment)`
|
| 220 |
|
|
|
|
| 11 |
|
| 12 |
# 🛡️ VulnForge MCP
|
| 13 |
|
| 14 |
+
**Servidor MCP universal nativo de IA para auditoría de vulnerabilidades web, API, bases de datos, CI/CD, contenedores/K8s, eBPF, fuzzing dinámico de API, SBOM de cadena de suministro, firmas Cosign, telemetría Wasm y microsegmentación con inyección automática de parches**
|
| 15 |
|
| 16 |
[](../../LICENSE)
|
| 17 |
[](https://modelcontextprotocol.io/)
|
|
|
|
| 66 |
|
| 67 |
# 11. Direct WebAssembly eBPF & Host Telemetry Audit CLI Execution
|
| 68 |
npx vulnforge-mcp --audit-wasm-ebpf --file wasm-config.yaml
|
| 69 |
+
|
| 70 |
+
# 12. Direct eBPF Microsegmentation & Zero Trust Flow Policy Audit CLI Execution
|
| 71 |
+
npx vulnforge-mcp --audit-microsegmentation --file policies/cilium.yaml
|
| 72 |
```
|
| 73 |
|
| 74 |
### Adding to Claude Desktop / Antigravity (`claude_desktop_config.json`)
|
|
|
|
| 87 |
|
| 88 |
---
|
| 89 |
|
| 90 |
+
## 🏛️ Los 15 pilares de auditoría de vulnerabilidades
|
| 91 |
|
| 92 |
<details open>
|
| 93 |
<summary><b>🏛️ View Architecture Pipeline Diagram (Click to toggle / 접기·펼치기)</b></summary>
|
|
|
|
| 113 |
| **12** | **Supply Chain & SBOM Gate** | CycloneDX/SPDX SBOM and manifest auditing, internal scope dependency confusion (CWE-427), Levenshtein typosquatting heuristics (CWE-829), unpinned wildcards (CWE-1104), dangerous install script hooks (CWE-78), mutable Git branches, missing lockfile hashes (CWE-353), and NTIA EO 14028 minimum elements | Automated `.npmrc` scoped registry injection, canonical package replacement, semantic version pinning, `ignore-scripts=true` suppression, immutable Git commit SHA pinning, and NTIA metadata enrichment |
|
| 114 |
| **13** | **Cosign & Artifact Attestation** | OCI container image signature verification, Sigstore keyless Fulcio OIDC SAN validation, Rekor transparency log inclusion proofs, In-toto SLSA provenance level verification, and Kyverno/Gatekeeper admission policy auditing | Kyverno ClusterPolicy enforcement rules (`validationFailureAction: Enforce`), OPA Gatekeeper constraints, Rekor proof mandates, and immutable SHA-256 image digest pinning |
|
| 115 |
| **14** | **Wasm & eBPF Telemetry** | WebAssembly linear memory bounds (CWE-119), WASI host root preopen exposure (CWE-284), instruction fuel/CPU DoS (CWE-400), unpinned bytecode digests (CWE-345), dropped telemetry (CWE-778), and kernel credential leakage (CWE-209) | Memory page clamps (max: 256), scoped ephemeral preopens (`/sandbox`), instruction fuel budgeting (100k), digest pins, and PII scrubbing filters |
|
| 116 |
+
| **15** | **Microsegmentation & eBPF Flow** | CiliumNetworkPolicy, K8s NetworkPolicy, Calico & eBPF kernel flow telemetry (CWE-284, CWE-923, CWE-200, CWE-276, CWE-269, CWE-319, CWE-668, CWE-778) | Automated Zero Trust ingress isolation, L7 HTTP rules, metadata endpoint blocking, and Hubble flow telemetry policy synthesis |
|
| 117 |
|
| 118 |
</details>
|
| 119 |
|
| 120 |
---
|
| 121 |
|
| 122 |
+
## 🛠️ 17 herramientas de seguridad MCP principales
|
| 123 |
|
| 124 |
<details open>
|
| 125 |
+
<summary><b>🛠️ 17 herramientas de seguridad MCP principales (Click to toggle / 접기·펼치기)</b></summary>
|
| 126 |
<br>
|
| 127 |
|
| 128 |
+
VulnForge MCP exposes 17 specialized security audit tools to your AI agent:
|
| 129 |
|
| 130 |
1. **`vulnforge_audit_web`**:
|
| 131 |
- Analyzes HTTP response headers, cookie flags, and DOM client code.
|
|
|
|
| 173 |
- Detects unbounded linear memory growth, overprivileged WASI root preopens, missing execution fuel limits, unpinned Wasm module digests, dropped kernel telemetry without counters, plaintext credential leakage in argv, insecure shared memory state, and unconfined host root privileges.
|
| 174 |
- Correlates multi-host causal attack chains (dropper downloads, namespace unshare privesc, interactive reverse shells) and applies automated credential scrubbing.
|
| 175 |
- Parameters: `content` (string, optional raw config or manifest), `filePath` (string, optional path to file), `format` (optional string), `telemetryEvents` (optional array or JSON lines string), `strictCorrelation` (boolean, default true), `sanitizeTelemetry` (boolean, default true).
|
| 176 |
+
14. **`vulnforge_audit_microsegmentation`**:
|
| 177 |
+
- Deep inspection of CiliumNetworkPolicy, Kubernetes NetworkPolicy, Calico specifications, and eBPF kernel flow telemetry streams (Cilium Hubble / flow logs).
|
| 178 |
+
- Detects permissive ingress wildcards (CWE-284/CWE-923), unrestricted cloud metadata API access (`169.254.169.254` / CWE-200), missing default-deny isolation (CWE-276), unencrypted cross-node pod-to-pod traffic (CWE-319), permissive host namespace access (CWE-269), unrestricted egress wildcards (CWE-668), unmonitored cross-namespace flows (CWE-778), and missing L7 protocol enforcement (CWE-284).
|
| 179 |
+
- Automatically synthesizes least-privilege Cilium and Kubernetes NetworkPolicies directly from observed eBPF kernel flow telemetry events.
|
| 180 |
+
- Synthesizes automated drop-in hardening patches (default-deny rules, metadata CIDR blocks, L7 HTTP method/path filters, WireGuard annotations) with dual canary sandbox validation.
|
| 181 |
+
- Parameters: `content` (string, optional raw policy YAML text), `filePath` (string, optional path to file), `format` (optional string), `flowTelemetryStream` (optional array or JSON lines string), `strictIngress` (boolean, default true), `blockCloudMetadata` (boolean, default true).
|
| 182 |
+
15. **`vulnforge_inject_patch`**:
|
| 183 |
- Takes vulnerable code and automatically synthesizes a secure drop-in replacement with unified git diff and optional canary verification.
|
| 184 |
+
16. **`vulnforge_verify_patch`**:
|
| 185 |
- Executes isolated Canary Sandbox verification on synthesized or custom defensive patches using native Node.js `vm`.
|
| 186 |
- Runs dual-phase validation: Phase 1 evaluates attack payload containment (confirms exploit is blocked); Phase 2 evaluates benign functional input (ensures zero regression).
|
| 187 |
- Returns structured `CanaryVerificationReport` (`VERIFIED_SAFE`, `ATTACK_LEAKED`, `REGRESSION_DETECTED`, `SYNTAX_ERROR`, `SANDBOX_TIMEOUT`).
|
| 188 |
+
17. **`vulnforge_full_scan`**:
|
| 189 |
+
- Executes an end-to-end 360-degree security audit across Web, API, Database, GraphQL, CI/CD, Container/Kubernetes, eBPF, Dynamic API Fuzzing, Cloud IAM, Cryptographic Vaults, Supply Chain SBOM, Cosign Signature Attestation, WebAssembly eBPF Telemetry, and Distributed eBPF Microsegmentation layers simultaneously with automated patch synthesis and canary verification.
|
| 190 |
|
| 191 |
### 📋 Sample Vulnerability Findings & CWE Classification
|
| 192 |
+
- `[CRITICAL] Permissive Ingress Wildcard Policy - Default Ingress Allow All (CWE-284 / Improper Access Control)`
|
| 193 |
+
- `[CRITICAL] Unrestricted Cloud Metadata API Access - Missing 169.254.169.254 Egress Block (CWE-200 / Exposure of Sensitive Information)`
|
| 194 |
+
- `[HIGH] Missing Default-Deny Isolation - Permissive Pod Ingress Traffic (CWE-276 / Incorrect Default Permissions)`
|
| 195 |
+
- `[HIGH] Unencrypted Pod-to-Pod Cross-Node Network Traffic (CWE-319 / Cleartext Transmission)`
|
| 196 |
+
- `[HIGH] Permissive Host Namespace Network Access in Workload Spec (CWE-269 / Improper Privilege Management)`
|
| 197 |
- `[CRITICAL] Unbounded WebAssembly Linear Memory Bounds / Missing Heap Limit (CWE-119 / Improper Memory Buffer Restriction)`
|
| 198 |
- `[CRITICAL] Overprivileged WASI Host Filesystem Preopens / Root Directory Exposure (CWE-284 / Improper Access Control)`
|
| 199 |
- `[CRITICAL] Unsigned Container Image / Missing Cryptographic Cosign Signature (CWE-347 / Improper Verification of Cryptographic Signature)`
|
|
|
|
| 215 |
- `[HIGH] Missing Explicit Workflow Permissions - Risk of Default Write Privileges (CWE-276 / Default Permissions)`
|
| 216 |
- `[HIGH] Script Injection via Context Expression in Run Step (CWE-78 / Command Injection)`
|
| 217 |
- `[HIGH] Hardcoded Secret / Plaintext Personal Access Token Detected (CWE-798 / Hard-coded Credentials)`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 218 |
- `[MEDIUM] Unpinned Third-Party Action Mutable Tag @v4 - Supply Chain Attack Risk (CWE-829 / Untrusted Control Sphere)`
|
| 219 |
- `[MEDIUM] Container Root Filesystem Writable / Missing readOnlyRootFilesystem (CWE-732 / Incorrect Permission Assignment)`
|
| 220 |
|
docs/locales/fr.md
CHANGED
|
@@ -11,7 +11,7 @@
|
|
| 11 |
|
| 12 |
# 🛡️ VulnForge MCP
|
| 13 |
|
| 14 |
-
**Serveur MCP natif IA pour l’audit des vulnérabilités Web, API, bases de données, CI/CD, conteneurs/K8s, eBPF, fuzzing dynamique d’API, SBOM de chaîne d’approvisionnement, attestation de signatures Cosign
|
| 15 |
|
| 16 |
[](../../LICENSE)
|
| 17 |
[](https://modelcontextprotocol.io/)
|
|
@@ -66,6 +66,9 @@ npx vulnforge-mcp --audit-cosign --file k8s/kyverno-verify.yaml
|
|
| 66 |
|
| 67 |
# 11. Direct WebAssembly eBPF & Host Telemetry Audit CLI Execution
|
| 68 |
npx vulnforge-mcp --audit-wasm-ebpf --file wasm-config.yaml
|
|
|
|
|
|
|
|
|
|
| 69 |
```
|
| 70 |
|
| 71 |
### Adding to Claude Desktop / Antigravity (`claude_desktop_config.json`)
|
|
@@ -84,7 +87,7 @@ npx vulnforge-mcp --audit-wasm-ebpf --file wasm-config.yaml
|
|
| 84 |
|
| 85 |
---
|
| 86 |
|
| 87 |
-
## 🏛️ Les
|
| 88 |
|
| 89 |
<details open>
|
| 90 |
<summary><b>🏛️ View Architecture Pipeline Diagram (Click to toggle / 접기·펼치기)</b></summary>
|
|
@@ -110,18 +113,19 @@ npx vulnforge-mcp --audit-wasm-ebpf --file wasm-config.yaml
|
|
| 110 |
| **12** | **Supply Chain & SBOM Gate** | CycloneDX/SPDX SBOM and manifest auditing, internal scope dependency confusion (CWE-427), Levenshtein typosquatting heuristics (CWE-829), unpinned wildcards (CWE-1104), dangerous install script hooks (CWE-78), mutable Git branches, missing lockfile hashes (CWE-353), and NTIA EO 14028 minimum elements | Automated `.npmrc` scoped registry injection, canonical package replacement, semantic version pinning, `ignore-scripts=true` suppression, immutable Git commit SHA pinning, and NTIA metadata enrichment |
|
| 111 |
| **13** | **Cosign & Artifact Attestation** | OCI container image signature verification, Sigstore keyless Fulcio OIDC SAN validation, Rekor transparency log inclusion proofs, In-toto SLSA provenance level verification, and Kyverno/Gatekeeper admission policy auditing | Kyverno ClusterPolicy enforcement rules (`validationFailureAction: Enforce`), OPA Gatekeeper constraints, Rekor proof mandates, and immutable SHA-256 image digest pinning |
|
| 112 |
| **14** | **Wasm & eBPF Telemetry** | WebAssembly linear memory bounds (CWE-119), WASI host root preopen exposure (CWE-284), instruction fuel/CPU DoS (CWE-400), unpinned bytecode digests (CWE-345), dropped telemetry (CWE-778), and kernel credential leakage (CWE-209) | Memory page clamps (max: 256), scoped ephemeral preopens (`/sandbox`), instruction fuel budgeting (100k), digest pins, and PII scrubbing filters |
|
|
|
|
| 113 |
|
| 114 |
</details>
|
| 115 |
|
| 116 |
---
|
| 117 |
|
| 118 |
-
## 🛠️
|
| 119 |
|
| 120 |
<details open>
|
| 121 |
-
<summary><b>🛠️
|
| 122 |
<br>
|
| 123 |
|
| 124 |
-
VulnForge MCP exposes
|
| 125 |
|
| 126 |
1. **`vulnforge_audit_web`**:
|
| 127 |
- Analyzes HTTP response headers, cookie flags, and DOM client code.
|
|
@@ -169,16 +173,27 @@ VulnForge MCP exposes 16 specialized security audit tools to your AI agent:
|
|
| 169 |
- Detects unbounded linear memory growth, overprivileged WASI root preopens, missing execution fuel limits, unpinned Wasm module digests, dropped kernel telemetry without counters, plaintext credential leakage in argv, insecure shared memory state, and unconfined host root privileges.
|
| 170 |
- Correlates multi-host causal attack chains (dropper downloads, namespace unshare privesc, interactive reverse shells) and applies automated credential scrubbing.
|
| 171 |
- Parameters: `content` (string, optional raw config or manifest), `filePath` (string, optional path to file), `format` (optional string), `telemetryEvents` (optional array or JSON lines string), `strictCorrelation` (boolean, default true), `sanitizeTelemetry` (boolean, default true).
|
| 172 |
-
14. **`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 173 |
- Takes vulnerable code and automatically synthesizes a secure drop-in replacement with unified git diff and optional canary verification.
|
| 174 |
-
|
| 175 |
- Executes isolated Canary Sandbox verification on synthesized or custom defensive patches using native Node.js `vm`.
|
| 176 |
- Runs dual-phase validation: Phase 1 evaluates attack payload containment (confirms exploit is blocked); Phase 2 evaluates benign functional input (ensures zero regression).
|
| 177 |
- Returns structured `CanaryVerificationReport` (`VERIFIED_SAFE`, `ATTACK_LEAKED`, `REGRESSION_DETECTED`, `SYNTAX_ERROR`, `SANDBOX_TIMEOUT`).
|
| 178 |
-
|
| 179 |
-
- Executes an end-to-end 360-degree security audit across Web, API, Database, GraphQL, CI/CD, Container/Kubernetes, eBPF, Dynamic API Fuzzing, Cloud IAM, Cryptographic Vaults, Supply Chain SBOM, Cosign Signature Attestation,
|
| 180 |
|
| 181 |
### 📋 Sample Vulnerability Findings & CWE Classification
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 182 |
- `[CRITICAL] Unbounded WebAssembly Linear Memory Bounds / Missing Heap Limit (CWE-119 / Improper Memory Buffer Restriction)`
|
| 183 |
- `[CRITICAL] Overprivileged WASI Host Filesystem Preopens / Root Directory Exposure (CWE-284 / Improper Access Control)`
|
| 184 |
- `[CRITICAL] Unsigned Container Image / Missing Cryptographic Cosign Signature (CWE-347 / Improper Verification of Cryptographic Signature)`
|
|
@@ -200,21 +215,6 @@ VulnForge MCP exposes 16 specialized security audit tools to your AI agent:
|
|
| 200 |
- `[HIGH] Missing Explicit Workflow Permissions - Risk of Default Write Privileges (CWE-276 / Default Permissions)`
|
| 201 |
- `[HIGH] Script Injection via Context Expression in Run Step (CWE-78 / Command Injection)`
|
| 202 |
- `[HIGH] Hardcoded Secret / Plaintext Personal Access Token Detected (CWE-798 / Hard-coded Credentials)`
|
| 203 |
-
- `[CRITICAL] Untrusted PR Checkout via pull_request_target with Head SHA (CWE-250 / Privileged Execution)`
|
| 204 |
-
- `[CRITICAL] GraphQL Introspection Enabled in Production (CWE-200 / Information Exposure)`
|
| 205 |
-
- `[CRITICAL] Dependency Confusion Vulnerability - Missing Scoped Private Registry (CWE-427 / Uncontrolled Search Path Element)`
|
| 206 |
-
- `[HIGH] Keyless Attestation SAN Identity Mismatch / Untrusted OIDC Issuer (CWE-295 / Improper Certificate Validation)`
|
| 207 |
-
- `[HIGH] Missing Rekor Transparency Log Inclusion Proof - Rollback Vulnerability (CWE-353 / Missing Support for Integrity Check)`
|
| 208 |
-
- `[HIGH] Typosquatting Package Vector Detected: Possible Impersonation of Canonical Library (CWE-829 / Untrusted Control Sphere)`
|
| 209 |
-
- `[HIGH] Dangerous Install Lifecycle Script Hook - Remote Code Execution Risk (CWE-78 / Command Injection)`
|
| 210 |
-
- `[HIGH] Non-Compliant SBOM - Missing Mandatory NTIA Minimum Elements (Executive Order 14028 Non-Compliance)`
|
| 211 |
-
- `[MEDIUM] Mutable Container Image Tag Reference Lacking SHA-256 Digest Pin (CWE-1104 / Use of Unmaintained Third Party Component)`
|
| 212 |
-
- `[MEDIUM] Unpinned Dependency Wildcard Version Range in Production Manifest (CWE-1104 / Unmaintained Third Party Component)`
|
| 213 |
-
- `[HIGH] Missing runAsNonRoot & Container Running as Root User (CWE-276 / Incorrect Default Permissions)`
|
| 214 |
-
- `[HIGH] Kubernetes RBAC Wildcard Permissions Allocated (CWE-269 / Improper Privilege Management)`
|
| 215 |
-
- `[HIGH] Missing Explicit Workflow Permissions - Risk of Default Write Privileges (CWE-276 / Default Permissions)`
|
| 216 |
-
- `[HIGH] Script Injection via Context Expression in Run Step (CWE-78 / Command Injection)`
|
| 217 |
-
- `[HIGH] Hardcoded Secret / Plaintext Personal Access Token Detected (CWE-798 / Hard-coded Credentials)`
|
| 218 |
- `[MEDIUM] Unpinned Third-Party Action Mutable Tag @v4 - Supply Chain Attack Risk (CWE-829 / Untrusted Control Sphere)`
|
| 219 |
- `[MEDIUM] Container Root Filesystem Writable / Missing readOnlyRootFilesystem (CWE-732 / Incorrect Permission Assignment)`
|
| 220 |
|
|
|
|
| 11 |
|
| 12 |
# 🛡️ VulnForge MCP
|
| 13 |
|
| 14 |
+
**Serveur MCP natif IA pour l’audit des vulnérabilités Web, API, bases de données, CI/CD, conteneurs/K8s, eBPF, fuzzing dynamique d’API, SBOM de chaîne d’approvisionnement, attestation de signatures Cosign, télémétrie Wasm et microsegmentation avec injection automatique de correctifs**
|
| 15 |
|
| 16 |
[](../../LICENSE)
|
| 17 |
[](https://modelcontextprotocol.io/)
|
|
|
|
| 66 |
|
| 67 |
# 11. Direct WebAssembly eBPF & Host Telemetry Audit CLI Execution
|
| 68 |
npx vulnforge-mcp --audit-wasm-ebpf --file wasm-config.yaml
|
| 69 |
+
|
| 70 |
+
# 12. Direct eBPF Microsegmentation & Zero Trust Flow Policy Audit CLI Execution
|
| 71 |
+
npx vulnforge-mcp --audit-microsegmentation --file policies/cilium.yaml
|
| 72 |
```
|
| 73 |
|
| 74 |
### Adding to Claude Desktop / Antigravity (`claude_desktop_config.json`)
|
|
|
|
| 87 |
|
| 88 |
---
|
| 89 |
|
| 90 |
+
## 🏛️ Les 15 piliers d’audit de vulnérabilité
|
| 91 |
|
| 92 |
<details open>
|
| 93 |
<summary><b>🏛️ View Architecture Pipeline Diagram (Click to toggle / 접기·펼치기)</b></summary>
|
|
|
|
| 113 |
| **12** | **Supply Chain & SBOM Gate** | CycloneDX/SPDX SBOM and manifest auditing, internal scope dependency confusion (CWE-427), Levenshtein typosquatting heuristics (CWE-829), unpinned wildcards (CWE-1104), dangerous install script hooks (CWE-78), mutable Git branches, missing lockfile hashes (CWE-353), and NTIA EO 14028 minimum elements | Automated `.npmrc` scoped registry injection, canonical package replacement, semantic version pinning, `ignore-scripts=true` suppression, immutable Git commit SHA pinning, and NTIA metadata enrichment |
|
| 114 |
| **13** | **Cosign & Artifact Attestation** | OCI container image signature verification, Sigstore keyless Fulcio OIDC SAN validation, Rekor transparency log inclusion proofs, In-toto SLSA provenance level verification, and Kyverno/Gatekeeper admission policy auditing | Kyverno ClusterPolicy enforcement rules (`validationFailureAction: Enforce`), OPA Gatekeeper constraints, Rekor proof mandates, and immutable SHA-256 image digest pinning |
|
| 115 |
| **14** | **Wasm & eBPF Telemetry** | WebAssembly linear memory bounds (CWE-119), WASI host root preopen exposure (CWE-284), instruction fuel/CPU DoS (CWE-400), unpinned bytecode digests (CWE-345), dropped telemetry (CWE-778), and kernel credential leakage (CWE-209) | Memory page clamps (max: 256), scoped ephemeral preopens (`/sandbox`), instruction fuel budgeting (100k), digest pins, and PII scrubbing filters |
|
| 116 |
+
| **15** | **Microsegmentation & eBPF Flow** | CiliumNetworkPolicy, K8s NetworkPolicy, Calico & eBPF kernel flow telemetry (CWE-284, CWE-923, CWE-200, CWE-276, CWE-269, CWE-319, CWE-668, CWE-778) | Automated Zero Trust ingress isolation, L7 HTTP rules, metadata endpoint blocking, and Hubble flow telemetry policy synthesis |
|
| 117 |
|
| 118 |
</details>
|
| 119 |
|
| 120 |
---
|
| 121 |
|
| 122 |
+
## 🛠️ 17 outils de sécurité MCP essentiels
|
| 123 |
|
| 124 |
<details open>
|
| 125 |
+
<summary><b>🛠️ 17 outils de sécurité MCP essentiels (Click to toggle / 접기·펼치기)</b></summary>
|
| 126 |
<br>
|
| 127 |
|
| 128 |
+
VulnForge MCP exposes 17 specialized security audit tools to your AI agent:
|
| 129 |
|
| 130 |
1. **`vulnforge_audit_web`**:
|
| 131 |
- Analyzes HTTP response headers, cookie flags, and DOM client code.
|
|
|
|
| 173 |
- Detects unbounded linear memory growth, overprivileged WASI root preopens, missing execution fuel limits, unpinned Wasm module digests, dropped kernel telemetry without counters, plaintext credential leakage in argv, insecure shared memory state, and unconfined host root privileges.
|
| 174 |
- Correlates multi-host causal attack chains (dropper downloads, namespace unshare privesc, interactive reverse shells) and applies automated credential scrubbing.
|
| 175 |
- Parameters: `content` (string, optional raw config or manifest), `filePath` (string, optional path to file), `format` (optional string), `telemetryEvents` (optional array or JSON lines string), `strictCorrelation` (boolean, default true), `sanitizeTelemetry` (boolean, default true).
|
| 176 |
+
14. **`vulnforge_audit_microsegmentation`**:
|
| 177 |
+
- Deep inspection of CiliumNetworkPolicy, Kubernetes NetworkPolicy, Calico specifications, and eBPF kernel flow telemetry streams (Cilium Hubble / flow logs).
|
| 178 |
+
- Detects permissive ingress wildcards (CWE-284/CWE-923), unrestricted cloud metadata API access (`169.254.169.254` / CWE-200), missing default-deny isolation (CWE-276), unencrypted cross-node pod-to-pod traffic (CWE-319), permissive host namespace access (CWE-269), unrestricted egress wildcards (CWE-668), unmonitored cross-namespace flows (CWE-778), and missing L7 protocol enforcement (CWE-284).
|
| 179 |
+
- Automatically synthesizes least-privilege Cilium and Kubernetes NetworkPolicies directly from observed eBPF kernel flow telemetry events.
|
| 180 |
+
- Synthesizes automated drop-in hardening patches (default-deny rules, metadata CIDR blocks, L7 HTTP method/path filters, WireGuard annotations) with dual canary sandbox validation.
|
| 181 |
+
- Parameters: `content` (string, optional raw policy YAML text), `filePath` (string, optional path to file), `format` (optional string), `flowTelemetryStream` (optional array or JSON lines string), `strictIngress` (boolean, default true), `blockCloudMetadata` (boolean, default true).
|
| 182 |
+
15. **`vulnforge_inject_patch`**:
|
| 183 |
- Takes vulnerable code and automatically synthesizes a secure drop-in replacement with unified git diff and optional canary verification.
|
| 184 |
+
16. **`vulnforge_verify_patch`**:
|
| 185 |
- Executes isolated Canary Sandbox verification on synthesized or custom defensive patches using native Node.js `vm`.
|
| 186 |
- Runs dual-phase validation: Phase 1 evaluates attack payload containment (confirms exploit is blocked); Phase 2 evaluates benign functional input (ensures zero regression).
|
| 187 |
- Returns structured `CanaryVerificationReport` (`VERIFIED_SAFE`, `ATTACK_LEAKED`, `REGRESSION_DETECTED`, `SYNTAX_ERROR`, `SANDBOX_TIMEOUT`).
|
| 188 |
+
17. **`vulnforge_full_scan`**:
|
| 189 |
+
- Executes an end-to-end 360-degree security audit across Web, API, Database, GraphQL, CI/CD, Container/Kubernetes, eBPF, Dynamic API Fuzzing, Cloud IAM, Cryptographic Vaults, Supply Chain SBOM, Cosign Signature Attestation, WebAssembly eBPF Telemetry, and Distributed eBPF Microsegmentation layers simultaneously with automated patch synthesis and canary verification.
|
| 190 |
|
| 191 |
### 📋 Sample Vulnerability Findings & CWE Classification
|
| 192 |
+
- `[CRITICAL] Permissive Ingress Wildcard Policy - Default Ingress Allow All (CWE-284 / Improper Access Control)`
|
| 193 |
+
- `[CRITICAL] Unrestricted Cloud Metadata API Access - Missing 169.254.169.254 Egress Block (CWE-200 / Exposure of Sensitive Information)`
|
| 194 |
+
- `[HIGH] Missing Default-Deny Isolation - Permissive Pod Ingress Traffic (CWE-276 / Incorrect Default Permissions)`
|
| 195 |
+
- `[HIGH] Unencrypted Pod-to-Pod Cross-Node Network Traffic (CWE-319 / Cleartext Transmission)`
|
| 196 |
+
- `[HIGH] Permissive Host Namespace Network Access in Workload Spec (CWE-269 / Improper Privilege Management)`
|
| 197 |
- `[CRITICAL] Unbounded WebAssembly Linear Memory Bounds / Missing Heap Limit (CWE-119 / Improper Memory Buffer Restriction)`
|
| 198 |
- `[CRITICAL] Overprivileged WASI Host Filesystem Preopens / Root Directory Exposure (CWE-284 / Improper Access Control)`
|
| 199 |
- `[CRITICAL] Unsigned Container Image / Missing Cryptographic Cosign Signature (CWE-347 / Improper Verification of Cryptographic Signature)`
|
|
|
|
| 215 |
- `[HIGH] Missing Explicit Workflow Permissions - Risk of Default Write Privileges (CWE-276 / Default Permissions)`
|
| 216 |
- `[HIGH] Script Injection via Context Expression in Run Step (CWE-78 / Command Injection)`
|
| 217 |
- `[HIGH] Hardcoded Secret / Plaintext Personal Access Token Detected (CWE-798 / Hard-coded Credentials)`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 218 |
- `[MEDIUM] Unpinned Third-Party Action Mutable Tag @v4 - Supply Chain Attack Risk (CWE-829 / Untrusted Control Sphere)`
|
| 219 |
- `[MEDIUM] Container Root Filesystem Writable / Missing readOnlyRootFilesystem (CWE-732 / Incorrect Permission Assignment)`
|
| 220 |
|
docs/locales/hi.md
CHANGED
|
@@ -11,7 +11,7 @@
|
|
| 11 |
|
| 12 |
# 🛡️ VulnForge MCP
|
| 13 |
|
| 14 |
-
**वेब, एपीआई, डेटाबेस, सीआई/सीडी, कंटेनर/K8s, eBPF, डायनामिक एपीआई फ़ज़िंग, आपूर्ति श्रृंखला SBOM, Cosign हस्ताक्षर
|
| 15 |
|
| 16 |
[](../../LICENSE)
|
| 17 |
[](https://modelcontextprotocol.io/)
|
|
@@ -66,6 +66,9 @@ npx vulnforge-mcp --audit-cosign --file k8s/kyverno-verify.yaml
|
|
| 66 |
|
| 67 |
# 11. Direct WebAssembly eBPF & Host Telemetry Audit CLI Execution
|
| 68 |
npx vulnforge-mcp --audit-wasm-ebpf --file wasm-config.yaml
|
|
|
|
|
|
|
|
|
|
| 69 |
```
|
| 70 |
|
| 71 |
### Adding to Claude Desktop / Antigravity (`claude_desktop_config.json`)
|
|
@@ -84,7 +87,7 @@ npx vulnforge-mcp --audit-wasm-ebpf --file wasm-config.yaml
|
|
| 84 |
|
| 85 |
---
|
| 86 |
|
| 87 |
-
## 🏛️
|
| 88 |
|
| 89 |
<details open>
|
| 90 |
<summary><b>🏛️ View Architecture Pipeline Diagram (Click to toggle / 접기·펼치기)</b></summary>
|
|
@@ -110,18 +113,19 @@ npx vulnforge-mcp --audit-wasm-ebpf --file wasm-config.yaml
|
|
| 110 |
| **12** | **Supply Chain & SBOM Gate** | CycloneDX/SPDX SBOM and manifest auditing, internal scope dependency confusion (CWE-427), Levenshtein typosquatting heuristics (CWE-829), unpinned wildcards (CWE-1104), dangerous install script hooks (CWE-78), mutable Git branches, missing lockfile hashes (CWE-353), and NTIA EO 14028 minimum elements | Automated `.npmrc` scoped registry injection, canonical package replacement, semantic version pinning, `ignore-scripts=true` suppression, immutable Git commit SHA pinning, and NTIA metadata enrichment |
|
| 111 |
| **13** | **Cosign & Artifact Attestation** | OCI container image signature verification, Sigstore keyless Fulcio OIDC SAN validation, Rekor transparency log inclusion proofs, In-toto SLSA provenance level verification, and Kyverno/Gatekeeper admission policy auditing | Kyverno ClusterPolicy enforcement rules (`validationFailureAction: Enforce`), OPA Gatekeeper constraints, Rekor proof mandates, and immutable SHA-256 image digest pinning |
|
| 112 |
| **14** | **Wasm & eBPF Telemetry** | WebAssembly linear memory bounds (CWE-119), WASI host root preopen exposure (CWE-284), instruction fuel/CPU DoS (CWE-400), unpinned bytecode digests (CWE-345), dropped telemetry (CWE-778), and kernel credential leakage (CWE-209) | Memory page clamps (max: 256), scoped ephemeral preopens (`/sandbox`), instruction fuel budgeting (100k), digest pins, and PII scrubbing filters |
|
|
|
|
| 113 |
|
| 114 |
</details>
|
| 115 |
|
| 116 |
---
|
| 117 |
|
| 118 |
-
## 🛠️
|
| 119 |
|
| 120 |
<details open>
|
| 121 |
-
<summary><b>🛠️
|
| 122 |
<br>
|
| 123 |
|
| 124 |
-
VulnForge MCP exposes
|
| 125 |
|
| 126 |
1. **`vulnforge_audit_web`**:
|
| 127 |
- Analyzes HTTP response headers, cookie flags, and DOM client code.
|
|
@@ -169,16 +173,27 @@ VulnForge MCP exposes 16 specialized security audit tools to your AI agent:
|
|
| 169 |
- Detects unbounded linear memory growth, overprivileged WASI root preopens, missing execution fuel limits, unpinned Wasm module digests, dropped kernel telemetry without counters, plaintext credential leakage in argv, insecure shared memory state, and unconfined host root privileges.
|
| 170 |
- Correlates multi-host causal attack chains (dropper downloads, namespace unshare privesc, interactive reverse shells) and applies automated credential scrubbing.
|
| 171 |
- Parameters: `content` (string, optional raw config or manifest), `filePath` (string, optional path to file), `format` (optional string), `telemetryEvents` (optional array or JSON lines string), `strictCorrelation` (boolean, default true), `sanitizeTelemetry` (boolean, default true).
|
| 172 |
-
14. **`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 173 |
- Takes vulnerable code and automatically synthesizes a secure drop-in replacement with unified git diff and optional canary verification.
|
| 174 |
-
|
| 175 |
- Executes isolated Canary Sandbox verification on synthesized or custom defensive patches using native Node.js `vm`.
|
| 176 |
- Runs dual-phase validation: Phase 1 evaluates attack payload containment (confirms exploit is blocked); Phase 2 evaluates benign functional input (ensures zero regression).
|
| 177 |
- Returns structured `CanaryVerificationReport` (`VERIFIED_SAFE`, `ATTACK_LEAKED`, `REGRESSION_DETECTED`, `SYNTAX_ERROR`, `SANDBOX_TIMEOUT`).
|
| 178 |
-
|
| 179 |
-
- Executes an end-to-end 360-degree security audit across Web, API, Database, GraphQL, CI/CD, Container/Kubernetes, eBPF, Dynamic API Fuzzing, Cloud IAM, Cryptographic Vaults, Supply Chain SBOM, Cosign Signature Attestation,
|
| 180 |
|
| 181 |
### 📋 Sample Vulnerability Findings & CWE Classification
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 182 |
- `[CRITICAL] Unbounded WebAssembly Linear Memory Bounds / Missing Heap Limit (CWE-119 / Improper Memory Buffer Restriction)`
|
| 183 |
- `[CRITICAL] Overprivileged WASI Host Filesystem Preopens / Root Directory Exposure (CWE-284 / Improper Access Control)`
|
| 184 |
- `[CRITICAL] Unsigned Container Image / Missing Cryptographic Cosign Signature (CWE-347 / Improper Verification of Cryptographic Signature)`
|
|
@@ -200,21 +215,6 @@ VulnForge MCP exposes 16 specialized security audit tools to your AI agent:
|
|
| 200 |
- `[HIGH] Missing Explicit Workflow Permissions - Risk of Default Write Privileges (CWE-276 / Default Permissions)`
|
| 201 |
- `[HIGH] Script Injection via Context Expression in Run Step (CWE-78 / Command Injection)`
|
| 202 |
- `[HIGH] Hardcoded Secret / Plaintext Personal Access Token Detected (CWE-798 / Hard-coded Credentials)`
|
| 203 |
-
- `[CRITICAL] Untrusted PR Checkout via pull_request_target with Head SHA (CWE-250 / Privileged Execution)`
|
| 204 |
-
- `[CRITICAL] GraphQL Introspection Enabled in Production (CWE-200 / Information Exposure)`
|
| 205 |
-
- `[CRITICAL] Dependency Confusion Vulnerability - Missing Scoped Private Registry (CWE-427 / Uncontrolled Search Path Element)`
|
| 206 |
-
- `[HIGH] Keyless Attestation SAN Identity Mismatch / Untrusted OIDC Issuer (CWE-295 / Improper Certificate Validation)`
|
| 207 |
-
- `[HIGH] Missing Rekor Transparency Log Inclusion Proof - Rollback Vulnerability (CWE-353 / Missing Support for Integrity Check)`
|
| 208 |
-
- `[HIGH] Typosquatting Package Vector Detected: Possible Impersonation of Canonical Library (CWE-829 / Untrusted Control Sphere)`
|
| 209 |
-
- `[HIGH] Dangerous Install Lifecycle Script Hook - Remote Code Execution Risk (CWE-78 / Command Injection)`
|
| 210 |
-
- `[HIGH] Non-Compliant SBOM - Missing Mandatory NTIA Minimum Elements (Executive Order 14028 Non-Compliance)`
|
| 211 |
-
- `[MEDIUM] Mutable Container Image Tag Reference Lacking SHA-256 Digest Pin (CWE-1104 / Use of Unmaintained Third Party Component)`
|
| 212 |
-
- `[MEDIUM] Unpinned Dependency Wildcard Version Range in Production Manifest (CWE-1104 / Unmaintained Third Party Component)`
|
| 213 |
-
- `[HIGH] Missing runAsNonRoot & Container Running as Root User (CWE-276 / Incorrect Default Permissions)`
|
| 214 |
-
- `[HIGH] Kubernetes RBAC Wildcard Permissions Allocated (CWE-269 / Improper Privilege Management)`
|
| 215 |
-
- `[HIGH] Missing Explicit Workflow Permissions - Risk of Default Write Privileges (CWE-276 / Default Permissions)`
|
| 216 |
-
- `[HIGH] Script Injection via Context Expression in Run Step (CWE-78 / Command Injection)`
|
| 217 |
-
- `[HIGH] Hardcoded Secret / Plaintext Personal Access Token Detected (CWE-798 / Hard-coded Credentials)`
|
| 218 |
- `[MEDIUM] Unpinned Third-Party Action Mutable Tag @v4 - Supply Chain Attack Risk (CWE-829 / Untrusted Control Sphere)`
|
| 219 |
- `[MEDIUM] Container Root Filesystem Writable / Missing readOnlyRootFilesystem (CWE-732 / Incorrect Permission Assignment)`
|
| 220 |
|
|
|
|
| 11 |
|
| 12 |
# 🛡️ VulnForge MCP
|
| 13 |
|
| 14 |
+
**वेब, एपीआई, डेटाबेस, सीआई/सीडी, कंटेनर/K8s, eBPF, डायनामिक एपीआई फ़ज़िंग, आपूर्ति श्रृंखला SBOM, Cosign हस्ताक्षर, Wasm टेलीमेट्री और माइक्रोसेगमेंटेशन भेद्यता ऑडिटिंग और स्वचालित पैच इंजेक्शन एमपीसी सर्वर**
|
| 15 |
|
| 16 |
[](../../LICENSE)
|
| 17 |
[](https://modelcontextprotocol.io/)
|
|
|
|
| 66 |
|
| 67 |
# 11. Direct WebAssembly eBPF & Host Telemetry Audit CLI Execution
|
| 68 |
npx vulnforge-mcp --audit-wasm-ebpf --file wasm-config.yaml
|
| 69 |
+
|
| 70 |
+
# 12. Direct eBPF Microsegmentation & Zero Trust Flow Policy Audit CLI Execution
|
| 71 |
+
npx vulnforge-mcp --audit-microsegmentation --file policies/cilium.yaml
|
| 72 |
```
|
| 73 |
|
| 74 |
### Adding to Claude Desktop / Antigravity (`claude_desktop_config.json`)
|
|
|
|
| 87 |
|
| 88 |
---
|
| 89 |
|
| 90 |
+
## 🏛️ 15 मुख्य भेद्यता ऑडिटिंग स्तंभ
|
| 91 |
|
| 92 |
<details open>
|
| 93 |
<summary><b>🏛️ View Architecture Pipeline Diagram (Click to toggle / 접기·펼치기)</b></summary>
|
|
|
|
| 113 |
| **12** | **Supply Chain & SBOM Gate** | CycloneDX/SPDX SBOM and manifest auditing, internal scope dependency confusion (CWE-427), Levenshtein typosquatting heuristics (CWE-829), unpinned wildcards (CWE-1104), dangerous install script hooks (CWE-78), mutable Git branches, missing lockfile hashes (CWE-353), and NTIA EO 14028 minimum elements | Automated `.npmrc` scoped registry injection, canonical package replacement, semantic version pinning, `ignore-scripts=true` suppression, immutable Git commit SHA pinning, and NTIA metadata enrichment |
|
| 114 |
| **13** | **Cosign & Artifact Attestation** | OCI container image signature verification, Sigstore keyless Fulcio OIDC SAN validation, Rekor transparency log inclusion proofs, In-toto SLSA provenance level verification, and Kyverno/Gatekeeper admission policy auditing | Kyverno ClusterPolicy enforcement rules (`validationFailureAction: Enforce`), OPA Gatekeeper constraints, Rekor proof mandates, and immutable SHA-256 image digest pinning |
|
| 115 |
| **14** | **Wasm & eBPF Telemetry** | WebAssembly linear memory bounds (CWE-119), WASI host root preopen exposure (CWE-284), instruction fuel/CPU DoS (CWE-400), unpinned bytecode digests (CWE-345), dropped telemetry (CWE-778), and kernel credential leakage (CWE-209) | Memory page clamps (max: 256), scoped ephemeral preopens (`/sandbox`), instruction fuel budgeting (100k), digest pins, and PII scrubbing filters |
|
| 116 |
+
| **15** | **Microsegmentation & eBPF Flow** | CiliumNetworkPolicy, K8s NetworkPolicy, Calico & eBPF kernel flow telemetry (CWE-284, CWE-923, CWE-200, CWE-276, CWE-269, CWE-319, CWE-668, CWE-778) | Automated Zero Trust ingress isolation, L7 HTTP rules, metadata endpoint blocking, and Hubble flow telemetry policy synthesis |
|
| 117 |
|
| 118 |
</details>
|
| 119 |
|
| 120 |
---
|
| 121 |
|
| 122 |
+
## 🛠️ 17 मुख्य एमसीपी सुरक्षा उपकरण
|
| 123 |
|
| 124 |
<details open>
|
| 125 |
+
<summary><b>🛠️ 17 मुख्य एमसीपी सुरक्षा उपकरण (Click to toggle / 접기·펼치기)</b></summary>
|
| 126 |
<br>
|
| 127 |
|
| 128 |
+
VulnForge MCP exposes 17 specialized security audit tools to your AI agent:
|
| 129 |
|
| 130 |
1. **`vulnforge_audit_web`**:
|
| 131 |
- Analyzes HTTP response headers, cookie flags, and DOM client code.
|
|
|
|
| 173 |
- Detects unbounded linear memory growth, overprivileged WASI root preopens, missing execution fuel limits, unpinned Wasm module digests, dropped kernel telemetry without counters, plaintext credential leakage in argv, insecure shared memory state, and unconfined host root privileges.
|
| 174 |
- Correlates multi-host causal attack chains (dropper downloads, namespace unshare privesc, interactive reverse shells) and applies automated credential scrubbing.
|
| 175 |
- Parameters: `content` (string, optional raw config or manifest), `filePath` (string, optional path to file), `format` (optional string), `telemetryEvents` (optional array or JSON lines string), `strictCorrelation` (boolean, default true), `sanitizeTelemetry` (boolean, default true).
|
| 176 |
+
14. **`vulnforge_audit_microsegmentation`**:
|
| 177 |
+
- Deep inspection of CiliumNetworkPolicy, Kubernetes NetworkPolicy, Calico specifications, and eBPF kernel flow telemetry streams (Cilium Hubble / flow logs).
|
| 178 |
+
- Detects permissive ingress wildcards (CWE-284/CWE-923), unrestricted cloud metadata API access (`169.254.169.254` / CWE-200), missing default-deny isolation (CWE-276), unencrypted cross-node pod-to-pod traffic (CWE-319), permissive host namespace access (CWE-269), unrestricted egress wildcards (CWE-668), unmonitored cross-namespace flows (CWE-778), and missing L7 protocol enforcement (CWE-284).
|
| 179 |
+
- Automatically synthesizes least-privilege Cilium and Kubernetes NetworkPolicies directly from observed eBPF kernel flow telemetry events.
|
| 180 |
+
- Synthesizes automated drop-in hardening patches (default-deny rules, metadata CIDR blocks, L7 HTTP method/path filters, WireGuard annotations) with dual canary sandbox validation.
|
| 181 |
+
- Parameters: `content` (string, optional raw policy YAML text), `filePath` (string, optional path to file), `format` (optional string), `flowTelemetryStream` (optional array or JSON lines string), `strictIngress` (boolean, default true), `blockCloudMetadata` (boolean, default true).
|
| 182 |
+
15. **`vulnforge_inject_patch`**:
|
| 183 |
- Takes vulnerable code and automatically synthesizes a secure drop-in replacement with unified git diff and optional canary verification.
|
| 184 |
+
16. **`vulnforge_verify_patch`**:
|
| 185 |
- Executes isolated Canary Sandbox verification on synthesized or custom defensive patches using native Node.js `vm`.
|
| 186 |
- Runs dual-phase validation: Phase 1 evaluates attack payload containment (confirms exploit is blocked); Phase 2 evaluates benign functional input (ensures zero regression).
|
| 187 |
- Returns structured `CanaryVerificationReport` (`VERIFIED_SAFE`, `ATTACK_LEAKED`, `REGRESSION_DETECTED`, `SYNTAX_ERROR`, `SANDBOX_TIMEOUT`).
|
| 188 |
+
17. **`vulnforge_full_scan`**:
|
| 189 |
+
- Executes an end-to-end 360-degree security audit across Web, API, Database, GraphQL, CI/CD, Container/Kubernetes, eBPF, Dynamic API Fuzzing, Cloud IAM, Cryptographic Vaults, Supply Chain SBOM, Cosign Signature Attestation, WebAssembly eBPF Telemetry, and Distributed eBPF Microsegmentation layers simultaneously with automated patch synthesis and canary verification.
|
| 190 |
|
| 191 |
### 📋 Sample Vulnerability Findings & CWE Classification
|
| 192 |
+
- `[CRITICAL] Permissive Ingress Wildcard Policy - Default Ingress Allow All (CWE-284 / Improper Access Control)`
|
| 193 |
+
- `[CRITICAL] Unrestricted Cloud Metadata API Access - Missing 169.254.169.254 Egress Block (CWE-200 / Exposure of Sensitive Information)`
|
| 194 |
+
- `[HIGH] Missing Default-Deny Isolation - Permissive Pod Ingress Traffic (CWE-276 / Incorrect Default Permissions)`
|
| 195 |
+
- `[HIGH] Unencrypted Pod-to-Pod Cross-Node Network Traffic (CWE-319 / Cleartext Transmission)`
|
| 196 |
+
- `[HIGH] Permissive Host Namespace Network Access in Workload Spec (CWE-269 / Improper Privilege Management)`
|
| 197 |
- `[CRITICAL] Unbounded WebAssembly Linear Memory Bounds / Missing Heap Limit (CWE-119 / Improper Memory Buffer Restriction)`
|
| 198 |
- `[CRITICAL] Overprivileged WASI Host Filesystem Preopens / Root Directory Exposure (CWE-284 / Improper Access Control)`
|
| 199 |
- `[CRITICAL] Unsigned Container Image / Missing Cryptographic Cosign Signature (CWE-347 / Improper Verification of Cryptographic Signature)`
|
|
|
|
| 215 |
- `[HIGH] Missing Explicit Workflow Permissions - Risk of Default Write Privileges (CWE-276 / Default Permissions)`
|
| 216 |
- `[HIGH] Script Injection via Context Expression in Run Step (CWE-78 / Command Injection)`
|
| 217 |
- `[HIGH] Hardcoded Secret / Plaintext Personal Access Token Detected (CWE-798 / Hard-coded Credentials)`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 218 |
- `[MEDIUM] Unpinned Third-Party Action Mutable Tag @v4 - Supply Chain Attack Risk (CWE-829 / Untrusted Control Sphere)`
|
| 219 |
- `[MEDIUM] Container Root Filesystem Writable / Missing readOnlyRootFilesystem (CWE-732 / Incorrect Permission Assignment)`
|
| 220 |
|
docs/locales/id.md
CHANGED
|
@@ -11,7 +11,7 @@
|
|
| 11 |
|
| 12 |
# 🛡️ VulnForge MCP
|
| 13 |
|
| 14 |
-
**Server MCP native-AI universal untuk audit kerentanan Web, API, Basis Data, CI/CD, Kontainer/K8s, eBPF, Fuzzing API Dinamis, SBOM Rantai Pasokan, Atestasi Tanda Tangan Cosign,
|
| 15 |
|
| 16 |
[](../../LICENSE)
|
| 17 |
[](https://modelcontextprotocol.io/)
|
|
@@ -66,6 +66,9 @@ npx vulnforge-mcp --audit-cosign --file k8s/kyverno-verify.yaml
|
|
| 66 |
|
| 67 |
# 11. Direct WebAssembly eBPF & Host Telemetry Audit CLI Execution
|
| 68 |
npx vulnforge-mcp --audit-wasm-ebpf --file wasm-config.yaml
|
|
|
|
|
|
|
|
|
|
| 69 |
```
|
| 70 |
|
| 71 |
### Adding to Claude Desktop / Antigravity (`claude_desktop_config.json`)
|
|
@@ -84,7 +87,7 @@ npx vulnforge-mcp --audit-wasm-ebpf --file wasm-config.yaml
|
|
| 84 |
|
| 85 |
---
|
| 86 |
|
| 87 |
-
## 🏛️
|
| 88 |
|
| 89 |
<details open>
|
| 90 |
<summary><b>🏛️ View Architecture Pipeline Diagram (Click to toggle / 접기·펼치기)</b></summary>
|
|
@@ -110,18 +113,19 @@ npx vulnforge-mcp --audit-wasm-ebpf --file wasm-config.yaml
|
|
| 110 |
| **12** | **Supply Chain & SBOM Gate** | CycloneDX/SPDX SBOM and manifest auditing, internal scope dependency confusion (CWE-427), Levenshtein typosquatting heuristics (CWE-829), unpinned wildcards (CWE-1104), dangerous install script hooks (CWE-78), mutable Git branches, missing lockfile hashes (CWE-353), and NTIA EO 14028 minimum elements | Automated `.npmrc` scoped registry injection, canonical package replacement, semantic version pinning, `ignore-scripts=true` suppression, immutable Git commit SHA pinning, and NTIA metadata enrichment |
|
| 111 |
| **13** | **Cosign & Artifact Attestation** | OCI container image signature verification, Sigstore keyless Fulcio OIDC SAN validation, Rekor transparency log inclusion proofs, In-toto SLSA provenance level verification, and Kyverno/Gatekeeper admission policy auditing | Kyverno ClusterPolicy enforcement rules (`validationFailureAction: Enforce`), OPA Gatekeeper constraints, Rekor proof mandates, and immutable SHA-256 image digest pinning |
|
| 112 |
| **14** | **Wasm & eBPF Telemetry** | WebAssembly linear memory bounds (CWE-119), WASI host root preopen exposure (CWE-284), instruction fuel/CPU DoS (CWE-400), unpinned bytecode digests (CWE-345), dropped telemetry (CWE-778), and kernel credential leakage (CWE-209) | Memory page clamps (max: 256), scoped ephemeral preopens (`/sandbox`), instruction fuel budgeting (100k), digest pins, and PII scrubbing filters |
|
|
|
|
| 113 |
|
| 114 |
</details>
|
| 115 |
|
| 116 |
---
|
| 117 |
|
| 118 |
-
## 🛠️
|
| 119 |
|
| 120 |
<details open>
|
| 121 |
-
<summary><b>🛠️
|
| 122 |
<br>
|
| 123 |
|
| 124 |
-
VulnForge MCP exposes
|
| 125 |
|
| 126 |
1. **`vulnforge_audit_web`**:
|
| 127 |
- Analyzes HTTP response headers, cookie flags, and DOM client code.
|
|
@@ -169,16 +173,27 @@ VulnForge MCP exposes 16 specialized security audit tools to your AI agent:
|
|
| 169 |
- Detects unbounded linear memory growth, overprivileged WASI root preopens, missing execution fuel limits, unpinned Wasm module digests, dropped kernel telemetry without counters, plaintext credential leakage in argv, insecure shared memory state, and unconfined host root privileges.
|
| 170 |
- Correlates multi-host causal attack chains (dropper downloads, namespace unshare privesc, interactive reverse shells) and applies automated credential scrubbing.
|
| 171 |
- Parameters: `content` (string, optional raw config or manifest), `filePath` (string, optional path to file), `format` (optional string), `telemetryEvents` (optional array or JSON lines string), `strictCorrelation` (boolean, default true), `sanitizeTelemetry` (boolean, default true).
|
| 172 |
-
14. **`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 173 |
- Takes vulnerable code and automatically synthesizes a secure drop-in replacement with unified git diff and optional canary verification.
|
| 174 |
-
|
| 175 |
- Executes isolated Canary Sandbox verification on synthesized or custom defensive patches using native Node.js `vm`.
|
| 176 |
- Runs dual-phase validation: Phase 1 evaluates attack payload containment (confirms exploit is blocked); Phase 2 evaluates benign functional input (ensures zero regression).
|
| 177 |
- Returns structured `CanaryVerificationReport` (`VERIFIED_SAFE`, `ATTACK_LEAKED`, `REGRESSION_DETECTED`, `SYNTAX_ERROR`, `SANDBOX_TIMEOUT`).
|
| 178 |
-
|
| 179 |
-
- Executes an end-to-end 360-degree security audit across Web, API, Database, GraphQL, CI/CD, Container/Kubernetes, eBPF, Dynamic API Fuzzing, Cloud IAM, Cryptographic Vaults, Supply Chain SBOM, Cosign Signature Attestation,
|
| 180 |
|
| 181 |
### 📋 Sample Vulnerability Findings & CWE Classification
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 182 |
- `[CRITICAL] Unbounded WebAssembly Linear Memory Bounds / Missing Heap Limit (CWE-119 / Improper Memory Buffer Restriction)`
|
| 183 |
- `[CRITICAL] Overprivileged WASI Host Filesystem Preopens / Root Directory Exposure (CWE-284 / Improper Access Control)`
|
| 184 |
- `[CRITICAL] Unsigned Container Image / Missing Cryptographic Cosign Signature (CWE-347 / Improper Verification of Cryptographic Signature)`
|
|
@@ -200,21 +215,6 @@ VulnForge MCP exposes 16 specialized security audit tools to your AI agent:
|
|
| 200 |
- `[HIGH] Missing Explicit Workflow Permissions - Risk of Default Write Privileges (CWE-276 / Default Permissions)`
|
| 201 |
- `[HIGH] Script Injection via Context Expression in Run Step (CWE-78 / Command Injection)`
|
| 202 |
- `[HIGH] Hardcoded Secret / Plaintext Personal Access Token Detected (CWE-798 / Hard-coded Credentials)`
|
| 203 |
-
- `[CRITICAL] Untrusted PR Checkout via pull_request_target with Head SHA (CWE-250 / Privileged Execution)`
|
| 204 |
-
- `[CRITICAL] GraphQL Introspection Enabled in Production (CWE-200 / Information Exposure)`
|
| 205 |
-
- `[CRITICAL] Dependency Confusion Vulnerability - Missing Scoped Private Registry (CWE-427 / Uncontrolled Search Path Element)`
|
| 206 |
-
- `[HIGH] Keyless Attestation SAN Identity Mismatch / Untrusted OIDC Issuer (CWE-295 / Improper Certificate Validation)`
|
| 207 |
-
- `[HIGH] Missing Rekor Transparency Log Inclusion Proof - Rollback Vulnerability (CWE-353 / Missing Support for Integrity Check)`
|
| 208 |
-
- `[HIGH] Typosquatting Package Vector Detected: Possible Impersonation of Canonical Library (CWE-829 / Untrusted Control Sphere)`
|
| 209 |
-
- `[HIGH] Dangerous Install Lifecycle Script Hook - Remote Code Execution Risk (CWE-78 / Command Injection)`
|
| 210 |
-
- `[HIGH] Non-Compliant SBOM - Missing Mandatory NTIA Minimum Elements (Executive Order 14028 Non-Compliance)`
|
| 211 |
-
- `[MEDIUM] Mutable Container Image Tag Reference Lacking SHA-256 Digest Pin (CWE-1104 / Use of Unmaintained Third Party Component)`
|
| 212 |
-
- `[MEDIUM] Unpinned Dependency Wildcard Version Range in Production Manifest (CWE-1104 / Unmaintained Third Party Component)`
|
| 213 |
-
- `[HIGH] Missing runAsNonRoot & Container Running as Root User (CWE-276 / Incorrect Default Permissions)`
|
| 214 |
-
- `[HIGH] Kubernetes RBAC Wildcard Permissions Allocated (CWE-269 / Improper Privilege Management)`
|
| 215 |
-
- `[HIGH] Missing Explicit Workflow Permissions - Risk of Default Write Privileges (CWE-276 / Default Permissions)`
|
| 216 |
-
- `[HIGH] Script Injection via Context Expression in Run Step (CWE-78 / Command Injection)`
|
| 217 |
-
- `[HIGH] Hardcoded Secret / Plaintext Personal Access Token Detected (CWE-798 / Hard-coded Credentials)`
|
| 218 |
- `[MEDIUM] Unpinned Third-Party Action Mutable Tag @v4 - Supply Chain Attack Risk (CWE-829 / Untrusted Control Sphere)`
|
| 219 |
- `[MEDIUM] Container Root Filesystem Writable / Missing readOnlyRootFilesystem (CWE-732 / Incorrect Permission Assignment)`
|
| 220 |
|
|
|
|
| 11 |
|
| 12 |
# 🛡️ VulnForge MCP
|
| 13 |
|
| 14 |
+
**Server MCP native-AI universal untuk audit kerentanan Web, API, Basis Data, CI/CD, Kontainer/K8s, eBPF, Fuzzing API Dinamis, SBOM Rantai Pasokan, Atestasi Tanda Tangan Cosign, Telemetri Wasm, dan Mikrosegmentasi dengan injeksi patch otomatis**
|
| 15 |
|
| 16 |
[](../../LICENSE)
|
| 17 |
[](https://modelcontextprotocol.io/)
|
|
|
|
| 66 |
|
| 67 |
# 11. Direct WebAssembly eBPF & Host Telemetry Audit CLI Execution
|
| 68 |
npx vulnforge-mcp --audit-wasm-ebpf --file wasm-config.yaml
|
| 69 |
+
|
| 70 |
+
# 12. Direct eBPF Microsegmentation & Zero Trust Flow Policy Audit CLI Execution
|
| 71 |
+
npx vulnforge-mcp --audit-microsegmentation --file policies/cilium.yaml
|
| 72 |
```
|
| 73 |
|
| 74 |
### Adding to Claude Desktop / Antigravity (`claude_desktop_config.json`)
|
|
|
|
| 87 |
|
| 88 |
---
|
| 89 |
|
| 90 |
+
## 🏛️ 15 Pilar Audit Kerentanan
|
| 91 |
|
| 92 |
<details open>
|
| 93 |
<summary><b>🏛️ View Architecture Pipeline Diagram (Click to toggle / 접기·펼치기)</b></summary>
|
|
|
|
| 113 |
| **12** | **Supply Chain & SBOM Gate** | CycloneDX/SPDX SBOM and manifest auditing, internal scope dependency confusion (CWE-427), Levenshtein typosquatting heuristics (CWE-829), unpinned wildcards (CWE-1104), dangerous install script hooks (CWE-78), mutable Git branches, missing lockfile hashes (CWE-353), and NTIA EO 14028 minimum elements | Automated `.npmrc` scoped registry injection, canonical package replacement, semantic version pinning, `ignore-scripts=true` suppression, immutable Git commit SHA pinning, and NTIA metadata enrichment |
|
| 114 |
| **13** | **Cosign & Artifact Attestation** | OCI container image signature verification, Sigstore keyless Fulcio OIDC SAN validation, Rekor transparency log inclusion proofs, In-toto SLSA provenance level verification, and Kyverno/Gatekeeper admission policy auditing | Kyverno ClusterPolicy enforcement rules (`validationFailureAction: Enforce`), OPA Gatekeeper constraints, Rekor proof mandates, and immutable SHA-256 image digest pinning |
|
| 115 |
| **14** | **Wasm & eBPF Telemetry** | WebAssembly linear memory bounds (CWE-119), WASI host root preopen exposure (CWE-284), instruction fuel/CPU DoS (CWE-400), unpinned bytecode digests (CWE-345), dropped telemetry (CWE-778), and kernel credential leakage (CWE-209) | Memory page clamps (max: 256), scoped ephemeral preopens (`/sandbox`), instruction fuel budgeting (100k), digest pins, and PII scrubbing filters |
|
| 116 |
+
| **15** | **Microsegmentation & eBPF Flow** | CiliumNetworkPolicy, K8s NetworkPolicy, Calico & eBPF kernel flow telemetry (CWE-284, CWE-923, CWE-200, CWE-276, CWE-269, CWE-319, CWE-668, CWE-778) | Automated Zero Trust ingress isolation, L7 HTTP rules, metadata endpoint blocking, and Hubble flow telemetry policy synthesis |
|
| 117 |
|
| 118 |
</details>
|
| 119 |
|
| 120 |
---
|
| 121 |
|
| 122 |
+
## 🛠️ 17 Alat Keamanan Utama MCP
|
| 123 |
|
| 124 |
<details open>
|
| 125 |
+
<summary><b>🛠️ 17 Alat Keamanan Utama MCP (Click to toggle / 접기·펼치기)</b></summary>
|
| 126 |
<br>
|
| 127 |
|
| 128 |
+
VulnForge MCP exposes 17 specialized security audit tools to your AI agent:
|
| 129 |
|
| 130 |
1. **`vulnforge_audit_web`**:
|
| 131 |
- Analyzes HTTP response headers, cookie flags, and DOM client code.
|
|
|
|
| 173 |
- Detects unbounded linear memory growth, overprivileged WASI root preopens, missing execution fuel limits, unpinned Wasm module digests, dropped kernel telemetry without counters, plaintext credential leakage in argv, insecure shared memory state, and unconfined host root privileges.
|
| 174 |
- Correlates multi-host causal attack chains (dropper downloads, namespace unshare privesc, interactive reverse shells) and applies automated credential scrubbing.
|
| 175 |
- Parameters: `content` (string, optional raw config or manifest), `filePath` (string, optional path to file), `format` (optional string), `telemetryEvents` (optional array or JSON lines string), `strictCorrelation` (boolean, default true), `sanitizeTelemetry` (boolean, default true).
|
| 176 |
+
14. **`vulnforge_audit_microsegmentation`**:
|
| 177 |
+
- Deep inspection of CiliumNetworkPolicy, Kubernetes NetworkPolicy, Calico specifications, and eBPF kernel flow telemetry streams (Cilium Hubble / flow logs).
|
| 178 |
+
- Detects permissive ingress wildcards (CWE-284/CWE-923), unrestricted cloud metadata API access (`169.254.169.254` / CWE-200), missing default-deny isolation (CWE-276), unencrypted cross-node pod-to-pod traffic (CWE-319), permissive host namespace access (CWE-269), unrestricted egress wildcards (CWE-668), unmonitored cross-namespace flows (CWE-778), and missing L7 protocol enforcement (CWE-284).
|
| 179 |
+
- Automatically synthesizes least-privilege Cilium and Kubernetes NetworkPolicies directly from observed eBPF kernel flow telemetry events.
|
| 180 |
+
- Synthesizes automated drop-in hardening patches (default-deny rules, metadata CIDR blocks, L7 HTTP method/path filters, WireGuard annotations) with dual canary sandbox validation.
|
| 181 |
+
- Parameters: `content` (string, optional raw policy YAML text), `filePath` (string, optional path to file), `format` (optional string), `flowTelemetryStream` (optional array or JSON lines string), `strictIngress` (boolean, default true), `blockCloudMetadata` (boolean, default true).
|
| 182 |
+
15. **`vulnforge_inject_patch`**:
|
| 183 |
- Takes vulnerable code and automatically synthesizes a secure drop-in replacement with unified git diff and optional canary verification.
|
| 184 |
+
16. **`vulnforge_verify_patch`**:
|
| 185 |
- Executes isolated Canary Sandbox verification on synthesized or custom defensive patches using native Node.js `vm`.
|
| 186 |
- Runs dual-phase validation: Phase 1 evaluates attack payload containment (confirms exploit is blocked); Phase 2 evaluates benign functional input (ensures zero regression).
|
| 187 |
- Returns structured `CanaryVerificationReport` (`VERIFIED_SAFE`, `ATTACK_LEAKED`, `REGRESSION_DETECTED`, `SYNTAX_ERROR`, `SANDBOX_TIMEOUT`).
|
| 188 |
+
17. **`vulnforge_full_scan`**:
|
| 189 |
+
- Executes an end-to-end 360-degree security audit across Web, API, Database, GraphQL, CI/CD, Container/Kubernetes, eBPF, Dynamic API Fuzzing, Cloud IAM, Cryptographic Vaults, Supply Chain SBOM, Cosign Signature Attestation, WebAssembly eBPF Telemetry, and Distributed eBPF Microsegmentation layers simultaneously with automated patch synthesis and canary verification.
|
| 190 |
|
| 191 |
### 📋 Sample Vulnerability Findings & CWE Classification
|
| 192 |
+
- `[CRITICAL] Permissive Ingress Wildcard Policy - Default Ingress Allow All (CWE-284 / Improper Access Control)`
|
| 193 |
+
- `[CRITICAL] Unrestricted Cloud Metadata API Access - Missing 169.254.169.254 Egress Block (CWE-200 / Exposure of Sensitive Information)`
|
| 194 |
+
- `[HIGH] Missing Default-Deny Isolation - Permissive Pod Ingress Traffic (CWE-276 / Incorrect Default Permissions)`
|
| 195 |
+
- `[HIGH] Unencrypted Pod-to-Pod Cross-Node Network Traffic (CWE-319 / Cleartext Transmission)`
|
| 196 |
+
- `[HIGH] Permissive Host Namespace Network Access in Workload Spec (CWE-269 / Improper Privilege Management)`
|
| 197 |
- `[CRITICAL] Unbounded WebAssembly Linear Memory Bounds / Missing Heap Limit (CWE-119 / Improper Memory Buffer Restriction)`
|
| 198 |
- `[CRITICAL] Overprivileged WASI Host Filesystem Preopens / Root Directory Exposure (CWE-284 / Improper Access Control)`
|
| 199 |
- `[CRITICAL] Unsigned Container Image / Missing Cryptographic Cosign Signature (CWE-347 / Improper Verification of Cryptographic Signature)`
|
|
|
|
| 215 |
- `[HIGH] Missing Explicit Workflow Permissions - Risk of Default Write Privileges (CWE-276 / Default Permissions)`
|
| 216 |
- `[HIGH] Script Injection via Context Expression in Run Step (CWE-78 / Command Injection)`
|
| 217 |
- `[HIGH] Hardcoded Secret / Plaintext Personal Access Token Detected (CWE-798 / Hard-coded Credentials)`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 218 |
- `[MEDIUM] Unpinned Third-Party Action Mutable Tag @v4 - Supply Chain Attack Risk (CWE-829 / Untrusted Control Sphere)`
|
| 219 |
- `[MEDIUM] Container Root Filesystem Writable / Missing readOnlyRootFilesystem (CWE-732 / Incorrect Permission Assignment)`
|
| 220 |
|
docs/locales/ko.md
CHANGED
|
@@ -11,7 +11,7 @@
|
|
| 11 |
|
| 12 |
# 🛡️ VulnForge MCP
|
| 13 |
|
| 14 |
-
**웹·API·데이터베이스·CI/CD·컨테이너/K8s·eBPF/런타임·동적 API 퍼징·공급망 SBOM, Cosign 서명
|
| 15 |
|
| 16 |
[](../../LICENSE)
|
| 17 |
[](https://modelcontextprotocol.io/)
|
|
@@ -66,6 +66,9 @@ npx vulnforge-mcp --audit-cosign --file k8s/kyverno-verify.yaml
|
|
| 66 |
|
| 67 |
# 11. Direct WebAssembly eBPF & Host Telemetry Audit CLI Execution
|
| 68 |
npx vulnforge-mcp --audit-wasm-ebpf --file wasm-config.yaml
|
|
|
|
|
|
|
|
|
|
| 69 |
```
|
| 70 |
|
| 71 |
### Adding to Claude Desktop / Antigravity (`claude_desktop_config.json`)
|
|
@@ -84,7 +87,7 @@ npx vulnforge-mcp --audit-wasm-ebpf --file wasm-config.yaml
|
|
| 84 |
|
| 85 |
---
|
| 86 |
|
| 87 |
-
## 🏛️
|
| 88 |
|
| 89 |
<details open>
|
| 90 |
<summary><b>🏛️ View Architecture Pipeline Diagram (Click to toggle / 접기·펼치기)</b></summary>
|
|
@@ -110,18 +113,19 @@ npx vulnforge-mcp --audit-wasm-ebpf --file wasm-config.yaml
|
|
| 110 |
| **12** | **Supply Chain & SBOM Gate** | CycloneDX/SPDX SBOM and manifest auditing, internal scope dependency confusion (CWE-427), Levenshtein typosquatting heuristics (CWE-829), unpinned wildcards (CWE-1104), dangerous install script hooks (CWE-78), mutable Git branches, missing lockfile hashes (CWE-353), and NTIA EO 14028 minimum elements | Automated `.npmrc` scoped registry injection, canonical package replacement, semantic version pinning, `ignore-scripts=true` suppression, immutable Git commit SHA pinning, and NTIA metadata enrichment |
|
| 111 |
| **13** | **Cosign & Artifact Attestation** | OCI container image signature verification, Sigstore keyless Fulcio OIDC SAN validation, Rekor transparency log inclusion proofs, In-toto SLSA provenance level verification, and Kyverno/Gatekeeper admission policy auditing | Kyverno ClusterPolicy enforcement rules (`validationFailureAction: Enforce`), OPA Gatekeeper constraints, Rekor proof mandates, and immutable SHA-256 image digest pinning |
|
| 112 |
| **14** | **Wasm & eBPF Telemetry** | WebAssembly linear memory bounds (CWE-119), WASI host root preopen exposure (CWE-284), instruction fuel/CPU DoS (CWE-400), unpinned bytecode digests (CWE-345), dropped telemetry (CWE-778), and kernel credential leakage (CWE-209) | Memory page clamps (max: 256), scoped ephemeral preopens (`/sandbox`), instruction fuel budgeting (100k), digest pins, and PII scrubbing filters |
|
|
|
|
| 113 |
|
| 114 |
</details>
|
| 115 |
|
| 116 |
---
|
| 117 |
|
| 118 |
-
## 🛠️
|
| 119 |
|
| 120 |
<details open>
|
| 121 |
-
<summary><b>🛠️
|
| 122 |
<br>
|
| 123 |
|
| 124 |
-
VulnForge MCP exposes
|
| 125 |
|
| 126 |
1. **`vulnforge_audit_web`**:
|
| 127 |
- Analyzes HTTP response headers, cookie flags, and DOM client code.
|
|
@@ -169,16 +173,27 @@ VulnForge MCP exposes 16 specialized security audit tools to your AI agent:
|
|
| 169 |
- Detects unbounded linear memory growth, overprivileged WASI root preopens, missing execution fuel limits, unpinned Wasm module digests, dropped kernel telemetry without counters, plaintext credential leakage in argv, insecure shared memory state, and unconfined host root privileges.
|
| 170 |
- Correlates multi-host causal attack chains (dropper downloads, namespace unshare privesc, interactive reverse shells) and applies automated credential scrubbing.
|
| 171 |
- Parameters: `content` (string, optional raw config or manifest), `filePath` (string, optional path to file), `format` (optional string), `telemetryEvents` (optional array or JSON lines string), `strictCorrelation` (boolean, default true), `sanitizeTelemetry` (boolean, default true).
|
| 172 |
-
14. **`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 173 |
- Takes vulnerable code and automatically synthesizes a secure drop-in replacement with unified git diff and optional canary verification.
|
| 174 |
-
|
| 175 |
- Executes isolated Canary Sandbox verification on synthesized or custom defensive patches using native Node.js `vm`.
|
| 176 |
- Runs dual-phase validation: Phase 1 evaluates attack payload containment (confirms exploit is blocked); Phase 2 evaluates benign functional input (ensures zero regression).
|
| 177 |
- Returns structured `CanaryVerificationReport` (`VERIFIED_SAFE`, `ATTACK_LEAKED`, `REGRESSION_DETECTED`, `SYNTAX_ERROR`, `SANDBOX_TIMEOUT`).
|
| 178 |
-
|
| 179 |
-
- Executes an end-to-end 360-degree security audit across Web, API, Database, GraphQL, CI/CD, Container/Kubernetes, eBPF, Dynamic API Fuzzing, Cloud IAM, Cryptographic Vaults, Supply Chain SBOM, Cosign Signature Attestation,
|
| 180 |
|
| 181 |
### 📋 Sample Vulnerability Findings & CWE Classification
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 182 |
- `[CRITICAL] Unbounded WebAssembly Linear Memory Bounds / Missing Heap Limit (CWE-119 / Improper Memory Buffer Restriction)`
|
| 183 |
- `[CRITICAL] Overprivileged WASI Host Filesystem Preopens / Root Directory Exposure (CWE-284 / Improper Access Control)`
|
| 184 |
- `[CRITICAL] Unsigned Container Image / Missing Cryptographic Cosign Signature (CWE-347 / Improper Verification of Cryptographic Signature)`
|
|
@@ -200,21 +215,6 @@ VulnForge MCP exposes 16 specialized security audit tools to your AI agent:
|
|
| 200 |
- `[HIGH] Missing Explicit Workflow Permissions - Risk of Default Write Privileges (CWE-276 / Default Permissions)`
|
| 201 |
- `[HIGH] Script Injection via Context Expression in Run Step (CWE-78 / Command Injection)`
|
| 202 |
- `[HIGH] Hardcoded Secret / Plaintext Personal Access Token Detected (CWE-798 / Hard-coded Credentials)`
|
| 203 |
-
- `[CRITICAL] Untrusted PR Checkout via pull_request_target with Head SHA (CWE-250 / Privileged Execution)`
|
| 204 |
-
- `[CRITICAL] GraphQL Introspection Enabled in Production (CWE-200 / Information Exposure)`
|
| 205 |
-
- `[CRITICAL] Dependency Confusion Vulnerability - Missing Scoped Private Registry (CWE-427 / Uncontrolled Search Path Element)`
|
| 206 |
-
- `[HIGH] Keyless Attestation SAN Identity Mismatch / Untrusted OIDC Issuer (CWE-295 / Improper Certificate Validation)`
|
| 207 |
-
- `[HIGH] Missing Rekor Transparency Log Inclusion Proof - Rollback Vulnerability (CWE-353 / Missing Support for Integrity Check)`
|
| 208 |
-
- `[HIGH] Typosquatting Package Vector Detected: Possible Impersonation of Canonical Library (CWE-829 / Untrusted Control Sphere)`
|
| 209 |
-
- `[HIGH] Dangerous Install Lifecycle Script Hook - Remote Code Execution Risk (CWE-78 / Command Injection)`
|
| 210 |
-
- `[HIGH] Non-Compliant SBOM - Missing Mandatory NTIA Minimum Elements (Executive Order 14028 Non-Compliance)`
|
| 211 |
-
- `[MEDIUM] Mutable Container Image Tag Reference Lacking SHA-256 Digest Pin (CWE-1104 / Use of Unmaintained Third Party Component)`
|
| 212 |
-
- `[MEDIUM] Unpinned Dependency Wildcard Version Range in Production Manifest (CWE-1104 / Unmaintained Third Party Component)`
|
| 213 |
-
- `[HIGH] Missing runAsNonRoot & Container Running as Root User (CWE-276 / Incorrect Default Permissions)`
|
| 214 |
-
- `[HIGH] Kubernetes RBAC Wildcard Permissions Allocated (CWE-269 / Improper Privilege Management)`
|
| 215 |
-
- `[HIGH] Missing Explicit Workflow Permissions - Risk of Default Write Privileges (CWE-276 / Default Permissions)`
|
| 216 |
-
- `[HIGH] Script Injection via Context Expression in Run Step (CWE-78 / Command Injection)`
|
| 217 |
-
- `[HIGH] Hardcoded Secret / Plaintext Personal Access Token Detected (CWE-798 / Hard-coded Credentials)`
|
| 218 |
- `[MEDIUM] Unpinned Third-Party Action Mutable Tag @v4 - Supply Chain Attack Risk (CWE-829 / Untrusted Control Sphere)`
|
| 219 |
- `[MEDIUM] Container Root Filesystem Writable / Missing readOnlyRootFilesystem (CWE-732 / Incorrect Permission Assignment)`
|
| 220 |
|
|
|
|
| 11 |
|
| 12 |
# 🛡️ VulnForge MCP
|
| 13 |
|
| 14 |
+
**웹·API·데이터베이스·CI/CD·컨테이너/K8s·eBPF/런타임·동적 API 퍼징·공급망 SBOM, Cosign 서명, Wasm 텔레메트리 및 마이크로세그멘테이션 취약점 종합 진단 및 방어 패치 자동 주입 MCP 서버**
|
| 15 |
|
| 16 |
[](../../LICENSE)
|
| 17 |
[](https://modelcontextprotocol.io/)
|
|
|
|
| 66 |
|
| 67 |
# 11. Direct WebAssembly eBPF & Host Telemetry Audit CLI Execution
|
| 68 |
npx vulnforge-mcp --audit-wasm-ebpf --file wasm-config.yaml
|
| 69 |
+
|
| 70 |
+
# 12. Direct eBPF Microsegmentation & Zero Trust Flow Policy Audit CLI Execution
|
| 71 |
+
npx vulnforge-mcp --audit-microsegmentation --file policies/cilium.yaml
|
| 72 |
```
|
| 73 |
|
| 74 |
### Adding to Claude Desktop / Antigravity (`claude_desktop_config.json`)
|
|
|
|
| 87 |
|
| 88 |
---
|
| 89 |
|
| 90 |
+
## 🏛️ 15대 보안 취약점 감사 기둥
|
| 91 |
|
| 92 |
<details open>
|
| 93 |
<summary><b>🏛️ View Architecture Pipeline Diagram (Click to toggle / 접기·펼치기)</b></summary>
|
|
|
|
| 113 |
| **12** | **Supply Chain & SBOM Gate** | CycloneDX/SPDX SBOM and manifest auditing, internal scope dependency confusion (CWE-427), Levenshtein typosquatting heuristics (CWE-829), unpinned wildcards (CWE-1104), dangerous install script hooks (CWE-78), mutable Git branches, missing lockfile hashes (CWE-353), and NTIA EO 14028 minimum elements | Automated `.npmrc` scoped registry injection, canonical package replacement, semantic version pinning, `ignore-scripts=true` suppression, immutable Git commit SHA pinning, and NTIA metadata enrichment |
|
| 114 |
| **13** | **Cosign & Artifact Attestation** | OCI container image signature verification, Sigstore keyless Fulcio OIDC SAN validation, Rekor transparency log inclusion proofs, In-toto SLSA provenance level verification, and Kyverno/Gatekeeper admission policy auditing | Kyverno ClusterPolicy enforcement rules (`validationFailureAction: Enforce`), OPA Gatekeeper constraints, Rekor proof mandates, and immutable SHA-256 image digest pinning |
|
| 115 |
| **14** | **Wasm & eBPF Telemetry** | WebAssembly linear memory bounds (CWE-119), WASI host root preopen exposure (CWE-284), instruction fuel/CPU DoS (CWE-400), unpinned bytecode digests (CWE-345), dropped telemetry (CWE-778), and kernel credential leakage (CWE-209) | Memory page clamps (max: 256), scoped ephemeral preopens (`/sandbox`), instruction fuel budgeting (100k), digest pins, and PII scrubbing filters |
|
| 116 |
+
| **15** | **Microsegmentation & eBPF Flow** | CiliumNetworkPolicy, K8s NetworkPolicy, Calico & eBPF kernel flow telemetry (CWE-284, CWE-923, CWE-200, CWE-276, CWE-269, CWE-319, CWE-668, CWE-778) | Automated Zero Trust ingress isolation, L7 HTTP rules, metadata endpoint blocking, and Hubble flow telemetry policy synthesis |
|
| 117 |
|
| 118 |
</details>
|
| 119 |
|
| 120 |
---
|
| 121 |
|
| 122 |
+
## 🛠️ 17대 핵심 MCP 보안 도구
|
| 123 |
|
| 124 |
<details open>
|
| 125 |
+
<summary><b>🛠️ 17대 핵심 MCP 보안 도구 (Click to toggle / 접기·펼치기)</b></summary>
|
| 126 |
<br>
|
| 127 |
|
| 128 |
+
VulnForge MCP exposes 17 specialized security audit tools to your AI agent:
|
| 129 |
|
| 130 |
1. **`vulnforge_audit_web`**:
|
| 131 |
- Analyzes HTTP response headers, cookie flags, and DOM client code.
|
|
|
|
| 173 |
- Detects unbounded linear memory growth, overprivileged WASI root preopens, missing execution fuel limits, unpinned Wasm module digests, dropped kernel telemetry without counters, plaintext credential leakage in argv, insecure shared memory state, and unconfined host root privileges.
|
| 174 |
- Correlates multi-host causal attack chains (dropper downloads, namespace unshare privesc, interactive reverse shells) and applies automated credential scrubbing.
|
| 175 |
- Parameters: `content` (string, optional raw config or manifest), `filePath` (string, optional path to file), `format` (optional string), `telemetryEvents` (optional array or JSON lines string), `strictCorrelation` (boolean, default true), `sanitizeTelemetry` (boolean, default true).
|
| 176 |
+
14. **`vulnforge_audit_microsegmentation`**:
|
| 177 |
+
- Deep inspection of CiliumNetworkPolicy, Kubernetes NetworkPolicy, Calico specifications, and eBPF kernel flow telemetry streams (Cilium Hubble / flow logs).
|
| 178 |
+
- Detects permissive ingress wildcards (CWE-284/CWE-923), unrestricted cloud metadata API access (`169.254.169.254` / CWE-200), missing default-deny isolation (CWE-276), unencrypted cross-node pod-to-pod traffic (CWE-319), permissive host namespace access (CWE-269), unrestricted egress wildcards (CWE-668), unmonitored cross-namespace flows (CWE-778), and missing L7 protocol enforcement (CWE-284).
|
| 179 |
+
- Automatically synthesizes least-privilege Cilium and Kubernetes NetworkPolicies directly from observed eBPF kernel flow telemetry events.
|
| 180 |
+
- Synthesizes automated drop-in hardening patches (default-deny rules, metadata CIDR blocks, L7 HTTP method/path filters, WireGuard annotations) with dual canary sandbox validation.
|
| 181 |
+
- Parameters: `content` (string, optional raw policy YAML text), `filePath` (string, optional path to file), `format` (optional string), `flowTelemetryStream` (optional array or JSON lines string), `strictIngress` (boolean, default true), `blockCloudMetadata` (boolean, default true).
|
| 182 |
+
15. **`vulnforge_inject_patch`**:
|
| 183 |
- Takes vulnerable code and automatically synthesizes a secure drop-in replacement with unified git diff and optional canary verification.
|
| 184 |
+
16. **`vulnforge_verify_patch`**:
|
| 185 |
- Executes isolated Canary Sandbox verification on synthesized or custom defensive patches using native Node.js `vm`.
|
| 186 |
- Runs dual-phase validation: Phase 1 evaluates attack payload containment (confirms exploit is blocked); Phase 2 evaluates benign functional input (ensures zero regression).
|
| 187 |
- Returns structured `CanaryVerificationReport` (`VERIFIED_SAFE`, `ATTACK_LEAKED`, `REGRESSION_DETECTED`, `SYNTAX_ERROR`, `SANDBOX_TIMEOUT`).
|
| 188 |
+
17. **`vulnforge_full_scan`**:
|
| 189 |
+
- Executes an end-to-end 360-degree security audit across Web, API, Database, GraphQL, CI/CD, Container/Kubernetes, eBPF, Dynamic API Fuzzing, Cloud IAM, Cryptographic Vaults, Supply Chain SBOM, Cosign Signature Attestation, WebAssembly eBPF Telemetry, and Distributed eBPF Microsegmentation layers simultaneously with automated patch synthesis and canary verification.
|
| 190 |
|
| 191 |
### 📋 Sample Vulnerability Findings & CWE Classification
|
| 192 |
+
- `[CRITICAL] Permissive Ingress Wildcard Policy - Default Ingress Allow All (CWE-284 / Improper Access Control)`
|
| 193 |
+
- `[CRITICAL] Unrestricted Cloud Metadata API Access - Missing 169.254.169.254 Egress Block (CWE-200 / Exposure of Sensitive Information)`
|
| 194 |
+
- `[HIGH] Missing Default-Deny Isolation - Permissive Pod Ingress Traffic (CWE-276 / Incorrect Default Permissions)`
|
| 195 |
+
- `[HIGH] Unencrypted Pod-to-Pod Cross-Node Network Traffic (CWE-319 / Cleartext Transmission)`
|
| 196 |
+
- `[HIGH] Permissive Host Namespace Network Access in Workload Spec (CWE-269 / Improper Privilege Management)`
|
| 197 |
- `[CRITICAL] Unbounded WebAssembly Linear Memory Bounds / Missing Heap Limit (CWE-119 / Improper Memory Buffer Restriction)`
|
| 198 |
- `[CRITICAL] Overprivileged WASI Host Filesystem Preopens / Root Directory Exposure (CWE-284 / Improper Access Control)`
|
| 199 |
- `[CRITICAL] Unsigned Container Image / Missing Cryptographic Cosign Signature (CWE-347 / Improper Verification of Cryptographic Signature)`
|
|
|
|
| 215 |
- `[HIGH] Missing Explicit Workflow Permissions - Risk of Default Write Privileges (CWE-276 / Default Permissions)`
|
| 216 |
- `[HIGH] Script Injection via Context Expression in Run Step (CWE-78 / Command Injection)`
|
| 217 |
- `[HIGH] Hardcoded Secret / Plaintext Personal Access Token Detected (CWE-798 / Hard-coded Credentials)`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 218 |
- `[MEDIUM] Unpinned Third-Party Action Mutable Tag @v4 - Supply Chain Attack Risk (CWE-829 / Untrusted Control Sphere)`
|
| 219 |
- `[MEDIUM] Container Root Filesystem Writable / Missing readOnlyRootFilesystem (CWE-732 / Incorrect Permission Assignment)`
|
| 220 |
|
docs/locales/pt-BR.md
CHANGED
|
@@ -11,7 +11,7 @@
|
|
| 11 |
|
| 12 |
# 🛡️ VulnForge MCP
|
| 13 |
|
| 14 |
-
**Servidor MCP nativo de IA para auditoria de vulnerabilidades Web, API, Banco de Dados, CI/CD, Contêineres/K8s, eBPF, Fuzzing Dinâmico de API, SBOM de Cadeia de Suprimentos, Atestação de Assinatura Cosign
|
| 15 |
|
| 16 |
[](../../LICENSE)
|
| 17 |
[](https://modelcontextprotocol.io/)
|
|
@@ -66,6 +66,9 @@ npx vulnforge-mcp --audit-cosign --file k8s/kyverno-verify.yaml
|
|
| 66 |
|
| 67 |
# 11. Direct WebAssembly eBPF & Host Telemetry Audit CLI Execution
|
| 68 |
npx vulnforge-mcp --audit-wasm-ebpf --file wasm-config.yaml
|
|
|
|
|
|
|
|
|
|
| 69 |
```
|
| 70 |
|
| 71 |
### Adding to Claude Desktop / Antigravity (`claude_desktop_config.json`)
|
|
@@ -84,7 +87,7 @@ npx vulnforge-mcp --audit-wasm-ebpf --file wasm-config.yaml
|
|
| 84 |
|
| 85 |
---
|
| 86 |
|
| 87 |
-
## 🏛️ Os
|
| 88 |
|
| 89 |
<details open>
|
| 90 |
<summary><b>🏛️ View Architecture Pipeline Diagram (Click to toggle / 접기·펼치기)</b></summary>
|
|
@@ -110,18 +113,19 @@ npx vulnforge-mcp --audit-wasm-ebpf --file wasm-config.yaml
|
|
| 110 |
| **12** | **Supply Chain & SBOM Gate** | CycloneDX/SPDX SBOM and manifest auditing, internal scope dependency confusion (CWE-427), Levenshtein typosquatting heuristics (CWE-829), unpinned wildcards (CWE-1104), dangerous install script hooks (CWE-78), mutable Git branches, missing lockfile hashes (CWE-353), and NTIA EO 14028 minimum elements | Automated `.npmrc` scoped registry injection, canonical package replacement, semantic version pinning, `ignore-scripts=true` suppression, immutable Git commit SHA pinning, and NTIA metadata enrichment |
|
| 111 |
| **13** | **Cosign & Artifact Attestation** | OCI container image signature verification, Sigstore keyless Fulcio OIDC SAN validation, Rekor transparency log inclusion proofs, In-toto SLSA provenance level verification, and Kyverno/Gatekeeper admission policy auditing | Kyverno ClusterPolicy enforcement rules (`validationFailureAction: Enforce`), OPA Gatekeeper constraints, Rekor proof mandates, and immutable SHA-256 image digest pinning |
|
| 112 |
| **14** | **Wasm & eBPF Telemetry** | WebAssembly linear memory bounds (CWE-119), WASI host root preopen exposure (CWE-284), instruction fuel/CPU DoS (CWE-400), unpinned bytecode digests (CWE-345), dropped telemetry (CWE-778), and kernel credential leakage (CWE-209) | Memory page clamps (max: 256), scoped ephemeral preopens (`/sandbox`), instruction fuel budgeting (100k), digest pins, and PII scrubbing filters |
|
|
|
|
| 113 |
|
| 114 |
</details>
|
| 115 |
|
| 116 |
---
|
| 117 |
|
| 118 |
-
## 🛠️
|
| 119 |
|
| 120 |
<details open>
|
| 121 |
-
<summary><b>🛠️
|
| 122 |
<br>
|
| 123 |
|
| 124 |
-
VulnForge MCP exposes
|
| 125 |
|
| 126 |
1. **`vulnforge_audit_web`**:
|
| 127 |
- Analyzes HTTP response headers, cookie flags, and DOM client code.
|
|
@@ -169,16 +173,27 @@ VulnForge MCP exposes 16 specialized security audit tools to your AI agent:
|
|
| 169 |
- Detects unbounded linear memory growth, overprivileged WASI root preopens, missing execution fuel limits, unpinned Wasm module digests, dropped kernel telemetry without counters, plaintext credential leakage in argv, insecure shared memory state, and unconfined host root privileges.
|
| 170 |
- Correlates multi-host causal attack chains (dropper downloads, namespace unshare privesc, interactive reverse shells) and applies automated credential scrubbing.
|
| 171 |
- Parameters: `content` (string, optional raw config or manifest), `filePath` (string, optional path to file), `format` (optional string), `telemetryEvents` (optional array or JSON lines string), `strictCorrelation` (boolean, default true), `sanitizeTelemetry` (boolean, default true).
|
| 172 |
-
14. **`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 173 |
- Takes vulnerable code and automatically synthesizes a secure drop-in replacement with unified git diff and optional canary verification.
|
| 174 |
-
|
| 175 |
- Executes isolated Canary Sandbox verification on synthesized or custom defensive patches using native Node.js `vm`.
|
| 176 |
- Runs dual-phase validation: Phase 1 evaluates attack payload containment (confirms exploit is blocked); Phase 2 evaluates benign functional input (ensures zero regression).
|
| 177 |
- Returns structured `CanaryVerificationReport` (`VERIFIED_SAFE`, `ATTACK_LEAKED`, `REGRESSION_DETECTED`, `SYNTAX_ERROR`, `SANDBOX_TIMEOUT`).
|
| 178 |
-
|
| 179 |
-
- Executes an end-to-end 360-degree security audit across Web, API, Database, GraphQL, CI/CD, Container/Kubernetes, eBPF, Dynamic API Fuzzing, Cloud IAM, Cryptographic Vaults, Supply Chain SBOM, Cosign Signature Attestation,
|
| 180 |
|
| 181 |
### 📋 Sample Vulnerability Findings & CWE Classification
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 182 |
- `[CRITICAL] Unbounded WebAssembly Linear Memory Bounds / Missing Heap Limit (CWE-119 / Improper Memory Buffer Restriction)`
|
| 183 |
- `[CRITICAL] Overprivileged WASI Host Filesystem Preopens / Root Directory Exposure (CWE-284 / Improper Access Control)`
|
| 184 |
- `[CRITICAL] Unsigned Container Image / Missing Cryptographic Cosign Signature (CWE-347 / Improper Verification of Cryptographic Signature)`
|
|
@@ -200,21 +215,6 @@ VulnForge MCP exposes 16 specialized security audit tools to your AI agent:
|
|
| 200 |
- `[HIGH] Missing Explicit Workflow Permissions - Risk of Default Write Privileges (CWE-276 / Default Permissions)`
|
| 201 |
- `[HIGH] Script Injection via Context Expression in Run Step (CWE-78 / Command Injection)`
|
| 202 |
- `[HIGH] Hardcoded Secret / Plaintext Personal Access Token Detected (CWE-798 / Hard-coded Credentials)`
|
| 203 |
-
- `[CRITICAL] Untrusted PR Checkout via pull_request_target with Head SHA (CWE-250 / Privileged Execution)`
|
| 204 |
-
- `[CRITICAL] GraphQL Introspection Enabled in Production (CWE-200 / Information Exposure)`
|
| 205 |
-
- `[CRITICAL] Dependency Confusion Vulnerability - Missing Scoped Private Registry (CWE-427 / Uncontrolled Search Path Element)`
|
| 206 |
-
- `[HIGH] Keyless Attestation SAN Identity Mismatch / Untrusted OIDC Issuer (CWE-295 / Improper Certificate Validation)`
|
| 207 |
-
- `[HIGH] Missing Rekor Transparency Log Inclusion Proof - Rollback Vulnerability (CWE-353 / Missing Support for Integrity Check)`
|
| 208 |
-
- `[HIGH] Typosquatting Package Vector Detected: Possible Impersonation of Canonical Library (CWE-829 / Untrusted Control Sphere)`
|
| 209 |
-
- `[HIGH] Dangerous Install Lifecycle Script Hook - Remote Code Execution Risk (CWE-78 / Command Injection)`
|
| 210 |
-
- `[HIGH] Non-Compliant SBOM - Missing Mandatory NTIA Minimum Elements (Executive Order 14028 Non-Compliance)`
|
| 211 |
-
- `[MEDIUM] Mutable Container Image Tag Reference Lacking SHA-256 Digest Pin (CWE-1104 / Use of Unmaintained Third Party Component)`
|
| 212 |
-
- `[MEDIUM] Unpinned Dependency Wildcard Version Range in Production Manifest (CWE-1104 / Unmaintained Third Party Component)`
|
| 213 |
-
- `[HIGH] Missing runAsNonRoot & Container Running as Root User (CWE-276 / Incorrect Default Permissions)`
|
| 214 |
-
- `[HIGH] Kubernetes RBAC Wildcard Permissions Allocated (CWE-269 / Improper Privilege Management)`
|
| 215 |
-
- `[HIGH] Missing Explicit Workflow Permissions - Risk of Default Write Privileges (CWE-276 / Default Permissions)`
|
| 216 |
-
- `[HIGH] Script Injection via Context Expression in Run Step (CWE-78 / Command Injection)`
|
| 217 |
-
- `[HIGH] Hardcoded Secret / Plaintext Personal Access Token Detected (CWE-798 / Hard-coded Credentials)`
|
| 218 |
- `[MEDIUM] Unpinned Third-Party Action Mutable Tag @v4 - Supply Chain Attack Risk (CWE-829 / Untrusted Control Sphere)`
|
| 219 |
- `[MEDIUM] Container Root Filesystem Writable / Missing readOnlyRootFilesystem (CWE-732 / Incorrect Permission Assignment)`
|
| 220 |
|
|
|
|
| 11 |
|
| 12 |
# 🛡️ VulnForge MCP
|
| 13 |
|
| 14 |
+
**Servidor MCP nativo de IA para auditoria de vulnerabilidades Web, API, Banco de Dados, CI/CD, Contêineres/K8s, eBPF, Fuzzing Dinâmico de API, SBOM de Cadeia de Suprimentos, Atestação de Assinatura Cosign, Telemetria Wasm e Microssegmentação com injeção automática de patches**
|
| 15 |
|
| 16 |
[](../../LICENSE)
|
| 17 |
[](https://modelcontextprotocol.io/)
|
|
|
|
| 66 |
|
| 67 |
# 11. Direct WebAssembly eBPF & Host Telemetry Audit CLI Execution
|
| 68 |
npx vulnforge-mcp --audit-wasm-ebpf --file wasm-config.yaml
|
| 69 |
+
|
| 70 |
+
# 12. Direct eBPF Microsegmentation & Zero Trust Flow Policy Audit CLI Execution
|
| 71 |
+
npx vulnforge-mcp --audit-microsegmentation --file policies/cilium.yaml
|
| 72 |
```
|
| 73 |
|
| 74 |
### Adding to Claude Desktop / Antigravity (`claude_desktop_config.json`)
|
|
|
|
| 87 |
|
| 88 |
---
|
| 89 |
|
| 90 |
+
## 🏛️ Os 15 pilares de auditoria de vulnerabilidades
|
| 91 |
|
| 92 |
<details open>
|
| 93 |
<summary><b>🏛️ View Architecture Pipeline Diagram (Click to toggle / 접기·펼치기)</b></summary>
|
|
|
|
| 113 |
| **12** | **Supply Chain & SBOM Gate** | CycloneDX/SPDX SBOM and manifest auditing, internal scope dependency confusion (CWE-427), Levenshtein typosquatting heuristics (CWE-829), unpinned wildcards (CWE-1104), dangerous install script hooks (CWE-78), mutable Git branches, missing lockfile hashes (CWE-353), and NTIA EO 14028 minimum elements | Automated `.npmrc` scoped registry injection, canonical package replacement, semantic version pinning, `ignore-scripts=true` suppression, immutable Git commit SHA pinning, and NTIA metadata enrichment |
|
| 114 |
| **13** | **Cosign & Artifact Attestation** | OCI container image signature verification, Sigstore keyless Fulcio OIDC SAN validation, Rekor transparency log inclusion proofs, In-toto SLSA provenance level verification, and Kyverno/Gatekeeper admission policy auditing | Kyverno ClusterPolicy enforcement rules (`validationFailureAction: Enforce`), OPA Gatekeeper constraints, Rekor proof mandates, and immutable SHA-256 image digest pinning |
|
| 115 |
| **14** | **Wasm & eBPF Telemetry** | WebAssembly linear memory bounds (CWE-119), WASI host root preopen exposure (CWE-284), instruction fuel/CPU DoS (CWE-400), unpinned bytecode digests (CWE-345), dropped telemetry (CWE-778), and kernel credential leakage (CWE-209) | Memory page clamps (max: 256), scoped ephemeral preopens (`/sandbox`), instruction fuel budgeting (100k), digest pins, and PII scrubbing filters |
|
| 116 |
+
| **15** | **Microsegmentation & eBPF Flow** | CiliumNetworkPolicy, K8s NetworkPolicy, Calico & eBPF kernel flow telemetry (CWE-284, CWE-923, CWE-200, CWE-276, CWE-269, CWE-319, CWE-668, CWE-778) | Automated Zero Trust ingress isolation, L7 HTTP rules, metadata endpoint blocking, and Hubble flow telemetry policy synthesis |
|
| 117 |
|
| 118 |
</details>
|
| 119 |
|
| 120 |
---
|
| 121 |
|
| 122 |
+
## 🛠️ 17 ferramentas de segurança MCP essenciais
|
| 123 |
|
| 124 |
<details open>
|
| 125 |
+
<summary><b>🛠️ 17 ferramentas de segurança MCP essenciais (Click to toggle / 접기·펼치기)</b></summary>
|
| 126 |
<br>
|
| 127 |
|
| 128 |
+
VulnForge MCP exposes 17 specialized security audit tools to your AI agent:
|
| 129 |
|
| 130 |
1. **`vulnforge_audit_web`**:
|
| 131 |
- Analyzes HTTP response headers, cookie flags, and DOM client code.
|
|
|
|
| 173 |
- Detects unbounded linear memory growth, overprivileged WASI root preopens, missing execution fuel limits, unpinned Wasm module digests, dropped kernel telemetry without counters, plaintext credential leakage in argv, insecure shared memory state, and unconfined host root privileges.
|
| 174 |
- Correlates multi-host causal attack chains (dropper downloads, namespace unshare privesc, interactive reverse shells) and applies automated credential scrubbing.
|
| 175 |
- Parameters: `content` (string, optional raw config or manifest), `filePath` (string, optional path to file), `format` (optional string), `telemetryEvents` (optional array or JSON lines string), `strictCorrelation` (boolean, default true), `sanitizeTelemetry` (boolean, default true).
|
| 176 |
+
14. **`vulnforge_audit_microsegmentation`**:
|
| 177 |
+
- Deep inspection of CiliumNetworkPolicy, Kubernetes NetworkPolicy, Calico specifications, and eBPF kernel flow telemetry streams (Cilium Hubble / flow logs).
|
| 178 |
+
- Detects permissive ingress wildcards (CWE-284/CWE-923), unrestricted cloud metadata API access (`169.254.169.254` / CWE-200), missing default-deny isolation (CWE-276), unencrypted cross-node pod-to-pod traffic (CWE-319), permissive host namespace access (CWE-269), unrestricted egress wildcards (CWE-668), unmonitored cross-namespace flows (CWE-778), and missing L7 protocol enforcement (CWE-284).
|
| 179 |
+
- Automatically synthesizes least-privilege Cilium and Kubernetes NetworkPolicies directly from observed eBPF kernel flow telemetry events.
|
| 180 |
+
- Synthesizes automated drop-in hardening patches (default-deny rules, metadata CIDR blocks, L7 HTTP method/path filters, WireGuard annotations) with dual canary sandbox validation.
|
| 181 |
+
- Parameters: `content` (string, optional raw policy YAML text), `filePath` (string, optional path to file), `format` (optional string), `flowTelemetryStream` (optional array or JSON lines string), `strictIngress` (boolean, default true), `blockCloudMetadata` (boolean, default true).
|
| 182 |
+
15. **`vulnforge_inject_patch`**:
|
| 183 |
- Takes vulnerable code and automatically synthesizes a secure drop-in replacement with unified git diff and optional canary verification.
|
| 184 |
+
16. **`vulnforge_verify_patch`**:
|
| 185 |
- Executes isolated Canary Sandbox verification on synthesized or custom defensive patches using native Node.js `vm`.
|
| 186 |
- Runs dual-phase validation: Phase 1 evaluates attack payload containment (confirms exploit is blocked); Phase 2 evaluates benign functional input (ensures zero regression).
|
| 187 |
- Returns structured `CanaryVerificationReport` (`VERIFIED_SAFE`, `ATTACK_LEAKED`, `REGRESSION_DETECTED`, `SYNTAX_ERROR`, `SANDBOX_TIMEOUT`).
|
| 188 |
+
17. **`vulnforge_full_scan`**:
|
| 189 |
+
- Executes an end-to-end 360-degree security audit across Web, API, Database, GraphQL, CI/CD, Container/Kubernetes, eBPF, Dynamic API Fuzzing, Cloud IAM, Cryptographic Vaults, Supply Chain SBOM, Cosign Signature Attestation, WebAssembly eBPF Telemetry, and Distributed eBPF Microsegmentation layers simultaneously with automated patch synthesis and canary verification.
|
| 190 |
|
| 191 |
### 📋 Sample Vulnerability Findings & CWE Classification
|
| 192 |
+
- `[CRITICAL] Permissive Ingress Wildcard Policy - Default Ingress Allow All (CWE-284 / Improper Access Control)`
|
| 193 |
+
- `[CRITICAL] Unrestricted Cloud Metadata API Access - Missing 169.254.169.254 Egress Block (CWE-200 / Exposure of Sensitive Information)`
|
| 194 |
+
- `[HIGH] Missing Default-Deny Isolation - Permissive Pod Ingress Traffic (CWE-276 / Incorrect Default Permissions)`
|
| 195 |
+
- `[HIGH] Unencrypted Pod-to-Pod Cross-Node Network Traffic (CWE-319 / Cleartext Transmission)`
|
| 196 |
+
- `[HIGH] Permissive Host Namespace Network Access in Workload Spec (CWE-269 / Improper Privilege Management)`
|
| 197 |
- `[CRITICAL] Unbounded WebAssembly Linear Memory Bounds / Missing Heap Limit (CWE-119 / Improper Memory Buffer Restriction)`
|
| 198 |
- `[CRITICAL] Overprivileged WASI Host Filesystem Preopens / Root Directory Exposure (CWE-284 / Improper Access Control)`
|
| 199 |
- `[CRITICAL] Unsigned Container Image / Missing Cryptographic Cosign Signature (CWE-347 / Improper Verification of Cryptographic Signature)`
|
|
|
|
| 215 |
- `[HIGH] Missing Explicit Workflow Permissions - Risk of Default Write Privileges (CWE-276 / Default Permissions)`
|
| 216 |
- `[HIGH] Script Injection via Context Expression in Run Step (CWE-78 / Command Injection)`
|
| 217 |
- `[HIGH] Hardcoded Secret / Plaintext Personal Access Token Detected (CWE-798 / Hard-coded Credentials)`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 218 |
- `[MEDIUM] Unpinned Third-Party Action Mutable Tag @v4 - Supply Chain Attack Risk (CWE-829 / Untrusted Control Sphere)`
|
| 219 |
- `[MEDIUM] Container Root Filesystem Writable / Missing readOnlyRootFilesystem (CWE-732 / Incorrect Permission Assignment)`
|
| 220 |
|
docs/locales/ru.md
CHANGED
|
@@ -11,7 +11,7 @@
|
|
| 11 |
|
| 12 |
# 🛡️ VulnForge MCP
|
| 13 |
|
| 14 |
-
**Универсальный ИИ-сервер MCP для аудита уязвимостей Web, API, баз данных, CI/CD, контейнеров/K8s, eBPF, динамического фаззинга API, SBOM цепочки поставок, аттестации подписей Cosign
|
| 15 |
|
| 16 |
[](../../LICENSE)
|
| 17 |
[](https://modelcontextprotocol.io/)
|
|
@@ -66,6 +66,9 @@ npx vulnforge-mcp --audit-cosign --file k8s/kyverno-verify.yaml
|
|
| 66 |
|
| 67 |
# 11. Direct WebAssembly eBPF & Host Telemetry Audit CLI Execution
|
| 68 |
npx vulnforge-mcp --audit-wasm-ebpf --file wasm-config.yaml
|
|
|
|
|
|
|
|
|
|
| 69 |
```
|
| 70 |
|
| 71 |
### Adding to Claude Desktop / Antigravity (`claude_desktop_config.json`)
|
|
@@ -84,7 +87,7 @@ npx vulnforge-mcp --audit-wasm-ebpf --file wasm-config.yaml
|
|
| 84 |
|
| 85 |
---
|
| 86 |
|
| 87 |
-
## 🏛️
|
| 88 |
|
| 89 |
<details open>
|
| 90 |
<summary><b>🏛️ View Architecture Pipeline Diagram (Click to toggle / 접기·펼치기)</b></summary>
|
|
@@ -110,18 +113,19 @@ npx vulnforge-mcp --audit-wasm-ebpf --file wasm-config.yaml
|
|
| 110 |
| **12** | **Supply Chain & SBOM Gate** | CycloneDX/SPDX SBOM and manifest auditing, internal scope dependency confusion (CWE-427), Levenshtein typosquatting heuristics (CWE-829), unpinned wildcards (CWE-1104), dangerous install script hooks (CWE-78), mutable Git branches, missing lockfile hashes (CWE-353), and NTIA EO 14028 minimum elements | Automated `.npmrc` scoped registry injection, canonical package replacement, semantic version pinning, `ignore-scripts=true` suppression, immutable Git commit SHA pinning, and NTIA metadata enrichment |
|
| 111 |
| **13** | **Cosign & Artifact Attestation** | OCI container image signature verification, Sigstore keyless Fulcio OIDC SAN validation, Rekor transparency log inclusion proofs, In-toto SLSA provenance level verification, and Kyverno/Gatekeeper admission policy auditing | Kyverno ClusterPolicy enforcement rules (`validationFailureAction: Enforce`), OPA Gatekeeper constraints, Rekor proof mandates, and immutable SHA-256 image digest pinning |
|
| 112 |
| **14** | **Wasm & eBPF Telemetry** | WebAssembly linear memory bounds (CWE-119), WASI host root preopen exposure (CWE-284), instruction fuel/CPU DoS (CWE-400), unpinned bytecode digests (CWE-345), dropped telemetry (CWE-778), and kernel credential leakage (CWE-209) | Memory page clamps (max: 256), scoped ephemeral preopens (`/sandbox`), instruction fuel budgeting (100k), digest pins, and PII scrubbing filters |
|
|
|
|
| 113 |
|
| 114 |
</details>
|
| 115 |
|
| 116 |
---
|
| 117 |
|
| 118 |
-
## 🛠️
|
| 119 |
|
| 120 |
<details open>
|
| 121 |
-
<summary><b>🛠️
|
| 122 |
<br>
|
| 123 |
|
| 124 |
-
VulnForge MCP exposes
|
| 125 |
|
| 126 |
1. **`vulnforge_audit_web`**:
|
| 127 |
- Analyzes HTTP response headers, cookie flags, and DOM client code.
|
|
@@ -169,16 +173,27 @@ VulnForge MCP exposes 16 specialized security audit tools to your AI agent:
|
|
| 169 |
- Detects unbounded linear memory growth, overprivileged WASI root preopens, missing execution fuel limits, unpinned Wasm module digests, dropped kernel telemetry without counters, plaintext credential leakage in argv, insecure shared memory state, and unconfined host root privileges.
|
| 170 |
- Correlates multi-host causal attack chains (dropper downloads, namespace unshare privesc, interactive reverse shells) and applies automated credential scrubbing.
|
| 171 |
- Parameters: `content` (string, optional raw config or manifest), `filePath` (string, optional path to file), `format` (optional string), `telemetryEvents` (optional array or JSON lines string), `strictCorrelation` (boolean, default true), `sanitizeTelemetry` (boolean, default true).
|
| 172 |
-
14. **`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 173 |
- Takes vulnerable code and automatically synthesizes a secure drop-in replacement with unified git diff and optional canary verification.
|
| 174 |
-
|
| 175 |
- Executes isolated Canary Sandbox verification on synthesized or custom defensive patches using native Node.js `vm`.
|
| 176 |
- Runs dual-phase validation: Phase 1 evaluates attack payload containment (confirms exploit is blocked); Phase 2 evaluates benign functional input (ensures zero regression).
|
| 177 |
- Returns structured `CanaryVerificationReport` (`VERIFIED_SAFE`, `ATTACK_LEAKED`, `REGRESSION_DETECTED`, `SYNTAX_ERROR`, `SANDBOX_TIMEOUT`).
|
| 178 |
-
|
| 179 |
-
- Executes an end-to-end 360-degree security audit across Web, API, Database, GraphQL, CI/CD, Container/Kubernetes, eBPF, Dynamic API Fuzzing, Cloud IAM, Cryptographic Vaults, Supply Chain SBOM, Cosign Signature Attestation,
|
| 180 |
|
| 181 |
### 📋 Sample Vulnerability Findings & CWE Classification
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 182 |
- `[CRITICAL] Unbounded WebAssembly Linear Memory Bounds / Missing Heap Limit (CWE-119 / Improper Memory Buffer Restriction)`
|
| 183 |
- `[CRITICAL] Overprivileged WASI Host Filesystem Preopens / Root Directory Exposure (CWE-284 / Improper Access Control)`
|
| 184 |
- `[CRITICAL] Unsigned Container Image / Missing Cryptographic Cosign Signature (CWE-347 / Improper Verification of Cryptographic Signature)`
|
|
@@ -200,21 +215,6 @@ VulnForge MCP exposes 16 specialized security audit tools to your AI agent:
|
|
| 200 |
- `[HIGH] Missing Explicit Workflow Permissions - Risk of Default Write Privileges (CWE-276 / Default Permissions)`
|
| 201 |
- `[HIGH] Script Injection via Context Expression in Run Step (CWE-78 / Command Injection)`
|
| 202 |
- `[HIGH] Hardcoded Secret / Plaintext Personal Access Token Detected (CWE-798 / Hard-coded Credentials)`
|
| 203 |
-
- `[CRITICAL] Untrusted PR Checkout via pull_request_target with Head SHA (CWE-250 / Privileged Execution)`
|
| 204 |
-
- `[CRITICAL] GraphQL Introspection Enabled in Production (CWE-200 / Information Exposure)`
|
| 205 |
-
- `[CRITICAL] Dependency Confusion Vulnerability - Missing Scoped Private Registry (CWE-427 / Uncontrolled Search Path Element)`
|
| 206 |
-
- `[HIGH] Keyless Attestation SAN Identity Mismatch / Untrusted OIDC Issuer (CWE-295 / Improper Certificate Validation)`
|
| 207 |
-
- `[HIGH] Missing Rekor Transparency Log Inclusion Proof - Rollback Vulnerability (CWE-353 / Missing Support for Integrity Check)`
|
| 208 |
-
- `[HIGH] Typosquatting Package Vector Detected: Possible Impersonation of Canonical Library (CWE-829 / Untrusted Control Sphere)`
|
| 209 |
-
- `[HIGH] Dangerous Install Lifecycle Script Hook - Remote Code Execution Risk (CWE-78 / Command Injection)`
|
| 210 |
-
- `[HIGH] Non-Compliant SBOM - Missing Mandatory NTIA Minimum Elements (Executive Order 14028 Non-Compliance)`
|
| 211 |
-
- `[MEDIUM] Mutable Container Image Tag Reference Lacking SHA-256 Digest Pin (CWE-1104 / Use of Unmaintained Third Party Component)`
|
| 212 |
-
- `[MEDIUM] Unpinned Dependency Wildcard Version Range in Production Manifest (CWE-1104 / Unmaintained Third Party Component)`
|
| 213 |
-
- `[HIGH] Missing runAsNonRoot & Container Running as Root User (CWE-276 / Incorrect Default Permissions)`
|
| 214 |
-
- `[HIGH] Kubernetes RBAC Wildcard Permissions Allocated (CWE-269 / Improper Privilege Management)`
|
| 215 |
-
- `[HIGH] Missing Explicit Workflow Permissions - Risk of Default Write Privileges (CWE-276 / Default Permissions)`
|
| 216 |
-
- `[HIGH] Script Injection via Context Expression in Run Step (CWE-78 / Command Injection)`
|
| 217 |
-
- `[HIGH] Hardcoded Secret / Plaintext Personal Access Token Detected (CWE-798 / Hard-coded Credentials)`
|
| 218 |
- `[MEDIUM] Unpinned Third-Party Action Mutable Tag @v4 - Supply Chain Attack Risk (CWE-829 / Untrusted Control Sphere)`
|
| 219 |
- `[MEDIUM] Container Root Filesystem Writable / Missing readOnlyRootFilesystem (CWE-732 / Incorrect Permission Assignment)`
|
| 220 |
|
|
|
|
| 11 |
|
| 12 |
# 🛡️ VulnForge MCP
|
| 13 |
|
| 14 |
+
**Универсальный ИИ-сервер MCP для аудита уязвимостей Web, API, баз данных, CI/CD, контейнеров/K8s, eBPF, динамического фаззинга API, SBOM цепочки поставок, аттестации подписей Cosign, телеметрии Wasm и микросегментации с автоматической инъекцией патчей**
|
| 15 |
|
| 16 |
[](../../LICENSE)
|
| 17 |
[](https://modelcontextprotocol.io/)
|
|
|
|
| 66 |
|
| 67 |
# 11. Direct WebAssembly eBPF & Host Telemetry Audit CLI Execution
|
| 68 |
npx vulnforge-mcp --audit-wasm-ebpf --file wasm-config.yaml
|
| 69 |
+
|
| 70 |
+
# 12. Direct eBPF Microsegmentation & Zero Trust Flow Policy Audit CLI Execution
|
| 71 |
+
npx vulnforge-mcp --audit-microsegmentation --file policies/cilium.yaml
|
| 72 |
```
|
| 73 |
|
| 74 |
### Adding to Claude Desktop / Antigravity (`claude_desktop_config.json`)
|
|
|
|
| 87 |
|
| 88 |
---
|
| 89 |
|
| 90 |
+
## 🏛️ 15 столпов аудита уязвимостей
|
| 91 |
|
| 92 |
<details open>
|
| 93 |
<summary><b>🏛️ View Architecture Pipeline Diagram (Click to toggle / 접기·펼치기)</b></summary>
|
|
|
|
| 113 |
| **12** | **Supply Chain & SBOM Gate** | CycloneDX/SPDX SBOM and manifest auditing, internal scope dependency confusion (CWE-427), Levenshtein typosquatting heuristics (CWE-829), unpinned wildcards (CWE-1104), dangerous install script hooks (CWE-78), mutable Git branches, missing lockfile hashes (CWE-353), and NTIA EO 14028 minimum elements | Automated `.npmrc` scoped registry injection, canonical package replacement, semantic version pinning, `ignore-scripts=true` suppression, immutable Git commit SHA pinning, and NTIA metadata enrichment |
|
| 114 |
| **13** | **Cosign & Artifact Attestation** | OCI container image signature verification, Sigstore keyless Fulcio OIDC SAN validation, Rekor transparency log inclusion proofs, In-toto SLSA provenance level verification, and Kyverno/Gatekeeper admission policy auditing | Kyverno ClusterPolicy enforcement rules (`validationFailureAction: Enforce`), OPA Gatekeeper constraints, Rekor proof mandates, and immutable SHA-256 image digest pinning |
|
| 115 |
| **14** | **Wasm & eBPF Telemetry** | WebAssembly linear memory bounds (CWE-119), WASI host root preopen exposure (CWE-284), instruction fuel/CPU DoS (CWE-400), unpinned bytecode digests (CWE-345), dropped telemetry (CWE-778), and kernel credential leakage (CWE-209) | Memory page clamps (max: 256), scoped ephemeral preopens (`/sandbox`), instruction fuel budgeting (100k), digest pins, and PII scrubbing filters |
|
| 116 |
+
| **15** | **Microsegmentation & eBPF Flow** | CiliumNetworkPolicy, K8s NetworkPolicy, Calico & eBPF kernel flow telemetry (CWE-284, CWE-923, CWE-200, CWE-276, CWE-269, CWE-319, CWE-668, CWE-778) | Automated Zero Trust ingress isolation, L7 HTTP rules, metadata endpoint blocking, and Hubble flow telemetry policy synthesis |
|
| 117 |
|
| 118 |
</details>
|
| 119 |
|
| 120 |
---
|
| 121 |
|
| 122 |
+
## 🛠️ 17 ключевых инструментов безопасности MCP
|
| 123 |
|
| 124 |
<details open>
|
| 125 |
+
<summary><b>🛠️ 17 ключевых инструментов безопасности MCP (Click to toggle / 접기·펼치기)</b></summary>
|
| 126 |
<br>
|
| 127 |
|
| 128 |
+
VulnForge MCP exposes 17 specialized security audit tools to your AI agent:
|
| 129 |
|
| 130 |
1. **`vulnforge_audit_web`**:
|
| 131 |
- Analyzes HTTP response headers, cookie flags, and DOM client code.
|
|
|
|
| 173 |
- Detects unbounded linear memory growth, overprivileged WASI root preopens, missing execution fuel limits, unpinned Wasm module digests, dropped kernel telemetry without counters, plaintext credential leakage in argv, insecure shared memory state, and unconfined host root privileges.
|
| 174 |
- Correlates multi-host causal attack chains (dropper downloads, namespace unshare privesc, interactive reverse shells) and applies automated credential scrubbing.
|
| 175 |
- Parameters: `content` (string, optional raw config or manifest), `filePath` (string, optional path to file), `format` (optional string), `telemetryEvents` (optional array or JSON lines string), `strictCorrelation` (boolean, default true), `sanitizeTelemetry` (boolean, default true).
|
| 176 |
+
14. **`vulnforge_audit_microsegmentation`**:
|
| 177 |
+
- Deep inspection of CiliumNetworkPolicy, Kubernetes NetworkPolicy, Calico specifications, and eBPF kernel flow telemetry streams (Cilium Hubble / flow logs).
|
| 178 |
+
- Detects permissive ingress wildcards (CWE-284/CWE-923), unrestricted cloud metadata API access (`169.254.169.254` / CWE-200), missing default-deny isolation (CWE-276), unencrypted cross-node pod-to-pod traffic (CWE-319), permissive host namespace access (CWE-269), unrestricted egress wildcards (CWE-668), unmonitored cross-namespace flows (CWE-778), and missing L7 protocol enforcement (CWE-284).
|
| 179 |
+
- Automatically synthesizes least-privilege Cilium and Kubernetes NetworkPolicies directly from observed eBPF kernel flow telemetry events.
|
| 180 |
+
- Synthesizes automated drop-in hardening patches (default-deny rules, metadata CIDR blocks, L7 HTTP method/path filters, WireGuard annotations) with dual canary sandbox validation.
|
| 181 |
+
- Parameters: `content` (string, optional raw policy YAML text), `filePath` (string, optional path to file), `format` (optional string), `flowTelemetryStream` (optional array or JSON lines string), `strictIngress` (boolean, default true), `blockCloudMetadata` (boolean, default true).
|
| 182 |
+
15. **`vulnforge_inject_patch`**:
|
| 183 |
- Takes vulnerable code and automatically synthesizes a secure drop-in replacement with unified git diff and optional canary verification.
|
| 184 |
+
16. **`vulnforge_verify_patch`**:
|
| 185 |
- Executes isolated Canary Sandbox verification on synthesized or custom defensive patches using native Node.js `vm`.
|
| 186 |
- Runs dual-phase validation: Phase 1 evaluates attack payload containment (confirms exploit is blocked); Phase 2 evaluates benign functional input (ensures zero regression).
|
| 187 |
- Returns structured `CanaryVerificationReport` (`VERIFIED_SAFE`, `ATTACK_LEAKED`, `REGRESSION_DETECTED`, `SYNTAX_ERROR`, `SANDBOX_TIMEOUT`).
|
| 188 |
+
17. **`vulnforge_full_scan`**:
|
| 189 |
+
- Executes an end-to-end 360-degree security audit across Web, API, Database, GraphQL, CI/CD, Container/Kubernetes, eBPF, Dynamic API Fuzzing, Cloud IAM, Cryptographic Vaults, Supply Chain SBOM, Cosign Signature Attestation, WebAssembly eBPF Telemetry, and Distributed eBPF Microsegmentation layers simultaneously with automated patch synthesis and canary verification.
|
| 190 |
|
| 191 |
### 📋 Sample Vulnerability Findings & CWE Classification
|
| 192 |
+
- `[CRITICAL] Permissive Ingress Wildcard Policy - Default Ingress Allow All (CWE-284 / Improper Access Control)`
|
| 193 |
+
- `[CRITICAL] Unrestricted Cloud Metadata API Access - Missing 169.254.169.254 Egress Block (CWE-200 / Exposure of Sensitive Information)`
|
| 194 |
+
- `[HIGH] Missing Default-Deny Isolation - Permissive Pod Ingress Traffic (CWE-276 / Incorrect Default Permissions)`
|
| 195 |
+
- `[HIGH] Unencrypted Pod-to-Pod Cross-Node Network Traffic (CWE-319 / Cleartext Transmission)`
|
| 196 |
+
- `[HIGH] Permissive Host Namespace Network Access in Workload Spec (CWE-269 / Improper Privilege Management)`
|
| 197 |
- `[CRITICAL] Unbounded WebAssembly Linear Memory Bounds / Missing Heap Limit (CWE-119 / Improper Memory Buffer Restriction)`
|
| 198 |
- `[CRITICAL] Overprivileged WASI Host Filesystem Preopens / Root Directory Exposure (CWE-284 / Improper Access Control)`
|
| 199 |
- `[CRITICAL] Unsigned Container Image / Missing Cryptographic Cosign Signature (CWE-347 / Improper Verification of Cryptographic Signature)`
|
|
|
|
| 215 |
- `[HIGH] Missing Explicit Workflow Permissions - Risk of Default Write Privileges (CWE-276 / Default Permissions)`
|
| 216 |
- `[HIGH] Script Injection via Context Expression in Run Step (CWE-78 / Command Injection)`
|
| 217 |
- `[HIGH] Hardcoded Secret / Plaintext Personal Access Token Detected (CWE-798 / Hard-coded Credentials)`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 218 |
- `[MEDIUM] Unpinned Third-Party Action Mutable Tag @v4 - Supply Chain Attack Risk (CWE-829 / Untrusted Control Sphere)`
|
| 219 |
- `[MEDIUM] Container Root Filesystem Writable / Missing readOnlyRootFilesystem (CWE-732 / Incorrect Permission Assignment)`
|
| 220 |
|
docs/locales/zh-CN.md
CHANGED
|
@@ -11,7 +11,7 @@
|
|
| 11 |
|
| 12 |
# 🛡️ VulnForge MCP
|
| 13 |
|
| 14 |
-
**通用AI原生Web、API、数据库、CI/CD、容器/K8s、eBPF、动态API模糊测试、供应链SBOM、Cosign签名
|
| 15 |
|
| 16 |
[](../../LICENSE)
|
| 17 |
[](https://modelcontextprotocol.io/)
|
|
@@ -66,6 +66,9 @@ npx vulnforge-mcp --audit-cosign --file k8s/kyverno-verify.yaml
|
|
| 66 |
|
| 67 |
# 11. Direct WebAssembly eBPF & Host Telemetry Audit CLI Execution
|
| 68 |
npx vulnforge-mcp --audit-wasm-ebpf --file wasm-config.yaml
|
|
|
|
|
|
|
|
|
|
| 69 |
```
|
| 70 |
|
| 71 |
### Adding to Claude Desktop / Antigravity (`claude_desktop_config.json`)
|
|
@@ -84,7 +87,7 @@ npx vulnforge-mcp --audit-wasm-ebpf --file wasm-config.yaml
|
|
| 84 |
|
| 85 |
---
|
| 86 |
|
| 87 |
-
## 🏛️
|
| 88 |
|
| 89 |
<details open>
|
| 90 |
<summary><b>🏛️ View Architecture Pipeline Diagram (Click to toggle / 접기·펼치기)</b></summary>
|
|
@@ -110,18 +113,19 @@ npx vulnforge-mcp --audit-wasm-ebpf --file wasm-config.yaml
|
|
| 110 |
| **12** | **Supply Chain & SBOM Gate** | CycloneDX/SPDX SBOM and manifest auditing, internal scope dependency confusion (CWE-427), Levenshtein typosquatting heuristics (CWE-829), unpinned wildcards (CWE-1104), dangerous install script hooks (CWE-78), mutable Git branches, missing lockfile hashes (CWE-353), and NTIA EO 14028 minimum elements | Automated `.npmrc` scoped registry injection, canonical package replacement, semantic version pinning, `ignore-scripts=true` suppression, immutable Git commit SHA pinning, and NTIA metadata enrichment |
|
| 111 |
| **13** | **Cosign & Artifact Attestation** | OCI container image signature verification, Sigstore keyless Fulcio OIDC SAN validation, Rekor transparency log inclusion proofs, In-toto SLSA provenance level verification, and Kyverno/Gatekeeper admission policy auditing | Kyverno ClusterPolicy enforcement rules (`validationFailureAction: Enforce`), OPA Gatekeeper constraints, Rekor proof mandates, and immutable SHA-256 image digest pinning |
|
| 112 |
| **14** | **Wasm & eBPF Telemetry** | WebAssembly linear memory bounds (CWE-119), WASI host root preopen exposure (CWE-284), instruction fuel/CPU DoS (CWE-400), unpinned bytecode digests (CWE-345), dropped telemetry (CWE-778), and kernel credential leakage (CWE-209) | Memory page clamps (max: 256), scoped ephemeral preopens (`/sandbox`), instruction fuel budgeting (100k), digest pins, and PII scrubbing filters |
|
|
|
|
| 113 |
|
| 114 |
</details>
|
| 115 |
|
| 116 |
---
|
| 117 |
|
| 118 |
-
## 🛠️
|
| 119 |
|
| 120 |
<details open>
|
| 121 |
-
<summary><b>🛠️
|
| 122 |
<br>
|
| 123 |
|
| 124 |
-
VulnForge MCP exposes
|
| 125 |
|
| 126 |
1. **`vulnforge_audit_web`**:
|
| 127 |
- Analyzes HTTP response headers, cookie flags, and DOM client code.
|
|
@@ -169,16 +173,27 @@ VulnForge MCP exposes 16 specialized security audit tools to your AI agent:
|
|
| 169 |
- Detects unbounded linear memory growth, overprivileged WASI root preopens, missing execution fuel limits, unpinned Wasm module digests, dropped kernel telemetry without counters, plaintext credential leakage in argv, insecure shared memory state, and unconfined host root privileges.
|
| 170 |
- Correlates multi-host causal attack chains (dropper downloads, namespace unshare privesc, interactive reverse shells) and applies automated credential scrubbing.
|
| 171 |
- Parameters: `content` (string, optional raw config or manifest), `filePath` (string, optional path to file), `format` (optional string), `telemetryEvents` (optional array or JSON lines string), `strictCorrelation` (boolean, default true), `sanitizeTelemetry` (boolean, default true).
|
| 172 |
-
14. **`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 173 |
- Takes vulnerable code and automatically synthesizes a secure drop-in replacement with unified git diff and optional canary verification.
|
| 174 |
-
|
| 175 |
- Executes isolated Canary Sandbox verification on synthesized or custom defensive patches using native Node.js `vm`.
|
| 176 |
- Runs dual-phase validation: Phase 1 evaluates attack payload containment (confirms exploit is blocked); Phase 2 evaluates benign functional input (ensures zero regression).
|
| 177 |
- Returns structured `CanaryVerificationReport` (`VERIFIED_SAFE`, `ATTACK_LEAKED`, `REGRESSION_DETECTED`, `SYNTAX_ERROR`, `SANDBOX_TIMEOUT`).
|
| 178 |
-
|
| 179 |
-
- Executes an end-to-end 360-degree security audit across Web, API, Database, GraphQL, CI/CD, Container/Kubernetes, eBPF, Dynamic API Fuzzing, Cloud IAM, Cryptographic Vaults, Supply Chain SBOM, Cosign Signature Attestation,
|
| 180 |
|
| 181 |
### 📋 Sample Vulnerability Findings & CWE Classification
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 182 |
- `[CRITICAL] Unbounded WebAssembly Linear Memory Bounds / Missing Heap Limit (CWE-119 / Improper Memory Buffer Restriction)`
|
| 183 |
- `[CRITICAL] Overprivileged WASI Host Filesystem Preopens / Root Directory Exposure (CWE-284 / Improper Access Control)`
|
| 184 |
- `[CRITICAL] Unsigned Container Image / Missing Cryptographic Cosign Signature (CWE-347 / Improper Verification of Cryptographic Signature)`
|
|
@@ -200,21 +215,6 @@ VulnForge MCP exposes 16 specialized security audit tools to your AI agent:
|
|
| 200 |
- `[HIGH] Missing Explicit Workflow Permissions - Risk of Default Write Privileges (CWE-276 / Default Permissions)`
|
| 201 |
- `[HIGH] Script Injection via Context Expression in Run Step (CWE-78 / Command Injection)`
|
| 202 |
- `[HIGH] Hardcoded Secret / Plaintext Personal Access Token Detected (CWE-798 / Hard-coded Credentials)`
|
| 203 |
-
- `[CRITICAL] Untrusted PR Checkout via pull_request_target with Head SHA (CWE-250 / Privileged Execution)`
|
| 204 |
-
- `[CRITICAL] GraphQL Introspection Enabled in Production (CWE-200 / Information Exposure)`
|
| 205 |
-
- `[CRITICAL] Dependency Confusion Vulnerability - Missing Scoped Private Registry (CWE-427 / Uncontrolled Search Path Element)`
|
| 206 |
-
- `[HIGH] Keyless Attestation SAN Identity Mismatch / Untrusted OIDC Issuer (CWE-295 / Improper Certificate Validation)`
|
| 207 |
-
- `[HIGH] Missing Rekor Transparency Log Inclusion Proof - Rollback Vulnerability (CWE-353 / Missing Support for Integrity Check)`
|
| 208 |
-
- `[HIGH] Typosquatting Package Vector Detected: Possible Impersonation of Canonical Library (CWE-829 / Untrusted Control Sphere)`
|
| 209 |
-
- `[HIGH] Dangerous Install Lifecycle Script Hook - Remote Code Execution Risk (CWE-78 / Command Injection)`
|
| 210 |
-
- `[HIGH] Non-Compliant SBOM - Missing Mandatory NTIA Minimum Elements (Executive Order 14028 Non-Compliance)`
|
| 211 |
-
- `[MEDIUM] Mutable Container Image Tag Reference Lacking SHA-256 Digest Pin (CWE-1104 / Use of Unmaintained Third Party Component)`
|
| 212 |
-
- `[MEDIUM] Unpinned Dependency Wildcard Version Range in Production Manifest (CWE-1104 / Unmaintained Third Party Component)`
|
| 213 |
-
- `[HIGH] Missing runAsNonRoot & Container Running as Root User (CWE-276 / Incorrect Default Permissions)`
|
| 214 |
-
- `[HIGH] Kubernetes RBAC Wildcard Permissions Allocated (CWE-269 / Improper Privilege Management)`
|
| 215 |
-
- `[HIGH] Missing Explicit Workflow Permissions - Risk of Default Write Privileges (CWE-276 / Default Permissions)`
|
| 216 |
-
- `[HIGH] Script Injection via Context Expression in Run Step (CWE-78 / Command Injection)`
|
| 217 |
-
- `[HIGH] Hardcoded Secret / Plaintext Personal Access Token Detected (CWE-798 / Hard-coded Credentials)`
|
| 218 |
- `[MEDIUM] Unpinned Third-Party Action Mutable Tag @v4 - Supply Chain Attack Risk (CWE-829 / Untrusted Control Sphere)`
|
| 219 |
- `[MEDIUM] Container Root Filesystem Writable / Missing readOnlyRootFilesystem (CWE-732 / Incorrect Permission Assignment)`
|
| 220 |
|
|
|
|
| 11 |
|
| 12 |
# 🛡️ VulnForge MCP
|
| 13 |
|
| 14 |
+
**通用AI原生Web、API、数据库、CI/CD、容器/K8s、eBPF、动态API模糊测试、供应链SBOM、Cosign签名、Wasm遥测与微隔离漏洞审计与自动补丁注入MCP服务器**
|
| 15 |
|
| 16 |
[](../../LICENSE)
|
| 17 |
[](https://modelcontextprotocol.io/)
|
|
|
|
| 66 |
|
| 67 |
# 11. Direct WebAssembly eBPF & Host Telemetry Audit CLI Execution
|
| 68 |
npx vulnforge-mcp --audit-wasm-ebpf --file wasm-config.yaml
|
| 69 |
+
|
| 70 |
+
# 12. Direct eBPF Microsegmentation & Zero Trust Flow Policy Audit CLI Execution
|
| 71 |
+
npx vulnforge-mcp --audit-microsegmentation --file policies/cilium.yaml
|
| 72 |
```
|
| 73 |
|
| 74 |
### Adding to Claude Desktop / Antigravity (`claude_desktop_config.json`)
|
|
|
|
| 87 |
|
| 88 |
---
|
| 89 |
|
| 90 |
+
## 🏛️ 15大漏洞审计支柱
|
| 91 |
|
| 92 |
<details open>
|
| 93 |
<summary><b>🏛️ View Architecture Pipeline Diagram (Click to toggle / 접기·펼치기)</b></summary>
|
|
|
|
| 113 |
| **12** | **Supply Chain & SBOM Gate** | CycloneDX/SPDX SBOM and manifest auditing, internal scope dependency confusion (CWE-427), Levenshtein typosquatting heuristics (CWE-829), unpinned wildcards (CWE-1104), dangerous install script hooks (CWE-78), mutable Git branches, missing lockfile hashes (CWE-353), and NTIA EO 14028 minimum elements | Automated `.npmrc` scoped registry injection, canonical package replacement, semantic version pinning, `ignore-scripts=true` suppression, immutable Git commit SHA pinning, and NTIA metadata enrichment |
|
| 114 |
| **13** | **Cosign & Artifact Attestation** | OCI container image signature verification, Sigstore keyless Fulcio OIDC SAN validation, Rekor transparency log inclusion proofs, In-toto SLSA provenance level verification, and Kyverno/Gatekeeper admission policy auditing | Kyverno ClusterPolicy enforcement rules (`validationFailureAction: Enforce`), OPA Gatekeeper constraints, Rekor proof mandates, and immutable SHA-256 image digest pinning |
|
| 115 |
| **14** | **Wasm & eBPF Telemetry** | WebAssembly linear memory bounds (CWE-119), WASI host root preopen exposure (CWE-284), instruction fuel/CPU DoS (CWE-400), unpinned bytecode digests (CWE-345), dropped telemetry (CWE-778), and kernel credential leakage (CWE-209) | Memory page clamps (max: 256), scoped ephemeral preopens (`/sandbox`), instruction fuel budgeting (100k), digest pins, and PII scrubbing filters |
|
| 116 |
+
| **15** | **Microsegmentation & eBPF Flow** | CiliumNetworkPolicy, K8s NetworkPolicy, Calico & eBPF kernel flow telemetry (CWE-284, CWE-923, CWE-200, CWE-276, CWE-269, CWE-319, CWE-668, CWE-778) | Automated Zero Trust ingress isolation, L7 HTTP rules, metadata endpoint blocking, and Hubble flow telemetry policy synthesis |
|
| 117 |
|
| 118 |
</details>
|
| 119 |
|
| 120 |
---
|
| 121 |
|
| 122 |
+
## 🛠️ 17大核心MCP安全工具
|
| 123 |
|
| 124 |
<details open>
|
| 125 |
+
<summary><b>🛠️ 17大核心MCP安全工具 (Click to toggle / 접기·펼치기)</b></summary>
|
| 126 |
<br>
|
| 127 |
|
| 128 |
+
VulnForge MCP exposes 17 specialized security audit tools to your AI agent:
|
| 129 |
|
| 130 |
1. **`vulnforge_audit_web`**:
|
| 131 |
- Analyzes HTTP response headers, cookie flags, and DOM client code.
|
|
|
|
| 173 |
- Detects unbounded linear memory growth, overprivileged WASI root preopens, missing execution fuel limits, unpinned Wasm module digests, dropped kernel telemetry without counters, plaintext credential leakage in argv, insecure shared memory state, and unconfined host root privileges.
|
| 174 |
- Correlates multi-host causal attack chains (dropper downloads, namespace unshare privesc, interactive reverse shells) and applies automated credential scrubbing.
|
| 175 |
- Parameters: `content` (string, optional raw config or manifest), `filePath` (string, optional path to file), `format` (optional string), `telemetryEvents` (optional array or JSON lines string), `strictCorrelation` (boolean, default true), `sanitizeTelemetry` (boolean, default true).
|
| 176 |
+
14. **`vulnforge_audit_microsegmentation`**:
|
| 177 |
+
- Deep inspection of CiliumNetworkPolicy, Kubernetes NetworkPolicy, Calico specifications, and eBPF kernel flow telemetry streams (Cilium Hubble / flow logs).
|
| 178 |
+
- Detects permissive ingress wildcards (CWE-284/CWE-923), unrestricted cloud metadata API access (`169.254.169.254` / CWE-200), missing default-deny isolation (CWE-276), unencrypted cross-node pod-to-pod traffic (CWE-319), permissive host namespace access (CWE-269), unrestricted egress wildcards (CWE-668), unmonitored cross-namespace flows (CWE-778), and missing L7 protocol enforcement (CWE-284).
|
| 179 |
+
- Automatically synthesizes least-privilege Cilium and Kubernetes NetworkPolicies directly from observed eBPF kernel flow telemetry events.
|
| 180 |
+
- Synthesizes automated drop-in hardening patches (default-deny rules, metadata CIDR blocks, L7 HTTP method/path filters, WireGuard annotations) with dual canary sandbox validation.
|
| 181 |
+
- Parameters: `content` (string, optional raw policy YAML text), `filePath` (string, optional path to file), `format` (optional string), `flowTelemetryStream` (optional array or JSON lines string), `strictIngress` (boolean, default true), `blockCloudMetadata` (boolean, default true).
|
| 182 |
+
15. **`vulnforge_inject_patch`**:
|
| 183 |
- Takes vulnerable code and automatically synthesizes a secure drop-in replacement with unified git diff and optional canary verification.
|
| 184 |
+
16. **`vulnforge_verify_patch`**:
|
| 185 |
- Executes isolated Canary Sandbox verification on synthesized or custom defensive patches using native Node.js `vm`.
|
| 186 |
- Runs dual-phase validation: Phase 1 evaluates attack payload containment (confirms exploit is blocked); Phase 2 evaluates benign functional input (ensures zero regression).
|
| 187 |
- Returns structured `CanaryVerificationReport` (`VERIFIED_SAFE`, `ATTACK_LEAKED`, `REGRESSION_DETECTED`, `SYNTAX_ERROR`, `SANDBOX_TIMEOUT`).
|
| 188 |
+
17. **`vulnforge_full_scan`**:
|
| 189 |
+
- Executes an end-to-end 360-degree security audit across Web, API, Database, GraphQL, CI/CD, Container/Kubernetes, eBPF, Dynamic API Fuzzing, Cloud IAM, Cryptographic Vaults, Supply Chain SBOM, Cosign Signature Attestation, WebAssembly eBPF Telemetry, and Distributed eBPF Microsegmentation layers simultaneously with automated patch synthesis and canary verification.
|
| 190 |
|
| 191 |
### 📋 Sample Vulnerability Findings & CWE Classification
|
| 192 |
+
- `[CRITICAL] Permissive Ingress Wildcard Policy - Default Ingress Allow All (CWE-284 / Improper Access Control)`
|
| 193 |
+
- `[CRITICAL] Unrestricted Cloud Metadata API Access - Missing 169.254.169.254 Egress Block (CWE-200 / Exposure of Sensitive Information)`
|
| 194 |
+
- `[HIGH] Missing Default-Deny Isolation - Permissive Pod Ingress Traffic (CWE-276 / Incorrect Default Permissions)`
|
| 195 |
+
- `[HIGH] Unencrypted Pod-to-Pod Cross-Node Network Traffic (CWE-319 / Cleartext Transmission)`
|
| 196 |
+
- `[HIGH] Permissive Host Namespace Network Access in Workload Spec (CWE-269 / Improper Privilege Management)`
|
| 197 |
- `[CRITICAL] Unbounded WebAssembly Linear Memory Bounds / Missing Heap Limit (CWE-119 / Improper Memory Buffer Restriction)`
|
| 198 |
- `[CRITICAL] Overprivileged WASI Host Filesystem Preopens / Root Directory Exposure (CWE-284 / Improper Access Control)`
|
| 199 |
- `[CRITICAL] Unsigned Container Image / Missing Cryptographic Cosign Signature (CWE-347 / Improper Verification of Cryptographic Signature)`
|
|
|
|
| 215 |
- `[HIGH] Missing Explicit Workflow Permissions - Risk of Default Write Privileges (CWE-276 / Default Permissions)`
|
| 216 |
- `[HIGH] Script Injection via Context Expression in Run Step (CWE-78 / Command Injection)`
|
| 217 |
- `[HIGH] Hardcoded Secret / Plaintext Personal Access Token Detected (CWE-798 / Hard-coded Credentials)`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 218 |
- `[MEDIUM] Unpinned Third-Party Action Mutable Tag @v4 - Supply Chain Attack Risk (CWE-829 / Untrusted Control Sphere)`
|
| 219 |
- `[MEDIUM] Container Root Filesystem Writable / Missing readOnlyRootFilesystem (CWE-732 / Incorrect Permission Assignment)`
|
| 220 |
|
package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
{
|
| 2 |
"name": "vulnforge-mcp",
|
| 3 |
-
"version": "1.
|
| 4 |
"description": "Universal AI-Native Web, API & Database Vulnerability Auditing with Automated Patch Injection MCP Server",
|
| 5 |
"main": "dist/index.js",
|
| 6 |
"type": "module",
|
|
|
|
| 1 |
{
|
| 2 |
"name": "vulnforge-mcp",
|
| 3 |
+
"version": "1.12.0",
|
| 4 |
"description": "Universal AI-Native Web, API & Database Vulnerability Auditing with Automated Patch Injection MCP Server",
|
| 5 |
"main": "dist/index.js",
|
| 6 |
"type": "module",
|
src/ebpf/microsegmentation_audit.ts
ADDED
|
@@ -0,0 +1,654 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* VulnForge MCP - Distributed eBPF Microsegmentation & Policy Synthesis Engine
|
| 3 |
+
* @module ebpf/microsegmentation_audit
|
| 4 |
+
*
|
| 5 |
+
* Implements deep security auditing and automated policy synthesis for:
|
| 6 |
+
* 1. CiliumNetworkPolicy (CRD cilium.io/v2) and CiliumClusterwideNetworkPolicy
|
| 7 |
+
* 2. Kubernetes standard NetworkPolicy (networking.k8s.io/v1) and Calico policies
|
| 8 |
+
* 3. eBPF kernel flow telemetry (Hubble, Tetragon, cilium-agent flow logs)
|
| 9 |
+
* 4. 8 critical vulnerability vectors (CWE-284, CWE-862, CWE-200, CWE-923, CWE-276, CWE-1188, CWE-269, CWE-668, CWE-319, CWE-20, CWE-778)
|
| 10 |
+
* 5. Automated policy synthesis with Zero-Trust ingress, metadata block, and L7 HTTP inspection
|
| 11 |
+
*/
|
| 12 |
+
|
| 13 |
+
import {
|
| 14 |
+
KernelFlowEvent,
|
| 15 |
+
KernelFlowProtocol,
|
| 16 |
+
KernelFlowVerdict,
|
| 17 |
+
MicrosegmentationAuditInput,
|
| 18 |
+
MicrosegmentationAuditResult,
|
| 19 |
+
MicrosegmentationAuditSummary,
|
| 20 |
+
MicrosegmentationFormat,
|
| 21 |
+
PatchRecommendation,
|
| 22 |
+
PolicySynthesisOptions,
|
| 23 |
+
SecurityFinding,
|
| 24 |
+
Severity
|
| 25 |
+
} from '../types/index.js';
|
| 26 |
+
|
| 27 |
+
export const CLOUD_METADATA_IPS = [
|
| 28 |
+
'169.254.169.254',
|
| 29 |
+
'fd00:ec2::254',
|
| 30 |
+
'metadata.google.internal',
|
| 31 |
+
'100.100.100.200'
|
| 32 |
+
];
|
| 33 |
+
|
| 34 |
+
/**
|
| 35 |
+
* Detects the microsegmentation policy or telemetry format.
|
| 36 |
+
*/
|
| 37 |
+
export function detectMicrosegmentationFormat(content: string, filePath?: string): MicrosegmentationFormat {
|
| 38 |
+
const fp = (filePath || '').toLowerCase();
|
| 39 |
+
const c = content || '';
|
| 40 |
+
const trimmed = c.trim();
|
| 41 |
+
|
| 42 |
+
// File extension and path hints
|
| 43 |
+
if (fp.endsWith('.cnp.yaml') || fp.endsWith('.cnp.yml') || fp.includes('cilium')) {
|
| 44 |
+
return 'CILIUM_NETWORK_POLICY';
|
| 45 |
+
}
|
| 46 |
+
if (fp.includes('calico') || fp.endsWith('.gnp.yaml') || fp.endsWith('.gnp.yml')) {
|
| 47 |
+
return 'CALICO_NETWORK_POLICY';
|
| 48 |
+
}
|
| 49 |
+
|
| 50 |
+
// Cilium Network Policy detection
|
| 51 |
+
if (
|
| 52 |
+
c.includes('cilium.io/v2') ||
|
| 53 |
+
c.includes('cilium.io/v2alpha1') ||
|
| 54 |
+
c.includes('CiliumNetworkPolicy') ||
|
| 55 |
+
c.includes('CiliumClusterwideNetworkPolicy') ||
|
| 56 |
+
(c.includes('endpointSelector') && (c.includes('fromEndpoints') || c.includes('toEndpoints') || c.includes('toEntities')))
|
| 57 |
+
) {
|
| 58 |
+
return 'CILIUM_NETWORK_POLICY';
|
| 59 |
+
}
|
| 60 |
+
|
| 61 |
+
// Calico Network Policy detection
|
| 62 |
+
if (
|
| 63 |
+
c.includes('projectcalico.org/v3') ||
|
| 64 |
+
c.includes('GlobalNetworkPolicy') ||
|
| 65 |
+
(c.includes('kind: NetworkPolicy') && (c.includes('projectcalico') || c.includes('order:') || c.includes('preDNAT:')))
|
| 66 |
+
) {
|
| 67 |
+
return 'CALICO_NETWORK_POLICY';
|
| 68 |
+
}
|
| 69 |
+
|
| 70 |
+
// Kubernetes Standard NetworkPolicy detection
|
| 71 |
+
if (
|
| 72 |
+
(c.includes('networking.k8s.io/v1') && c.includes('NetworkPolicy')) ||
|
| 73 |
+
(c.includes('kind: NetworkPolicy') && (c.includes('podSelector') || c.includes('policyTypes:')))
|
| 74 |
+
) {
|
| 75 |
+
return 'K8S_NETWORK_POLICY';
|
| 76 |
+
}
|
| 77 |
+
|
| 78 |
+
// Kernel Flow Telemetry detection (JSON or JSONL stream)
|
| 79 |
+
if (
|
| 80 |
+
(trimmed.startsWith('[') && (trimmed.includes('"verdict"') || trimmed.includes('"flowId"') || trimmed.includes('"sourcePod"'))) ||
|
| 81 |
+
(trimmed.includes('"verdict"') && (trimmed.includes('"destinationPort"') || trimmed.includes('"destinationIp"') || trimmed.includes('"sourceNamespace"')))
|
| 82 |
+
) {
|
| 83 |
+
return 'KERNEL_FLOW_TELEMETRY';
|
| 84 |
+
}
|
| 85 |
+
|
| 86 |
+
return 'UNKNOWN';
|
| 87 |
+
}
|
| 88 |
+
|
| 89 |
+
export function isMicrosegmentationContent(content: string): boolean {
|
| 90 |
+
return detectMicrosegmentationFormat(content) !== 'UNKNOWN';
|
| 91 |
+
}
|
| 92 |
+
|
| 93 |
+
/**
|
| 94 |
+
* Parses raw string or array input into typed KernelFlowEvent objects.
|
| 95 |
+
*/
|
| 96 |
+
export function parseKernelFlowEvents(input: KernelFlowEvent[] | string | undefined): KernelFlowEvent[] {
|
| 97 |
+
if (!input) return [];
|
| 98 |
+
if (Array.isArray(input)) return input;
|
| 99 |
+
|
| 100 |
+
const events: KernelFlowEvent[] = [];
|
| 101 |
+
const trimmed = input.trim();
|
| 102 |
+
|
| 103 |
+
if (trimmed.startsWith('[') && trimmed.endsWith(']')) {
|
| 104 |
+
try {
|
| 105 |
+
const parsed = JSON.parse(trimmed);
|
| 106 |
+
if (Array.isArray(parsed)) return parsed;
|
| 107 |
+
} catch {}
|
| 108 |
+
}
|
| 109 |
+
|
| 110 |
+
const lines = trimmed.split(/\r?\n/);
|
| 111 |
+
for (const line of lines) {
|
| 112 |
+
const l = line.trim();
|
| 113 |
+
if (!l || !l.startsWith('{')) continue;
|
| 114 |
+
try {
|
| 115 |
+
const ev = JSON.parse(l);
|
| 116 |
+
events.push(ev);
|
| 117 |
+
} catch {}
|
| 118 |
+
}
|
| 119 |
+
|
| 120 |
+
return events;
|
| 121 |
+
}
|
| 122 |
+
|
| 123 |
+
/**
|
| 124 |
+
* Synthesizes production-ready CiliumNetworkPolicy, K8s NetworkPolicy, and Default-Deny policies
|
| 125 |
+
* from observed eBPF kernel flow events.
|
| 126 |
+
*/
|
| 127 |
+
export function synthesizePolicyFromFlowTelemetry(
|
| 128 |
+
flows: KernelFlowEvent[] | string,
|
| 129 |
+
options: PolicySynthesisOptions = {}
|
| 130 |
+
): {
|
| 131 |
+
ciliumNetworkPolicy: string;
|
| 132 |
+
k8sNetworkPolicy: string;
|
| 133 |
+
defaultDenyPolicy: string;
|
| 134 |
+
rulesCount: number;
|
| 135 |
+
} {
|
| 136 |
+
const parsedFlows = parseKernelFlowEvents(flows);
|
| 137 |
+
const policyName = options.policyName || 'synthesized-microseg-policy';
|
| 138 |
+
const targetNamespace = options.targetNamespace || 'production';
|
| 139 |
+
const appLabel = options.appLabel || 'backend-service';
|
| 140 |
+
const blockMetadata = options.blockCloudMetadata !== false;
|
| 141 |
+
const enableL7 = options.enableL7Rules !== false;
|
| 142 |
+
const enableHubble = options.enableHubbleTelemetry !== false;
|
| 143 |
+
|
| 144 |
+
// Aggregate observed ingress and egress flows
|
| 145 |
+
const allowedIngress = new Map<string, { ports: Set<number>; protocol: string; methods: Set<string>; paths: Set<string> }>();
|
| 146 |
+
const allowedEgress = new Map<string, { ports: Set<number>; protocol: string; namespaces: Set<string> }>();
|
| 147 |
+
|
| 148 |
+
let rulesCount = 0;
|
| 149 |
+
|
| 150 |
+
for (const f of parsedFlows) {
|
| 151 |
+
if (f.verdict === 'DROPPED') continue; // only synthesize based on valid forwarded flows
|
| 152 |
+
|
| 153 |
+
const srcLabel = f.sourceLabels ? Object.entries(f.sourceLabels).map(([k, v]) => `${k}=${v}`).join(',') : f.sourcePod || 'unknown-client';
|
| 154 |
+
const destPort = f.destinationPort || 80;
|
| 155 |
+
const proto = (f.protocol || 'TCP').toUpperCase();
|
| 156 |
+
|
| 157 |
+
// Ingress tracking
|
| 158 |
+
if (!allowedIngress.has(srcLabel)) {
|
| 159 |
+
allowedIngress.set(srcLabel, {
|
| 160 |
+
ports: new Set(),
|
| 161 |
+
protocol: proto,
|
| 162 |
+
methods: new Set(),
|
| 163 |
+
paths: new Set()
|
| 164 |
+
});
|
| 165 |
+
rulesCount++;
|
| 166 |
+
}
|
| 167 |
+
const ingEntry = allowedIngress.get(srcLabel)!;
|
| 168 |
+
ingEntry.ports.add(destPort);
|
| 169 |
+
if (f.httpMethod) ingEntry.methods.add(f.httpMethod.toUpperCase());
|
| 170 |
+
if (f.httpPath) ingEntry.paths.add(f.httpPath);
|
| 171 |
+
|
| 172 |
+
// Egress tracking
|
| 173 |
+
const destLabel = f.destinationLabels ? Object.entries(f.destinationLabels).map(([k, v]) => `${k}=${v}`).join(',') : f.destinationPod || 'external-endpoint';
|
| 174 |
+
if (!allowedEgress.has(destLabel)) {
|
| 175 |
+
allowedEgress.set(destLabel, {
|
| 176 |
+
ports: new Set(),
|
| 177 |
+
protocol: proto,
|
| 178 |
+
namespaces: new Set()
|
| 179 |
+
});
|
| 180 |
+
rulesCount++;
|
| 181 |
+
}
|
| 182 |
+
const egEntry = allowedEgress.get(destLabel)!;
|
| 183 |
+
egEntry.ports.add(destPort);
|
| 184 |
+
if (f.destinationNamespace) egEntry.namespaces.add(f.destinationNamespace);
|
| 185 |
+
}
|
| 186 |
+
|
| 187 |
+
// Construct CiliumNetworkPolicy
|
| 188 |
+
const ciliumIngressRules: string[] = [];
|
| 189 |
+
for (const [src, data] of allowedIngress.entries()) {
|
| 190 |
+
const portsList = Array.from(data.ports).map((p) => ` - port: "${p}"\n protocol: ${data.protocol}`).join('\n');
|
| 191 |
+
let l7Block = '';
|
| 192 |
+
if (enableL7 && data.methods.size > 0) {
|
| 193 |
+
const httpRules = Array.from(data.methods).map((m) => {
|
| 194 |
+
const pathStr = Array.from(data.paths)[0] || '/';
|
| 195 |
+
return ` - method: "${m}"\n path: "${pathStr}"`;
|
| 196 |
+
}).join('\n');
|
| 197 |
+
l7Block = `\n rules:\n http:\n${httpRules}`;
|
| 198 |
+
}
|
| 199 |
+
|
| 200 |
+
ciliumIngressRules.push(` - fromEndpoints:
|
| 201 |
+
- matchLabels:
|
| 202 |
+
app.kubernetes.io/name: "${src}"
|
| 203 |
+
toPorts:
|
| 204 |
+
- ports:
|
| 205 |
+
${portsList}${l7Block}`);
|
| 206 |
+
}
|
| 207 |
+
|
| 208 |
+
const metadataBlock = blockMetadata
|
| 209 |
+
? ` - toCIDRSet:
|
| 210 |
+
- cidr: 0.0.0.0/0
|
| 211 |
+
except:
|
| 212 |
+
- 169.254.169.254/32
|
| 213 |
+
- 100.100.100.200/32`
|
| 214 |
+
: '';
|
| 215 |
+
|
| 216 |
+
const ciliumEgressRules: string[] = [];
|
| 217 |
+
if (metadataBlock) {
|
| 218 |
+
ciliumEgressRules.push(metadataBlock);
|
| 219 |
+
}
|
| 220 |
+
|
| 221 |
+
for (const [dest, data] of allowedEgress.entries()) {
|
| 222 |
+
const portsList = Array.from(data.ports).map((p) => ` - port: "${p}"\n protocol: ${data.protocol}`).join('\n');
|
| 223 |
+
ciliumEgressRules.push(` - toEndpoints:
|
| 224 |
+
- matchLabels:
|
| 225 |
+
app.kubernetes.io/name: "${dest}"
|
| 226 |
+
toPorts:
|
| 227 |
+
- ports:
|
| 228 |
+
${portsList}`);
|
| 229 |
+
}
|
| 230 |
+
|
| 231 |
+
const annotations = enableHubble
|
| 232 |
+
? ` annotations:
|
| 233 |
+
flow.cilium.io/audit: "true"
|
| 234 |
+
hubble.cilium.io/monitor: "enabled"
|
| 235 |
+
policy.cilium.io/synthesized-by: "vulnforge-mcp"`
|
| 236 |
+
: ` annotations:
|
| 237 |
+
policy.cilium.io/synthesized-by: "vulnforge-mcp"`;
|
| 238 |
+
|
| 239 |
+
const ciliumNetworkPolicy = `apiVersion: cilium.io/v2
|
| 240 |
+
kind: CiliumNetworkPolicy
|
| 241 |
+
metadata:
|
| 242 |
+
name: ${policyName}
|
| 243 |
+
namespace: ${targetNamespace}
|
| 244 |
+
${annotations}
|
| 245 |
+
spec:
|
| 246 |
+
endpointSelector:
|
| 247 |
+
matchLabels:
|
| 248 |
+
app: ${appLabel}
|
| 249 |
+
ingress:
|
| 250 |
+
${ciliumIngressRules.length > 0 ? ciliumIngressRules.join('\n') : ' []'}
|
| 251 |
+
egress:
|
| 252 |
+
${ciliumEgressRules.length > 0 ? ciliumEgressRules.join('\n') : ' []'}`;
|
| 253 |
+
|
| 254 |
+
// Construct K8s NetworkPolicy
|
| 255 |
+
const k8sIngressRules: string[] = [];
|
| 256 |
+
for (const [src, data] of allowedIngress.entries()) {
|
| 257 |
+
const portsList = Array.from(data.ports).map((p) => ` - port: ${p}\n protocol: ${data.protocol}`).join('\n');
|
| 258 |
+
k8sIngressRules.push(` - from:
|
| 259 |
+
- podSelector:
|
| 260 |
+
matchLabels:
|
| 261 |
+
app.kubernetes.io/name: "${src}"
|
| 262 |
+
ports:
|
| 263 |
+
${portsList}`);
|
| 264 |
+
}
|
| 265 |
+
|
| 266 |
+
const k8sEgressRules: string[] = [];
|
| 267 |
+
if (blockMetadata) {
|
| 268 |
+
k8sEgressRules.push(` - to:
|
| 269 |
+
- ipBlock:
|
| 270 |
+
cidr: 0.0.0.0/0
|
| 271 |
+
except:
|
| 272 |
+
- 169.254.169.254/32`);
|
| 273 |
+
}
|
| 274 |
+
|
| 275 |
+
const k8sNetworkPolicy = `apiVersion: networking.k8s.io/v1
|
| 276 |
+
kind: NetworkPolicy
|
| 277 |
+
metadata:
|
| 278 |
+
name: ${policyName}-k8s
|
| 279 |
+
namespace: ${targetNamespace}
|
| 280 |
+
spec:
|
| 281 |
+
podSelector:
|
| 282 |
+
matchLabels:
|
| 283 |
+
app: ${appLabel}
|
| 284 |
+
policyTypes:
|
| 285 |
+
- Ingress
|
| 286 |
+
- Egress
|
| 287 |
+
ingress:
|
| 288 |
+
${k8sIngressRules.length > 0 ? k8sIngressRules.join('\n') : ' []'}
|
| 289 |
+
egress:
|
| 290 |
+
${k8sEgressRules.length > 0 ? k8sEgressRules.join('\n') : ' []'}`;
|
| 291 |
+
|
| 292 |
+
// Default Deny Policy
|
| 293 |
+
const defaultDenyPolicy = `apiVersion: cilium.io/v2
|
| 294 |
+
kind: CiliumNetworkPolicy
|
| 295 |
+
metadata:
|
| 296 |
+
name: default-deny-all
|
| 297 |
+
namespace: ${targetNamespace}
|
| 298 |
+
annotations:
|
| 299 |
+
policy.cilium.io/zero-trust: "enforced"
|
| 300 |
+
spec:
|
| 301 |
+
endpointSelector: {}
|
| 302 |
+
ingress: []
|
| 303 |
+
egress:
|
| 304 |
+
- toEntities:
|
| 305 |
+
- kube-dns
|
| 306 |
+
- cluster`;
|
| 307 |
+
|
| 308 |
+
return {
|
| 309 |
+
ciliumNetworkPolicy,
|
| 310 |
+
k8sNetworkPolicy,
|
| 311 |
+
defaultDenyPolicy,
|
| 312 |
+
rulesCount: Math.max(rulesCount, 1)
|
| 313 |
+
};
|
| 314 |
+
}
|
| 315 |
+
|
| 316 |
+
/**
|
| 317 |
+
* Audits microsegmentation manifests and eBPF flow telemetry against 8 high-impact vulnerability vectors.
|
| 318 |
+
*/
|
| 319 |
+
export function auditMicrosegmentationSecurity(input: MicrosegmentationAuditInput): MicrosegmentationAuditResult {
|
| 320 |
+
const content = input.content || '';
|
| 321 |
+
const filePath = input.filePath || 'network-policy.yaml';
|
| 322 |
+
const format = input.format || detectMicrosegmentationFormat(content, filePath);
|
| 323 |
+
const flowEvents = parseKernelFlowEvents(input.flowEvents);
|
| 324 |
+
|
| 325 |
+
const findings: SecurityFinding[] = [];
|
| 326 |
+
const recommendedPatches: PatchRecommendation[] = [];
|
| 327 |
+
|
| 328 |
+
const summary: MicrosegmentationAuditSummary = {
|
| 329 |
+
wildcardIngressCount: 0,
|
| 330 |
+
wildcardEgressCount: 0,
|
| 331 |
+
unprotectedMetadataEgressCount: 0,
|
| 332 |
+
missingDefaultDeny: false,
|
| 333 |
+
unboundedPortsCount: 0,
|
| 334 |
+
uninspectedL7Count: 0,
|
| 335 |
+
crossNamespaceLeakageCount: 0,
|
| 336 |
+
missingFlowTelemetry: false,
|
| 337 |
+
synthesizedRulesCount: 0
|
| 338 |
+
};
|
| 339 |
+
|
| 340 |
+
let totalChecks = 0;
|
| 341 |
+
|
| 342 |
+
// 1. Vector 1: MICROSEG_WILDCARD_INGRESS (CWE-284 / CWE-862)
|
| 343 |
+
totalChecks++;
|
| 344 |
+
const hasWildcardIngress =
|
| 345 |
+
/ingress\s*:\s*\[\s*\{\s*\}\s*\]/.test(content) ||
|
| 346 |
+
/ingress:\s*\n\s*-\s*\{\s*\}/.test(content) ||
|
| 347 |
+
/fromEntities\s*:\s*(?:\[\s*["']?(?:all|world)["']?\s*\]|\n\s*-\s*["']?(?:all|world)["']?)/i.test(content) ||
|
| 348 |
+
/fromEndpoints\s*:\s*(?:\[\s*\{\s*\}\s*\]|\n\s*-\s*\{\s*\})/.test(content) ||
|
| 349 |
+
/from:\s*(?:\[\s*\{\s*\}\s*\]|\n\s*-\s*\{\s*\})/.test(content) ||
|
| 350 |
+
/fromCIDR\s*:\s*\[\s*["']0\.0\.0\.0\/0["']\s*\]/.test(content) ||
|
| 351 |
+
(/^\s*ingress:\s*$/m.test(content) && /-\s*\{\s*\}/.test(content));
|
| 352 |
+
|
| 353 |
+
if (hasWildcardIngress) {
|
| 354 |
+
summary.wildcardIngressCount++;
|
| 355 |
+
findings.push({
|
| 356 |
+
id: 'VF-MICROSEG-001',
|
| 357 |
+
title: 'Wildcard Ingress Security Hole / Missing Source Isolation (CWE-284)',
|
| 358 |
+
severity: 'CRITICAL',
|
| 359 |
+
category: 'microsegmentation',
|
| 360 |
+
cwe: 'CWE-284: Improper Access Control / CWE-862: Missing Authorization',
|
| 361 |
+
target: filePath,
|
| 362 |
+
description:
|
| 363 |
+
'The network policy permits unrestricted wildcard ingress (e.g. fromEntities: [world/all] or empty from: [{}]). Any pod in the cluster or external network can initiate connections to sensitive internal workloads, bypassing zero-trust isolation boundaries.',
|
| 364 |
+
evidence: content.substring(0, 300),
|
| 365 |
+
impact:
|
| 366 |
+
'Unauthorized lateral movement, direct exploitation of internal microservices, and cluster perimeter collapse.',
|
| 367 |
+
remediation:
|
| 368 |
+
'Replace wildcard ingress with explicit fromEndpoints label selectors and enforce mutual workload verification.',
|
| 369 |
+
patchRecommendation: {
|
| 370 |
+
patchType: 'MICROSEG_ZERO_TRUST_INGRESS',
|
| 371 |
+
targetFile: filePath,
|
| 372 |
+
vulnerableSnippet: 'ingress:\n - {}',
|
| 373 |
+
patchedSnippet: 'ingress:\n - fromEndpoints:\n - matchLabels:\n app.kubernetes.io/name: frontend',
|
| 374 |
+
diff: '--- a/policy.yaml\n+++ b/policy.yaml\n@@ -1,2 +1,4 @@\n ingress:\n- - {}\n+ - fromEndpoints:\n+ - matchLabels:\n+ app.kubernetes.io/name: frontend',
|
| 375 |
+
explanation: 'Replaces unbounded wildcard ingress with explicit endpoint label selector.'
|
| 376 |
+
}
|
| 377 |
+
});
|
| 378 |
+
}
|
| 379 |
+
|
| 380 |
+
// 2. Vector 2: MICROSEG_WILDCARD_EGRESS (CWE-923 / CWE-284)
|
| 381 |
+
totalChecks++;
|
| 382 |
+
const hasWildcardEgress =
|
| 383 |
+
/egress\s*:\s*\[\s*\{\s*\}\s*\]/.test(content) ||
|
| 384 |
+
/egress:\s*\n\s*-\s*\{\s*\}/.test(content) ||
|
| 385 |
+
/toEntities\s*:\s*(?:\[\s*["']?(?:all|world)["']?\s*\]|\n\s*-\s*["']?(?:all|world)["']?)/i.test(content) ||
|
| 386 |
+
/toEndpoints\s*:\s*(?:\[\s*\{\s*\}\s*\]|\n\s*-\s*\{\s*\})/.test(content) ||
|
| 387 |
+
/to:\s*(?:\[\s*\{\s*\}\s*\]|\n\s*-\s*\{\s*\})/.test(content) ||
|
| 388 |
+
(/^\s*egress:\s*$/m.test(content) && /-\s*\{\s*\}/.test(content));
|
| 389 |
+
|
| 390 |
+
if (hasWildcardEgress) {
|
| 391 |
+
summary.wildcardEgressCount++;
|
| 392 |
+
findings.push({
|
| 393 |
+
id: 'VF-MICROSEG-002',
|
| 394 |
+
title: 'Unrestricted Wildcard Egress / Exfiltration Channel (CWE-923)',
|
| 395 |
+
severity: 'HIGH',
|
| 396 |
+
category: 'microsegmentation',
|
| 397 |
+
cwe: 'CWE-923: Improper Restriction of Communication Channel to Intended Endpoints',
|
| 398 |
+
target: filePath,
|
| 399 |
+
description:
|
| 400 |
+
'The policy allows unrestricted egress traffic (toEntities: [world] or egress: [{}]). A compromised container can establish reverse shell connections to external Command & Control (C2) servers or exfiltrate database records without restriction.',
|
| 401 |
+
evidence: content.substring(0, 300),
|
| 402 |
+
impact:
|
| 403 |
+
'Data exfiltration, C2 callbacks, supply-chain package tampering, and unmonitored external network connections.',
|
| 404 |
+
remediation:
|
| 405 |
+
'Restrict egress to explicit internal microservices and external FQDNs using Cilium toFQDNs rules.'
|
| 406 |
+
});
|
| 407 |
+
}
|
| 408 |
+
|
| 409 |
+
// 3. Vector 3: MICROSEG_METADATA_EGRESS (CWE-200 / CWE-668 / SSRF)
|
| 410 |
+
totalChecks++;
|
| 411 |
+
const hasMetadataProtection =
|
| 412 |
+
content.includes('169.254.169.254/32') && (content.includes('except:') || content.includes('deny:'));
|
| 413 |
+
const hasEgressRule = content.includes('egress:');
|
| 414 |
+
const exposesMetadata =
|
| 415 |
+
(content.includes('169.254.169.254') && !hasMetadataProtection) ||
|
| 416 |
+
(hasEgressRule && !hasMetadataProtection && (content.includes('0.0.0.0/0') || content.includes('world') || content.includes('toEntities')));
|
| 417 |
+
|
| 418 |
+
if (exposesMetadata) {
|
| 419 |
+
summary.unprotectedMetadataEgressCount++;
|
| 420 |
+
findings.push({
|
| 421 |
+
id: 'VF-MICROSEG-003',
|
| 422 |
+
title: 'Unprotected Cloud Metadata Service (IMDS) Egress Exposure (CWE-200)',
|
| 423 |
+
severity: 'CRITICAL',
|
| 424 |
+
category: 'cloud_security',
|
| 425 |
+
cwe: 'CWE-200: Exposure of Sensitive Information to an Unauthorized Actor / CWE-668',
|
| 426 |
+
target: filePath,
|
| 427 |
+
description:
|
| 428 |
+
'Egress traffic to the cloud instance metadata IP (169.254.169.254 / fd00:ec2::254) is not blocked with an explicit CIDR exception. A container vulnerability (e.g. SSRF) can allow attackers to steal node IAM credentials and access cluster cloud resources.',
|
| 429 |
+
evidence: content.includes('169.254.169.254') ? '169.254.169.254 in egress without except' : 'egress rules without IMDS 169.254.169.254/32 except clause',
|
| 430 |
+
impact:
|
| 431 |
+
'Compromise of host cloud provider IAM credentials (AWS EC2 IAM Role, GCP Metadata token, Azure MSI).',
|
| 432 |
+
remediation:
|
| 433 |
+
'Inject an explicit except CIDR rule for 169.254.169.254/32 in all egress rules targeting 0.0.0.0/0.',
|
| 434 |
+
patchRecommendation: {
|
| 435 |
+
patchType: 'MICROSEG_METADATA_BLOCK',
|
| 436 |
+
targetFile: filePath,
|
| 437 |
+
vulnerableSnippet: '- toCIDR:\n - 0.0.0.0/0',
|
| 438 |
+
patchedSnippet: '- toCIDRSet:\n - cidr: 0.0.0.0/0\n except:\n - 169.254.169.254/32',
|
| 439 |
+
diff: '--- a/policy.yaml\n+++ b/policy.yaml\n@@ -1,2 +1,5 @@\n-- toCIDR:\n- - 0.0.0.0/0\n++ toCIDRSet:\n++ - cidr: 0.0.0.0/0\n++ except:\n++ - 169.254.169.254/32',
|
| 440 |
+
explanation: 'Enforces explicit exclusion of AWS/GCP/Azure instance metadata endpoint (169.254.169.254/32).'
|
| 441 |
+
}
|
| 442 |
+
});
|
| 443 |
+
}
|
| 444 |
+
|
| 445 |
+
// 4. Vector 4: MICROSEG_MISSING_DEFAULT_DENY (CWE-276 / CWE-1188)
|
| 446 |
+
totalChecks++;
|
| 447 |
+
const hasDefaultDeny =
|
| 448 |
+
(content.includes('default-deny') || content.includes('deny-all')) ||
|
| 449 |
+
(content.includes('endpointSelector: {}') && content.includes('ingress: []')) ||
|
| 450 |
+
(content.includes('policyTypes:') && content.includes('Ingress') && content.includes('Egress') && content.includes('podSelector: {}'));
|
| 451 |
+
|
| 452 |
+
if (!hasDefaultDeny && format !== 'KERNEL_FLOW_TELEMETRY') {
|
| 453 |
+
summary.missingDefaultDeny = true;
|
| 454 |
+
findings.push({
|
| 455 |
+
id: 'VF-MICROSEG-004',
|
| 456 |
+
title: 'Missing Namespace-Wide Default-Deny Isolation Policy (CWE-276)',
|
| 457 |
+
severity: 'HIGH',
|
| 458 |
+
category: 'microsegmentation',
|
| 459 |
+
cwe: 'CWE-276: Incorrect Default Permissions / CWE-1188',
|
| 460 |
+
target: filePath,
|
| 461 |
+
description:
|
| 462 |
+
'The cluster namespace lacks a baseline Default-Deny network policy. In Kubernetes and Cilium, any pod not explicitly matched by a policy retains default-allow connectivity, completely invalidating zero-trust posture.',
|
| 463 |
+
evidence: 'No default-deny-all policy detected in namespace configuration',
|
| 464 |
+
impact:
|
| 465 |
+
'Newly deployed or unlabelled workloads remain exposed in default-allow mode across all cluster nodes.',
|
| 466 |
+
remediation:
|
| 467 |
+
'Deploy an explicit default-deny CiliumNetworkPolicy targeting endpointSelector: {} with ingress: [] and egress restricted to DNS.',
|
| 468 |
+
patchRecommendation: {
|
| 469 |
+
patchType: 'MICROSEG_DEFAULT_DENY_INJECTION',
|
| 470 |
+
targetFile: 'default-deny-policy.yaml',
|
| 471 |
+
vulnerableSnippet: '# Missing default-deny baseline',
|
| 472 |
+
patchedSnippet: 'apiVersion: cilium.io/v2\nkind: CiliumNetworkPolicy\nmetadata:\n name: default-deny-all\nspec:\n endpointSelector: {}\n ingress: []\n egress:\n - toEntities: [kube-dns, cluster]',
|
| 473 |
+
diff: '--- a/default-deny-policy.yaml\n+++ b/default-deny-policy.yaml\n@@ -0,0 +1,9 @@\n+apiVersion: cilium.io/v2\n+kind: CiliumNetworkPolicy\n+metadata:\n+ name: default-deny-all\n+spec:\n+ endpointSelector: {}\n+ ingress: []',
|
| 474 |
+
explanation: 'Injects baseline default-deny policy closing unmonitored default-allow communications.'
|
| 475 |
+
}
|
| 476 |
+
});
|
| 477 |
+
}
|
| 478 |
+
|
| 479 |
+
// 5. Vector 5: MICROSEG_UNBOUNDED_PORTS (CWE-269 / CWE-284)
|
| 480 |
+
totalChecks++;
|
| 481 |
+
const hasUnboundedPorts =
|
| 482 |
+
(content.includes('fromEndpoints:') && !content.includes('toPorts:') && !content.includes('ports:')) ||
|
| 483 |
+
(content.includes('toEndpoints:') && !content.includes('toPorts:') && !content.includes('ports:')) ||
|
| 484 |
+
(content.includes('from:') && !content.includes('ports:') && content.includes('podSelector:'));
|
| 485 |
+
|
| 486 |
+
if (hasUnboundedPorts) {
|
| 487 |
+
summary.unboundedPortsCount++;
|
| 488 |
+
findings.push({
|
| 489 |
+
id: 'VF-MICROSEG-005',
|
| 490 |
+
title: 'Unbounded Port / Protocol Access Rule (CWE-269)',
|
| 491 |
+
severity: 'MEDIUM',
|
| 492 |
+
category: 'network_security',
|
| 493 |
+
cwe: 'CWE-269: Improper Privilege Management / CWE-284',
|
| 494 |
+
target: filePath,
|
| 495 |
+
description:
|
| 496 |
+
'Ingress or egress rules allow communication without pinning specific destination ports. Unbounded port access permits attackers to connect to internal administration ports (e.g. 9090, 8080, JMX, debugging ports) running on the same pod.',
|
| 497 |
+
evidence: content.substring(0, 300),
|
| 498 |
+
impact:
|
| 499 |
+
'Lateral exposure of auxiliary diagnostic ports, metrics scraping endpoints, and unintended microservices.',
|
| 500 |
+
remediation:
|
| 501 |
+
'Bind all network policy rules to explicit L4 ports and protocols (e.g. toPorts: [{ ports: [{ port: "443", protocol: TCP }] }]).',
|
| 502 |
+
patchRecommendation: {
|
| 503 |
+
patchType: 'MICROSEG_PORT_PIN',
|
| 504 |
+
targetFile: filePath,
|
| 505 |
+
vulnerableSnippet: 'fromEndpoints:\n - matchLabels:\n app: api',
|
| 506 |
+
patchedSnippet: 'fromEndpoints:\n - matchLabels:\n app: api\ntoPorts:\n - ports:\n - port: "8443"\n protocol: TCP',
|
| 507 |
+
diff: '--- a/policy.yaml\n+++ b/policy.yaml\n@@ -1,3 +1,6 @@\n fromEndpoints:\n - matchLabels:\n app: api\n+toPorts:\n+ - ports:\n+ - port: "8443"\n+ protocol: TCP',
|
| 508 |
+
explanation: 'Pins permitted endpoint traffic strictly to TCP port 8443.'
|
| 509 |
+
}
|
| 510 |
+
});
|
| 511 |
+
}
|
| 512 |
+
|
| 513 |
+
// 6. Vector 6: MICROSEG_UNINSPECTED_L7 (CWE-319 / CWE-20)
|
| 514 |
+
totalChecks++;
|
| 515 |
+
const touchesHttpOrGrpc =
|
| 516 |
+
content.includes('port: "80"') ||
|
| 517 |
+
content.includes('port: "8080"') ||
|
| 518 |
+
content.includes('port: "3000"') ||
|
| 519 |
+
content.includes('port: "50051"') ||
|
| 520 |
+
content.includes('port: "9092"');
|
| 521 |
+
const hasL7Rules =
|
| 522 |
+
content.includes('rules:') && (content.includes('http:') || content.includes('kafka:'));
|
| 523 |
+
|
| 524 |
+
if (touchesHttpOrGrpc && !hasL7Rules && format === 'CILIUM_NETWORK_POLICY') {
|
| 525 |
+
summary.uninspectedL7Count++;
|
| 526 |
+
findings.push({
|
| 527 |
+
id: 'VF-MICROSEG-006',
|
| 528 |
+
title: 'Missing Application-Layer (L7) HTTP/gRPC Inspection Rule (CWE-319)',
|
| 529 |
+
severity: 'MEDIUM',
|
| 530 |
+
category: 'microsegmentation',
|
| 531 |
+
cwe: 'CWE-319: Cleartext Transmission of Sensitive Information / CWE-20: Improper Input Validation',
|
| 532 |
+
target: filePath,
|
| 533 |
+
description:
|
| 534 |
+
'CiliumNetworkPolicy targets HTTP/gRPC ports without application-layer (L7) filtering rules. While L4 TCP traffic is restricted, attackers can still invoke destructive API methods (e.g. DELETE /admin, PUT /users) across permitted pods.',
|
| 535 |
+
evidence: 'HTTP service port matched without rules.http specification',
|
| 536 |
+
impact:
|
| 537 |
+
'Unauthorized API method execution, path traversal over internal HTTP routes, and uninspected east-west payload delivery.',
|
| 538 |
+
remediation:
|
| 539 |
+
'Inject Cilium L7 HTTP parsing rules specifying explicit allowed methods and regex paths.',
|
| 540 |
+
patchRecommendation: {
|
| 541 |
+
patchType: 'MICROSEG_L7_HTTP_RULE',
|
| 542 |
+
targetFile: filePath,
|
| 543 |
+
vulnerableSnippet: 'toPorts:\n - ports:\n - port: "8080"\n protocol: TCP',
|
| 544 |
+
patchedSnippet: 'toPorts:\n - ports:\n - port: "8080"\n protocol: TCP\n rules:\n http:\n - method: "GET"\n path: "/api/v1/health"\n - method: "POST"\n path: "/api/v1/items"',
|
| 545 |
+
diff: '--- a/policy.yaml\n+++ b/policy.yaml\n@@ -2,2 +2,7 @@\n - ports:\n - port: "8080"\n protocol: TCP\n+ rules:\n+ http:\n+ - method: "GET"\n+ path: "/api/v1/health"\n+ - method: "POST"\n+ path: "/api/v1/items"',
|
| 546 |
+
explanation: 'Restricts HTTP traffic to explicit GET /api/v1/health and POST /api/v1/items routes.'
|
| 547 |
+
}
|
| 548 |
+
});
|
| 549 |
+
}
|
| 550 |
+
|
| 551 |
+
// 7. Vector 7: MICROSEG_CROSS_NAMESPACE (CWE-668 / CWE-284)
|
| 552 |
+
totalChecks++;
|
| 553 |
+
const hasCrossNamespaceLeak =
|
| 554 |
+
/namespaceSelector\s*:\s*\{\s*\}/.test(content) ||
|
| 555 |
+
|
| 556 |
+
/fromEntities\s*:\s*(?:\[\s*["']?cluster["']?\s*\]|\n\s*-\s*["']?cluster["']?)/i.test(content);
|
| 557 |
+
|
| 558 |
+
|
| 559 |
+
|
| 560 |
+
|
| 561 |
+
|
| 562 |
+
if (hasCrossNamespaceLeak) {
|
| 563 |
+
summary.crossNamespaceLeakageCount++;
|
| 564 |
+
findings.push({
|
| 565 |
+
id: 'VF-MICROSEG-007',
|
| 566 |
+
title: 'Permissive Cross-Namespace Isolation Leakage (CWE-668)',
|
| 567 |
+
severity: 'HIGH',
|
| 568 |
+
category: 'microsegmentation',
|
| 569 |
+
cwe: 'CWE-668: Exposure of Resource Through Incompatible Access Control / CWE-284',
|
| 570 |
+
target: filePath,
|
| 571 |
+
description:
|
| 572 |
+
'The policy allows cross-namespace traffic across any cluster namespace via wildcard namespaceSelector: {}. Workloads from development, staging, or compromised test namespaces can access production tier pods.',
|
| 573 |
+
evidence: content.substring(0, 300),
|
| 574 |
+
impact:
|
| 575 |
+
'Tenant boundary leakage, compromised dev pods attacking production databases, and multi-tenant isolation failure.',
|
| 576 |
+
remediation:
|
| 577 |
+
'Pin namespaceSelector to explicit target namespaces using matchLabels (e.g. kubernetes.io/metadata.name: production).'
|
| 578 |
+
});
|
| 579 |
+
}
|
| 580 |
+
|
| 581 |
+
// 8. Vector 8: MICROSEG_MISSING_FLOW_TELEMETRY (CWE-778)
|
| 582 |
+
totalChecks++;
|
| 583 |
+
const hasTelemetry =
|
| 584 |
+
content.includes('flow.cilium.io/audit') ||
|
| 585 |
+
content.includes('hubble.cilium.io/monitor') ||
|
| 586 |
+
content.includes('flow-telemetry');
|
| 587 |
+
|
| 588 |
+
if (!hasTelemetry && format === 'CILIUM_NETWORK_POLICY') {
|
| 589 |
+
summary.missingFlowTelemetry = true;
|
| 590 |
+
findings.push({
|
| 591 |
+
id: 'VF-MICROSEG-008',
|
| 592 |
+
title: 'Missing eBPF Flow Telemetry & Hubble Audit Annotations (CWE-778)',
|
| 593 |
+
severity: 'LOW',
|
| 594 |
+
category: 'microsegmentation',
|
| 595 |
+
cwe: 'CWE-778: Insufficient Logging',
|
| 596 |
+
target: filePath,
|
| 597 |
+
description:
|
| 598 |
+
'CiliumNetworkPolicy does not declare Hubble audit logging annotations. Dropped and forwarded kernel flows will not generate audit log records in SIEM or eBPF telemetry pipelines, hindering real-time intrusion forensics.',
|
| 599 |
+
evidence: 'Missing flow.cilium.io/audit and hubble.cilium.io/monitor annotations',
|
| 600 |
+
impact:
|
| 601 |
+
'Silent traffic drops, unmonitored lateral probing, and lack of forensic compliance proof.',
|
| 602 |
+
remediation:
|
| 603 |
+
'Annotate CiliumNetworkPolicy with flow.cilium.io/audit: "true" and hubble.cilium.io/monitor: "enabled".',
|
| 604 |
+
patchRecommendation: {
|
| 605 |
+
patchType: 'MICROSEG_HUBBLE_TELEMETRY',
|
| 606 |
+
targetFile: filePath,
|
| 607 |
+
vulnerableSnippet: 'metadata:\n name: app-policy',
|
| 608 |
+
patchedSnippet: 'metadata:\n name: app-policy\n annotations:\n flow.cilium.io/audit: "true"\n hubble.cilium.io/monitor: "enabled"',
|
| 609 |
+
diff: '--- a/policy.yaml\n+++ b/policy.yaml\n@@ -1,2 +1,5 @@\n metadata:\n name: app-policy\n+ annotations:\n+ flow.cilium.io/audit: "true"\n+ hubble.cilium.io/monitor: "enabled"',
|
| 610 |
+
explanation: 'Enables Hubble eBPF flow audit logging for all policy decisions.'
|
| 611 |
+
}
|
| 612 |
+
});
|
| 613 |
+
}
|
| 614 |
+
|
| 615 |
+
// Telemetry Flow Synthesis (if flow events were supplied)
|
| 616 |
+
let synthesizedPolicies: MicrosegmentationAuditResult['synthesizedPolicies'] = undefined;
|
| 617 |
+
if (flowEvents.length > 0 || format === 'KERNEL_FLOW_TELEMETRY') {
|
| 618 |
+
const synthRes = synthesizePolicyFromFlowTelemetry(flowEvents, input.synthesisOptions);
|
| 619 |
+
synthesizedPolicies = synthRes;
|
| 620 |
+
summary.synthesizedRulesCount = synthRes.rulesCount;
|
| 621 |
+
}
|
| 622 |
+
|
| 623 |
+
// Collect recommended patches from findings
|
| 624 |
+
for (const f of findings) {
|
| 625 |
+
if (f.patchRecommendation) {
|
| 626 |
+
recommendedPatches.push(f.patchRecommendation);
|
| 627 |
+
}
|
| 628 |
+
}
|
| 629 |
+
|
| 630 |
+
const criticalCount = findings.filter((f) => f.severity === 'CRITICAL').length;
|
| 631 |
+
const highCount = findings.filter((f) => f.severity === 'HIGH').length;
|
| 632 |
+
const mediumCount = findings.filter((f) => f.severity === 'MEDIUM').length;
|
| 633 |
+
const lowCount = findings.filter((f) => f.severity === 'LOW').length;
|
| 634 |
+
|
| 635 |
+
const complianceStatus: 'PASS' | 'WARN' | 'FAIL' =
|
| 636 |
+
criticalCount > 0 ? 'FAIL' : highCount > 0 ? 'WARN' : 'PASS';
|
| 637 |
+
|
| 638 |
+
return {
|
| 639 |
+
format,
|
| 640 |
+
passed: findings.length === 0,
|
| 641 |
+
findings,
|
| 642 |
+
totalChecks,
|
| 643 |
+
summary,
|
| 644 |
+
recommendedPatches,
|
| 645 |
+
complianceStatus,
|
| 646 |
+
totalFindings: findings.length,
|
| 647 |
+
criticalCount,
|
| 648 |
+
highCount,
|
| 649 |
+
mediumCount,
|
| 650 |
+
lowCount,
|
| 651 |
+
timestamp: new Date().toISOString(),
|
| 652 |
+
synthesizedPolicies
|
| 653 |
+
};
|
| 654 |
+
}
|
src/index.ts
CHANGED
|
@@ -19,6 +19,7 @@ import { auditVaultSecurity } from './vault/vault_audit.js';
|
|
| 19 |
import { auditSbomSecurity } from './sbom/sbom_audit.js';
|
| 20 |
import { auditCosignSecurity } from './cosign/cosign_audit.js';
|
| 21 |
import { auditWasmEbpfSecurity } from './ebpf/wasm_ebpf_correlator.js';
|
|
|
|
| 22 |
import { synthesizeAndInjectPatch } from './patch/patch_engine.js';
|
| 23 |
|
| 24 |
// If run directly with CLI arguments
|
|
@@ -41,12 +42,56 @@ Usage:
|
|
| 41 |
vulnforge-mcp --audit-sbom [--file <path>] Run Supply Chain SBOM Verification & Dependency Confusion audit
|
| 42 |
vulnforge-mcp --audit-cosign [--file <path>] Run Artifact Cosign Signature & Rekor Attestation audit
|
| 43 |
vulnforge-mcp --audit-wasm-ebpf [--file <path>] Run WebAssembly eBPF Extension & Distributed Host Telemetry audit
|
|
|
|
| 44 |
`);
|
| 45 |
process.exit(0);
|
| 46 |
}
|
| 47 |
|
| 48 |
if (args.includes('--version') || args.includes('-v')) {
|
| 49 |
-
console.log('vulnforge-mcp v1.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
process.exit(0);
|
| 51 |
}
|
| 52 |
|
|
@@ -687,6 +732,64 @@ telemetry_export:
|
|
| 687 |
console.log(` Patched Wasm config applied: ${patchedWasm.applied}`);
|
| 688 |
console.log(` Resolved: ${patchedWasm.findingsResolved.join(', ')}`);
|
| 689 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 690 |
console.log('\n✅ All VulnForge core modules verified operational!');
|
| 691 |
process.exit(0);
|
| 692 |
}
|
|
|
|
| 19 |
import { auditSbomSecurity } from './sbom/sbom_audit.js';
|
| 20 |
import { auditCosignSecurity } from './cosign/cosign_audit.js';
|
| 21 |
import { auditWasmEbpfSecurity } from './ebpf/wasm_ebpf_correlator.js';
|
| 22 |
+
import { auditMicrosegmentationSecurity, synthesizePolicyFromFlowTelemetry } from './ebpf/microsegmentation_audit.js';
|
| 23 |
import { synthesizeAndInjectPatch } from './patch/patch_engine.js';
|
| 24 |
|
| 25 |
// If run directly with CLI arguments
|
|
|
|
| 42 |
vulnforge-mcp --audit-sbom [--file <path>] Run Supply Chain SBOM Verification & Dependency Confusion audit
|
| 43 |
vulnforge-mcp --audit-cosign [--file <path>] Run Artifact Cosign Signature & Rekor Attestation audit
|
| 44 |
vulnforge-mcp --audit-wasm-ebpf [--file <path>] Run WebAssembly eBPF Extension & Distributed Host Telemetry audit
|
| 45 |
+
vulnforge-mcp --audit-microsegmentation [--file <path>] Run Distributed eBPF Microsegmentation & Policy Synthesis audit
|
| 46 |
`);
|
| 47 |
process.exit(0);
|
| 48 |
}
|
| 49 |
|
| 50 |
if (args.includes('--version') || args.includes('-v')) {
|
| 51 |
+
console.log('vulnforge-mcp v1.12.0 (Proprietary & All Rights Reserved)');
|
| 52 |
+
process.exit(0);
|
| 53 |
+
}
|
| 54 |
+
|
| 55 |
+
|
| 56 |
+
if (args.includes('--audit-microsegmentation') || args.includes('--microseg')) {
|
| 57 |
+
const fileIdx = args.indexOf('--file');
|
| 58 |
+
const customFile = fileIdx !== -1 && args[fileIdx + 1] ? args[fileIdx + 1] : undefined;
|
| 59 |
+
|
| 60 |
+
if (customFile) {
|
| 61 |
+
try {
|
| 62 |
+
const fileContent = readFileSync(customFile, 'utf-8');
|
| 63 |
+
const result = auditMicrosegmentationSecurity({ content: fileContent, filePath: customFile });
|
| 64 |
+
console.log(JSON.stringify(result, null, 2));
|
| 65 |
+
process.exit(0);
|
| 66 |
+
} catch (e: any) {
|
| 67 |
+
console.error(`Failed to read network policy file: ${e?.message}`);
|
| 68 |
+
process.exit(1);
|
| 69 |
+
}
|
| 70 |
+
}
|
| 71 |
+
|
| 72 |
+
const samplePolicy = `apiVersion: cilium.io/v2
|
| 73 |
+
kind: CiliumNetworkPolicy
|
| 74 |
+
metadata:
|
| 75 |
+
name: backend-policy
|
| 76 |
+
namespace: production
|
| 77 |
+
spec:
|
| 78 |
+
endpointSelector:
|
| 79 |
+
matchLabels:
|
| 80 |
+
app: backend-service
|
| 81 |
+
ingress:
|
| 82 |
+
- {}
|
| 83 |
+
egress:
|
| 84 |
+
- toCIDR:
|
| 85 |
+
- 0.0.0.0/0
|
| 86 |
+
`;
|
| 87 |
+
console.log('=== [VulnForge eBPF Microsegmentation & Policy Synthesis Audit Demo] ===\n');
|
| 88 |
+
const res = auditMicrosegmentationSecurity({ content: samplePolicy, filePath: 'backend-policy.yaml' });
|
| 89 |
+
console.log(`Policy Format: ${res.format}`);
|
| 90 |
+
console.log(`Compliance Status: ${res.complianceStatus}`);
|
| 91 |
+
console.log(`Total Findings: ${res.totalFindings} (Critical: ${res.criticalCount}, High: ${res.highCount}, Medium: ${res.mediumCount})`);
|
| 92 |
+
for (const f of res.findings) {
|
| 93 |
+
console.log(`- [${f.severity}] ${f.title} (${f.cwe || 'CWE'}): ${f.description}`);
|
| 94 |
+
}
|
| 95 |
process.exit(0);
|
| 96 |
}
|
| 97 |
|
|
|
|
| 732 |
console.log(` Patched Wasm config applied: ${patchedWasm.applied}`);
|
| 733 |
console.log(` Resolved: ${patchedWasm.findingsResolved.join(', ')}`);
|
| 734 |
|
| 735 |
+
// 13. Distributed eBPF Microsegmentation & Policy Synthesis demo
|
| 736 |
+
console.log('\n13. Testing Distributed eBPF Microsegmentation & Policy Synthesis Engine:');
|
| 737 |
+
const vulnerableCnp = `apiVersion: cilium.io/v2
|
| 738 |
+
kind: CiliumNetworkPolicy
|
| 739 |
+
metadata:
|
| 740 |
+
name: payment-gateway-cnp
|
| 741 |
+
namespace: production
|
| 742 |
+
spec:
|
| 743 |
+
endpointSelector:
|
| 744 |
+
matchLabels:
|
| 745 |
+
app: payment-gateway
|
| 746 |
+
ingress:
|
| 747 |
+
- {}
|
| 748 |
+
egress:
|
| 749 |
+
- toCIDR:
|
| 750 |
+
- 0.0.0.0/0
|
| 751 |
+
- toPorts:
|
| 752 |
+
- ports:
|
| 753 |
+
- port: "8080"
|
| 754 |
+
protocol: TCP
|
| 755 |
+
`;
|
| 756 |
+
const microsegDemoRes = auditMicrosegmentationSecurity({
|
| 757 |
+
content: vulnerableCnp,
|
| 758 |
+
filePath: 'payment-gateway.cnp.yaml'
|
| 759 |
+
});
|
| 760 |
+
console.log(` Found ${microsegDemoRes.totalFindings} Microsegmentation findings (Compliance: ${microsegDemoRes.complianceStatus})`);
|
| 761 |
+
const patchedCnp = synthesizeAndInjectPatch({
|
| 762 |
+
sourceCode: vulnerableCnp,
|
| 763 |
+
filename: 'payment-gateway.cnp.yaml'
|
| 764 |
+
});
|
| 765 |
+
console.log(` Patched CiliumNetworkPolicy applied: ${patchedCnp.applied}`);
|
| 766 |
+
console.log(` Resolved: ${patchedCnp.findingsResolved.join(', ')}`);
|
| 767 |
+
|
| 768 |
+
const sampleFlows = [
|
| 769 |
+
{
|
| 770 |
+
sourcePod: 'frontend-checkout',
|
| 771 |
+
sourceLabels: { 'app.kubernetes.io/name': 'frontend-checkout' },
|
| 772 |
+
destinationPort: 8080,
|
| 773 |
+
protocol: 'TCP',
|
| 774 |
+
httpMethod: 'POST',
|
| 775 |
+
httpPath: '/api/v1/checkout',
|
| 776 |
+
verdict: 'FORWARDED' as const
|
| 777 |
+
},
|
| 778 |
+
{
|
| 779 |
+
sourcePod: 'payment-gateway',
|
| 780 |
+
destinationPod: 'database',
|
| 781 |
+
destinationPort: 5432,
|
| 782 |
+
protocol: 'TCP',
|
| 783 |
+
verdict: 'FORWARDED' as const
|
| 784 |
+
}
|
| 785 |
+
];
|
| 786 |
+
const synthPolicies = synthesizePolicyFromFlowTelemetry(sampleFlows, {
|
| 787 |
+
policyName: 'auto-synthesized-payment-policy',
|
| 788 |
+
targetNamespace: 'production',
|
| 789 |
+
appLabel: 'payment-gateway'
|
| 790 |
+
});
|
| 791 |
+
console.log(` Synthesized ${synthPolicies.rulesCount} microsegmentation rules from kernel flow telemetry.`);
|
| 792 |
+
|
| 793 |
console.log('\n✅ All VulnForge core modules verified operational!');
|
| 794 |
process.exit(0);
|
| 795 |
}
|
src/mcp/server.ts
CHANGED
|
@@ -21,6 +21,7 @@ import { auditVaultSecurity } from '../vault/vault_audit.js';
|
|
| 21 |
import { auditSbomSecurity } from '../sbom/sbom_audit.js';
|
| 22 |
import { auditCosignSecurity } from '../cosign/cosign_audit.js';
|
| 23 |
import { auditWasmEbpfSecurity } from '../ebpf/wasm_ebpf_correlator.js';
|
|
|
|
| 24 |
import { synthesizeAndInjectPatch, synthesizeAndVerifyPatch } from '../patch/patch_engine.js';
|
| 25 |
import { executeCanaryVerification } from '../sandbox/canary_runner.js';
|
| 26 |
import { SecurityFinding } from '../types/index.js';
|
|
@@ -29,7 +30,7 @@ export function createVulnForgeServer(): Server {
|
|
| 29 |
const server = new Server(
|
| 30 |
{
|
| 31 |
name: 'vulnforge-mcp',
|
| 32 |
-
version: '1.
|
| 33 |
},
|
| 34 |
|
| 35 |
{
|
|
@@ -550,6 +551,8 @@ export function createVulnForgeServer(): Server {
|
|
| 550 |
wasmContent: { type: 'string', description: 'WebAssembly runtime or EnvoyFilter configuration to audit (optional)' },
|
| 551 |
telemetryConfigContent: { type: 'string', description: 'Distributed eBPF telemetry pipeline manifest (optional)' },
|
| 552 |
hostTelemetryStream: { type: 'string', description: 'Host telemetry event stream JSON Lines (optional)' },
|
|
|
|
|
|
|
| 553 |
verifyInSandbox: {
|
| 554 |
type: 'boolean',
|
| 555 |
description: 'Run automated canary sandbox verification on synthesized patches (default: true)'
|
|
@@ -864,6 +867,35 @@ export function createVulnForgeServer(): Server {
|
|
| 864 |
};
|
| 865 |
}
|
| 866 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 867 |
case 'vulnforge_full_scan': {
|
| 868 |
const headers = (args?.headers as Record<string, string>) || {};
|
| 869 |
const frontendCode = (args?.frontendCode as string) || '';
|
|
@@ -893,6 +925,8 @@ export function createVulnForgeServer(): Server {
|
|
| 893 |
const cosignImageReference = (args?.cosignImageReference as string) || undefined;
|
| 894 |
const wasmContent = (args?.wasmContent as string) || (args?.telemetryConfigContent as string) || '';
|
| 895 |
const hostTelemetryStream = (args?.hostTelemetryStream as string) || undefined;
|
|
|
|
|
|
|
| 896 |
const verifyInSandbox = args?.verifyInSandbox !== false;
|
| 897 |
|
| 898 |
const allFindings: SecurityFinding[] = [];
|
|
@@ -991,6 +1025,15 @@ export function createVulnForgeServer(): Server {
|
|
| 991 |
allFindings.push(...wasmEbpfReport.findings);
|
| 992 |
}
|
| 993 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 994 |
// Synthesize patches and verify in canary sandbox
|
| 995 |
const combinedCode = [
|
| 996 |
frontendCode,
|
|
|
|
| 21 |
import { auditSbomSecurity } from '../sbom/sbom_audit.js';
|
| 22 |
import { auditCosignSecurity } from '../cosign/cosign_audit.js';
|
| 23 |
import { auditWasmEbpfSecurity } from '../ebpf/wasm_ebpf_correlator.js';
|
| 24 |
+
import { auditMicrosegmentationSecurity } from '../ebpf/microsegmentation_audit.js';
|
| 25 |
import { synthesizeAndInjectPatch, synthesizeAndVerifyPatch } from '../patch/patch_engine.js';
|
| 26 |
import { executeCanaryVerification } from '../sandbox/canary_runner.js';
|
| 27 |
import { SecurityFinding } from '../types/index.js';
|
|
|
|
| 30 |
const server = new Server(
|
| 31 |
{
|
| 32 |
name: 'vulnforge-mcp',
|
| 33 |
+
version: '1.12.0'
|
| 34 |
},
|
| 35 |
|
| 36 |
{
|
|
|
|
| 551 |
wasmContent: { type: 'string', description: 'WebAssembly runtime or EnvoyFilter configuration to audit (optional)' },
|
| 552 |
telemetryConfigContent: { type: 'string', description: 'Distributed eBPF telemetry pipeline manifest (optional)' },
|
| 553 |
hostTelemetryStream: { type: 'string', description: 'Host telemetry event stream JSON Lines (optional)' },
|
| 554 |
+
networkPolicyContent: { type: 'string', description: 'Cilium or K8s network policy content to audit (optional)' },
|
| 555 |
+
kernelFlowTelemetry: { type: 'string', description: 'Kernel flow telemetry events JSON or JSONL stream (optional)' },
|
| 556 |
verifyInSandbox: {
|
| 557 |
type: 'boolean',
|
| 558 |
description: 'Run automated canary sandbox verification on synthesized patches (default: true)'
|
|
|
|
| 867 |
};
|
| 868 |
}
|
| 869 |
|
| 870 |
+
case 'vulnforge_audit_microsegmentation': {
|
| 871 |
+
const content =
|
| 872 |
+
(args?.content as string) ||
|
| 873 |
+
(args?.policyContent as string) ||
|
| 874 |
+
'';
|
| 875 |
+
const filePath = (args?.filePath as string) || undefined;
|
| 876 |
+
const format = (args?.format as any) || undefined;
|
| 877 |
+
const flowEvents = (args?.flowEvents as any) || undefined;
|
| 878 |
+
const synthesisOptions = (args?.synthesisOptions as any) || undefined;
|
| 879 |
+
const enforceZeroTrustIngress = typeof args?.enforceZeroTrustIngress === 'boolean' ? args.enforceZeroTrustIngress : undefined;
|
| 880 |
+
const enforceMetadataEgressBlock = typeof args?.enforceMetadataEgressBlock === 'boolean' ? args.enforceMetadataEgressBlock : undefined;
|
| 881 |
+
const enforceDefaultDeny = typeof args?.enforceDefaultDeny === 'boolean' ? args.enforceDefaultDeny : undefined;
|
| 882 |
+
|
| 883 |
+
const result = auditMicrosegmentationSecurity({
|
| 884 |
+
content,
|
| 885 |
+
filePath,
|
| 886 |
+
format,
|
| 887 |
+
flowEvents,
|
| 888 |
+
synthesisOptions,
|
| 889 |
+
enforceZeroTrustIngress,
|
| 890 |
+
enforceMetadataEgressBlock,
|
| 891 |
+
enforceDefaultDeny
|
| 892 |
+
});
|
| 893 |
+
|
| 894 |
+
return {
|
| 895 |
+
content: [{ type: 'text', text: JSON.stringify(result, null, 2) }]
|
| 896 |
+
};
|
| 897 |
+
}
|
| 898 |
+
|
| 899 |
case 'vulnforge_full_scan': {
|
| 900 |
const headers = (args?.headers as Record<string, string>) || {};
|
| 901 |
const frontendCode = (args?.frontendCode as string) || '';
|
|
|
|
| 925 |
const cosignImageReference = (args?.cosignImageReference as string) || undefined;
|
| 926 |
const wasmContent = (args?.wasmContent as string) || (args?.telemetryConfigContent as string) || '';
|
| 927 |
const hostTelemetryStream = (args?.hostTelemetryStream as string) || undefined;
|
| 928 |
+
const networkPolicyContent = (args?.networkPolicyContent as string) || '';
|
| 929 |
+
const kernelFlowTelemetry = (args?.kernelFlowTelemetry as string) || undefined;
|
| 930 |
const verifyInSandbox = args?.verifyInSandbox !== false;
|
| 931 |
|
| 932 |
const allFindings: SecurityFinding[] = [];
|
|
|
|
| 1025 |
allFindings.push(...wasmEbpfReport.findings);
|
| 1026 |
}
|
| 1027 |
|
| 1028 |
+
let microsegmentationReport = undefined;
|
| 1029 |
+
if (networkPolicyContent || kernelFlowTelemetry) {
|
| 1030 |
+
microsegmentationReport = auditMicrosegmentationSecurity({
|
| 1031 |
+
content: networkPolicyContent,
|
| 1032 |
+
flowEvents: kernelFlowTelemetry
|
| 1033 |
+
});
|
| 1034 |
+
allFindings.push(...microsegmentationReport.findings);
|
| 1035 |
+
}
|
| 1036 |
+
|
| 1037 |
// Synthesize patches and verify in canary sandbox
|
| 1038 |
const combinedCode = [
|
| 1039 |
frontendCode,
|
src/patch/patch_engine.ts
CHANGED
|
@@ -819,6 +819,217 @@ export function synthesizeWasmEbpfArtifactPatch(
|
|
| 819 |
return { patched, resolvedFindings, changes };
|
| 820 |
}
|
| 821 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 822 |
export function synthesizeAndInjectPatch(req: PatchRequest): PatchInjectionResult {
|
| 823 |
let patched = req.sourceCode;
|
| 824 |
const resolvedFindings: string[] = [];
|
|
@@ -1547,6 +1758,34 @@ export function synthesizeAndInjectPatch(req: PatchRequest): PatchInjectionResul
|
|
| 1547 |
}
|
| 1548 |
}
|
| 1549 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1550 |
// Compute unified diff representation
|
| 1551 |
const originalLines = req.sourceCode.split('\n');
|
| 1552 |
const patchedLines = patched.split('\n');
|
|
|
|
| 819 |
return { patched, resolvedFindings, changes };
|
| 820 |
}
|
| 821 |
|
| 822 |
+
|
| 823 |
+
/**
|
| 824 |
+
* Synthesizes structured defensive patch recommendations for microsegmentation security findings.
|
| 825 |
+
*/
|
| 826 |
+
export function synthesizeMicrosegmentationPatch(
|
| 827 |
+
finding: SecurityFinding,
|
| 828 |
+
originalContent: string
|
| 829 |
+
): PatchRecommendation {
|
| 830 |
+
if (finding.patchRecommendation) {
|
| 831 |
+
return finding.patchRecommendation;
|
| 832 |
+
}
|
| 833 |
+
|
| 834 |
+
const id = finding.id || '';
|
| 835 |
+
const title = finding.title || '';
|
| 836 |
+
const target = finding.target || 'network-policy.yaml';
|
| 837 |
+
const targetFile = target.includes(':') ? target.split(':')[0] : target;
|
| 838 |
+
|
| 839 |
+
if (id.includes('MICROSEG-001') || id.includes('INGRESS') || title.includes('Wildcard Ingress')) {
|
| 840 |
+
return {
|
| 841 |
+
patchType: 'MICROSEG_ZERO_TRUST_INGRESS',
|
| 842 |
+
targetFile,
|
| 843 |
+
vulnerableSnippet: 'ingress:\n - {}',
|
| 844 |
+
patchedSnippet: 'ingress:\n - fromEndpoints:\n - matchLabels:\n app.kubernetes.io/name: frontend',
|
| 845 |
+
diff: `--- a/${targetFile}\n+++ b/${targetFile}\n@@ -1,2 +1,4 @@\n ingress:\n- - {}\n+ - fromEndpoints:\n+ - matchLabels:\n+ app.kubernetes.io/name: frontend`,
|
| 846 |
+
explanation: 'Replaces unbounded wildcard ingress with explicit Zero-Trust endpoint label selector.'
|
| 847 |
+
};
|
| 848 |
+
}
|
| 849 |
+
|
| 850 |
+
if (id.includes('MICROSEG-003') || id.includes('METADATA') || title.includes('Metadata')) {
|
| 851 |
+
return {
|
| 852 |
+
patchType: 'MICROSEG_METADATA_BLOCK',
|
| 853 |
+
targetFile,
|
| 854 |
+
vulnerableSnippet: '- toCIDR:\n - 0.0.0.0/0',
|
| 855 |
+
patchedSnippet: '- toCIDRSet:\n - cidr: 0.0.0.0/0\n except:\n - 169.254.169.254/32',
|
| 856 |
+
diff: `--- a/${targetFile}\n+++ b/${targetFile}\n@@ -1,2 +1,5 @@\n-- toCIDR:\n- - 0.0.0.0/0\n++ toCIDRSet:\n++ - cidr: 0.0.0.0/0\n++ except:\n++ - 169.254.169.254/32`,
|
| 857 |
+
explanation: 'Enforces explicit CIDR exclusion of cloud instance metadata IP (169.254.169.254/32).'
|
| 858 |
+
};
|
| 859 |
+
}
|
| 860 |
+
|
| 861 |
+
if (id.includes('MICROSEG-004') || id.includes('DENY') || title.includes('Default-Deny')) {
|
| 862 |
+
return {
|
| 863 |
+
patchType: 'MICROSEG_DEFAULT_DENY_INJECTION',
|
| 864 |
+
targetFile: 'default-deny-policy.yaml',
|
| 865 |
+
vulnerableSnippet: '# Missing default-deny baseline',
|
| 866 |
+
patchedSnippet: 'apiVersion: cilium.io/v2\nkind: CiliumNetworkPolicy\nmetadata:\n name: default-deny-all\nspec:\n endpointSelector: {}\n ingress: []\n egress:\n - toEntities: [kube-dns, cluster]',
|
| 867 |
+
diff: `--- a/default-deny-policy.yaml\n+++ b/default-deny-policy.yaml\n@@ -0,0 +1,9 @@\n+apiVersion: cilium.io/v2\n+kind: CiliumNetworkPolicy\n+metadata:\n+ name: default-deny-all\n+spec:\n+ endpointSelector: {}\n+ ingress: []`,
|
| 868 |
+
explanation: 'Injects baseline default-deny policy eliminating unmonitored default-allow access.'
|
| 869 |
+
};
|
| 870 |
+
}
|
| 871 |
+
|
| 872 |
+
if (id.includes('MICROSEG-005') || id.includes('PORT') || title.includes('Port')) {
|
| 873 |
+
return {
|
| 874 |
+
patchType: 'MICROSEG_PORT_PIN',
|
| 875 |
+
targetFile,
|
| 876 |
+
vulnerableSnippet: 'fromEndpoints:\n - matchLabels:\n app: api',
|
| 877 |
+
patchedSnippet: 'fromEndpoints:\n - matchLabels:\n app: api\ntoPorts:\n - ports:\n - port: "8443"\n protocol: TCP',
|
| 878 |
+
diff: `--- a/${targetFile}\n+++ b/${targetFile}\n@@ -1,3 +1,6 @@\n fromEndpoints:\n - matchLabels:\n app: api\n+toPorts:\n+ - ports:\n+ - port: "8443"\n+ protocol: TCP`,
|
| 879 |
+
explanation: 'Pins permitted endpoint traffic strictly to TCP port 8443.'
|
| 880 |
+
};
|
| 881 |
+
}
|
| 882 |
+
|
| 883 |
+
if (id.includes('MICROSEG-006') || id.includes('L7') || id.includes('HTTP') || title.includes('L7')) {
|
| 884 |
+
return {
|
| 885 |
+
patchType: 'MICROSEG_L7_HTTP_RULE',
|
| 886 |
+
targetFile,
|
| 887 |
+
vulnerableSnippet: 'toPorts:\n - ports:\n - port: "8080"\n protocol: TCP',
|
| 888 |
+
patchedSnippet: 'toPorts:\n - ports:\n - port: "8080"\n protocol: TCP\n rules:\n http:\n - method: "GET"\n path: "/api/v1/.*"\n - method: "POST"\n path: "/api/v1/.*"',
|
| 889 |
+
diff: `--- a/${targetFile}\n+++ b/${targetFile}\n@@ -2,2 +2,7 @@\n - ports:\n - port: "8080"\n protocol: TCP\n+ rules:\n+ http:\n+ - method: "GET"\n+ path: "/api/v1/.*"\n+ - method: "POST"\n+ path: "/api/v1/.*"`,
|
| 890 |
+
explanation: 'Injects L7 HTTP filtering rules restricting HTTP methods to GET and POST.'
|
| 891 |
+
};
|
| 892 |
+
}
|
| 893 |
+
|
| 894 |
+
return {
|
| 895 |
+
patchType: 'MICROSEG_HUBBLE_TELEMETRY',
|
| 896 |
+
targetFile,
|
| 897 |
+
vulnerableSnippet: 'metadata:\n name: app-policy',
|
| 898 |
+
patchedSnippet: 'metadata:\n name: app-policy\n annotations:\n flow.cilium.io/audit: "true"\n hubble.cilium.io/monitor: "enabled"',
|
| 899 |
+
diff: `--- a/${targetFile}\n+++ b/${targetFile}\n@@ -1,2 +1,5 @@\n metadata:\n name: app-policy\n+ annotations:\n+ flow.cilium.io/audit: "true"\n+ hubble.cilium.io/monitor: "enabled"`,
|
| 900 |
+
explanation: 'Injects Hubble eBPF flow audit logging annotations.'
|
| 901 |
+
};
|
| 902 |
+
}
|
| 903 |
+
|
| 904 |
+
/**
|
| 905 |
+
* Synthesizes automated defensive patches for microsegmentation network policies.
|
| 906 |
+
*/
|
| 907 |
+
export function synthesizeMicrosegmentationArtifactPatch(
|
| 908 |
+
sourceCode: string,
|
| 909 |
+
filename?: string
|
| 910 |
+
): { patched: string; resolvedFindings: string[]; changes: string[] } {
|
| 911 |
+
let patched = sourceCode;
|
| 912 |
+
const resolvedFindings: string[] = [];
|
| 913 |
+
const changes: string[] = [];
|
| 914 |
+
|
| 915 |
+
// 1. Tighten Wildcard Ingress
|
| 916 |
+
if (
|
| 917 |
+
/ingress\s*:\s*\[\s*\{\s*\}\s*\]/.test(patched) ||
|
| 918 |
+
/ingress:\s*\n\s*-\s*\{\s*\}/.test(patched) ||
|
| 919 |
+
/fromEntities\s*:\s*(?:\[\s*["']?(?:all|world)["']?\s*\]|\n\s*-\s*["']?(?:all|world)["']?)/i.test(patched) ||
|
| 920 |
+
/fromEndpoints\s*:\s*(?:\[\s*\{\s*\}\s*\]|\n\s*-\s*\{\s*\})/.test(patched) ||
|
| 921 |
+
/from:\s*(?:\[\s*\{\s*\}\s*\]|\n\s*-\s*\{\s*\})/.test(patched)
|
| 922 |
+
) {
|
| 923 |
+
if (/ingress\s*:\s*\[\s*\{\s*\}\s*\]/.test(patched)) {
|
| 924 |
+
patched = patched.replace(
|
| 925 |
+
/ingress\s*:\s*\[\s*\{\s*\}\s*\]/g,
|
| 926 |
+
'ingress:\n - fromEndpoints:\n - matchLabels:\n app.kubernetes.io/name: frontend'
|
| 927 |
+
);
|
| 928 |
+
} else if (/ingress:\s*\n\s*-\s*\{\s*\}/.test(patched)) {
|
| 929 |
+
patched = patched.replace(
|
| 930 |
+
/ingress:\s*\n\s*-\s*\{\s*\}/g,
|
| 931 |
+
'ingress:\n - fromEndpoints:\n - matchLabels:\n app.kubernetes.io/name: frontend'
|
| 932 |
+
);
|
| 933 |
+
} else if (/fromEntities\s*:\s*(?:\[\s*["']?(?:all|world)["']?\s*\]|\n\s*-\s*["']?(?:all|world)["']?)/i.test(patched)) {
|
| 934 |
+
patched = patched.replace(
|
| 935 |
+
/fromEntities\s*:\s*(?:\[\s*["']?(?:all|world)["']?\s*\]|\n\s*-\s*["']?(?:all|world)["']?)/gi,
|
| 936 |
+
'fromEndpoints:\n - matchLabels:\n app.kubernetes.io/name: frontend'
|
| 937 |
+
);
|
| 938 |
+
} else if (/fromEndpoints\s*:\s*(?:\[\s*\{\s*\}\s*\]|\n\s*-\s*\{\s*\})/.test(patched)) {
|
| 939 |
+
patched = patched.replace(
|
| 940 |
+
/fromEndpoints\s*:\s*(?:\[\s*\{\s*\}\s*\]|\n\s*-\s*\{\s*\})/g,
|
| 941 |
+
'fromEndpoints:\n - matchLabels:\n app.kubernetes.io/name: frontend'
|
| 942 |
+
);
|
| 943 |
+
} else if (/from:\s*(?:\[\s*\{\s*\}\s*\]|\n\s*-\s*\{\s*\})/.test(patched)) {
|
| 944 |
+
patched = patched.replace(
|
| 945 |
+
/from:\s*(?:\[\s*\{\s*\}\s*\]|\n\s*-\s*\{\s*\})/g,
|
| 946 |
+
'from:\n - podSelector:\n matchLabels:\n app.kubernetes.io/name: frontend'
|
| 947 |
+
);
|
| 948 |
+
}
|
| 949 |
+
resolvedFindings.push('MICROSEG-WILDCARD-INGRESS-RESTRICTED');
|
| 950 |
+
changes.push('Tighten wildcard ingress to Zero-Trust fromEndpoints matchLabels: frontend');
|
| 951 |
+
}
|
| 952 |
+
|
| 953 |
+
// 2. Block Cloud Metadata IP 169.254.169.254 in Egress
|
| 954 |
+
if (
|
| 955 |
+
(patched.includes('egress:') || patched.includes('toCIDR:')) &&
|
| 956 |
+
!patched.includes('169.254.169.254')
|
| 957 |
+
) {
|
| 958 |
+
if (/- toCIDR:\s*\n\s*-\s*0\.0\.0\.0\/0/.test(patched)) {
|
| 959 |
+
patched = patched.replace(
|
| 960 |
+
/- toCIDR:\s*\n\s*-\s*0\.0\.0\.0\/0/g,
|
| 961 |
+
'- toCIDRSet:\n - cidr: 0.0.0.0/0\n except:\n - 169.254.169.254/32'
|
| 962 |
+
);
|
| 963 |
+
resolvedFindings.push('MICROSEG-METADATA-EGRESS-BLOCKED');
|
| 964 |
+
changes.push('Inject explicit except: 169.254.169.254/32 into egress CIDR set');
|
| 965 |
+
} else if (/toEntities\s*:\s*(?:\[\s*["']?(?:all|world)["']?\s*\]|\n\s*-\s*["']?(?:all|world)["']?)/i.test(patched)) {
|
| 966 |
+
patched = patched.replace(
|
| 967 |
+
/toEntities\s*:\s*(?:\[\s*["']?(?:all|world)["']?\s*\]|\n\s*-\s*["']?(?:all|world)["']?)/gi,
|
| 968 |
+
'toCIDRSet:\n - cidr: 0.0.0.0/0\n except:\n - 169.254.169.254/32'
|
| 969 |
+
);
|
| 970 |
+
resolvedFindings.push('MICROSEG-METADATA-EGRESS-BLOCKED');
|
| 971 |
+
changes.push('Replace unbounded world egress with toCIDRSet blocking 169.254.169.254/32');
|
| 972 |
+
} else if (patched.includes('ipBlock:') && !patched.includes('except:')) {
|
| 973 |
+
patched = patched.replace(
|
| 974 |
+
/(ipBlock:\s*\n\s*cidr:\s*0\.0\.0\.0\/0)/,
|
| 975 |
+
'$1\n except:\n - 169.254.169.254/32'
|
| 976 |
+
);
|
| 977 |
+
resolvedFindings.push('MICROSEG-METADATA-EGRESS-BLOCKED');
|
| 978 |
+
changes.push('Inject except: 169.254.169.254/32 into K8s NetworkPolicy ipBlock');
|
| 979 |
+
}
|
| 980 |
+
}
|
| 981 |
+
|
| 982 |
+
// 3. Inject Hubble Flow Telemetry Annotations
|
| 983 |
+
if (
|
| 984 |
+
(patched.includes('cilium.io/v2') || patched.includes('CiliumNetworkPolicy')) &&
|
| 985 |
+
!patched.includes('flow.cilium.io/audit')
|
| 986 |
+
) {
|
| 987 |
+
if (patched.includes('annotations:')) {
|
| 988 |
+
patched = patched.replace(
|
| 989 |
+
/(annotations:\s*\n)/,
|
| 990 |
+
'$1 flow.cilium.io/audit: "true"\n hubble.cilium.io/monitor: "enabled"\n'
|
| 991 |
+
);
|
| 992 |
+
} else if (patched.includes('metadata:')) {
|
| 993 |
+
patched = patched.replace(
|
| 994 |
+
/(metadata:\s*\n)/,
|
| 995 |
+
'$1 annotations:\n flow.cilium.io/audit: "true"\n hubble.cilium.io/monitor: "enabled"\n'
|
| 996 |
+
);
|
| 997 |
+
}
|
| 998 |
+
resolvedFindings.push('MICROSEG-HUBBLE-TELEMETRY-INJECTED');
|
| 999 |
+
changes.push('Inject flow.cilium.io/audit and hubble.cilium.io/monitor annotations');
|
| 1000 |
+
}
|
| 1001 |
+
|
| 1002 |
+
// 4. Inject L7 HTTP Rules if targeting HTTP ports without rules
|
| 1003 |
+
if (
|
| 1004 |
+
(patched.includes('port: "80"') || patched.includes('port: "8080"') || patched.includes('port: "3000"')) &&
|
| 1005 |
+
!patched.includes('rules:') &&
|
| 1006 |
+
(patched.includes('toPorts:') || patched.includes('cilium.io'))
|
| 1007 |
+
) {
|
| 1008 |
+
patched = patched.replace(
|
| 1009 |
+
/(protocol:\s*TCP\b)/,
|
| 1010 |
+
'$1\n rules:\n http:\n - method: "GET"\n path: "/api/v1/.*"\n - method: "POST"\n path: "/api/v1/.*"'
|
| 1011 |
+
);
|
| 1012 |
+
resolvedFindings.push('MICROSEG-L7-HTTP-RULE-INJECTED');
|
| 1013 |
+
changes.push('Inject L7 HTTP method and path verification rules');
|
| 1014 |
+
}
|
| 1015 |
+
|
| 1016 |
+
// 5. Pin Unbounded Ports
|
| 1017 |
+
if (
|
| 1018 |
+
patched.includes('fromEndpoints:') &&
|
| 1019 |
+
!patched.includes('toPorts:') &&
|
| 1020 |
+
!patched.includes('ports:')
|
| 1021 |
+
) {
|
| 1022 |
+
patched = patched.replace(
|
| 1023 |
+
/(fromEndpoints:\s*\n(?:\s*-[^\n]+\n)+)/,
|
| 1024 |
+
'$1 toPorts:\n - ports:\n - port: "8443"\n protocol: TCP\n'
|
| 1025 |
+
);
|
| 1026 |
+
resolvedFindings.push('MICROSEG-PORT-PINNED');
|
| 1027 |
+
changes.push('Pin unbounded endpoint traffic to TCP port 8443');
|
| 1028 |
+
}
|
| 1029 |
+
|
| 1030 |
+
return { patched, resolvedFindings, changes };
|
| 1031 |
+
}
|
| 1032 |
+
|
| 1033 |
export function synthesizeAndInjectPatch(req: PatchRequest): PatchInjectionResult {
|
| 1034 |
let patched = req.sourceCode;
|
| 1035 |
const resolvedFindings: string[] = [];
|
|
|
|
| 1758 |
}
|
| 1759 |
}
|
| 1760 |
|
| 1761 |
+
// 20. Distributed eBPF Microsegmentation & Policy Synthesis Automated Defensive Patches
|
| 1762 |
+
const isMicrosegmentation =
|
| 1763 |
+
Boolean(
|
| 1764 |
+
req.filename && (
|
| 1765 |
+
req.filename.includes('microseg') ||
|
| 1766 |
+
req.filename.includes('cilium') ||
|
| 1767 |
+
req.filename.includes('networkpolicy') ||
|
| 1768 |
+
req.filename.includes('network-policy') ||
|
| 1769 |
+
req.filename.endsWith('.cnp.yaml') ||
|
| 1770 |
+
req.filename.endsWith('.gnp.yaml')
|
| 1771 |
+
)
|
| 1772 |
+
) ||
|
| 1773 |
+
patched.includes('cilium.io/v2') ||
|
| 1774 |
+
patched.includes('CiliumNetworkPolicy') ||
|
| 1775 |
+
patched.includes('fromEndpoints:') ||
|
| 1776 |
+
patched.includes('toEndpoints:') ||
|
| 1777 |
+
patched.includes('toEntities:') ||
|
| 1778 |
+
(patched.includes('kind: NetworkPolicy') && (patched.includes('podSelector:') || patched.includes('policyTypes:')));
|
| 1779 |
+
|
| 1780 |
+
if (isMicrosegmentation) {
|
| 1781 |
+
const microsegPatch = synthesizeMicrosegmentationArtifactPatch(patched, req.filename);
|
| 1782 |
+
if (microsegPatch.changes.length > 0) {
|
| 1783 |
+
patched = microsegPatch.patched;
|
| 1784 |
+
resolvedFindings.push(...microsegPatch.resolvedFindings);
|
| 1785 |
+
changes.push(...microsegPatch.changes);
|
| 1786 |
+
}
|
| 1787 |
+
}
|
| 1788 |
+
|
| 1789 |
// Compute unified diff representation
|
| 1790 |
const originalLines = req.sourceCode.split('\n');
|
| 1791 |
const patchedLines = patched.split('\n');
|
src/sandbox/canary_runner.ts
CHANGED
|
@@ -209,6 +209,25 @@ function inferVulnerabilityType(originalCode: string, patchedCode: string): stri
|
|
| 209 |
) {
|
| 210 |
return "COSIGN_SIGNATURE_ATTESTATION";
|
| 211 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 212 |
return 'GENERIC_SECURITY';
|
| 213 |
}
|
| 214 |
|
|
@@ -307,6 +326,33 @@ export async function executeCanaryVerification(
|
|
| 307 |
benignPayload = benignPayload || JSON.stringify({ action: 's3:GetObject', resource: 'arn:aws:s3:::production-app-data/file.txt', secureTransport: true });
|
| 308 |
break;
|
| 309 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 310 |
case "SBOM_DEPENDENCY_CONFUSION":
|
| 311 |
attackPayload = attackPayload || "@internal/core";
|
| 312 |
benignPayload = benignPayload || "lodash";
|
|
|
|
| 209 |
) {
|
| 210 |
return "COSIGN_SIGNATURE_ATTESTATION";
|
| 211 |
}
|
| 212 |
+
if (
|
| 213 |
+
combined.includes('MICROSEG_') ||
|
| 214 |
+
combined.includes('fromEndpoints') ||
|
| 215 |
+
combined.includes('toEndpoints') ||
|
| 216 |
+
combined.includes('toEntities') ||
|
| 217 |
+
combined.includes('fromEntities') ||
|
| 218 |
+
combined.includes('CiliumNetworkPolicy') ||
|
| 219 |
+
combined.includes('cilium.io') ||
|
| 220 |
+
combined.includes('169.254.169.254') ||
|
| 221 |
+
(combined.includes('kind: NetworkPolicy') && (combined.includes('ingress:') || combined.includes('egress:')))
|
| 222 |
+
) {
|
| 223 |
+
if (combined.includes('169.254.169.254')) return 'MICROSEG_METADATA_EGRESS';
|
| 224 |
+
if (combined.includes('MICROSEG_WILDCARD_INGRESS') || (combined.includes('ingress:') && combined.includes('{}'))) return 'MICROSEG_WILDCARD_INGRESS';
|
| 225 |
+
if (combined.includes('MICROSEG_DEFAULT_DENY') || combined.includes('default-deny')) return 'MICROSEG_MISSING_DEFAULT_DENY';
|
| 226 |
+
if (combined.includes('MICROSEG_L7') || (combined.includes('rules:') && combined.includes('http:'))) return 'MICROSEG_UNINSPECTED_L7';
|
| 227 |
+
if (combined.includes('MICROSEG_PORT') || combined.includes('toPorts:')) return 'MICROSEG_UNBOUNDED_PORTS';
|
| 228 |
+
return 'MICROSEG_WILDCARD_INGRESS';
|
| 229 |
+
}
|
| 230 |
+
|
| 231 |
return 'GENERIC_SECURITY';
|
| 232 |
}
|
| 233 |
|
|
|
|
| 326 |
benignPayload = benignPayload || JSON.stringify({ action: 's3:GetObject', resource: 'arn:aws:s3:::production-app-data/file.txt', secureTransport: true });
|
| 327 |
break;
|
| 328 |
|
| 329 |
+
case 'MICROSEG_WILDCARD_INGRESS':
|
| 330 |
+
case 'MICROSEG_WILDCARD_EGRESS':
|
| 331 |
+
case 'MICROSEG_METADATA_EGRESS':
|
| 332 |
+
case 'MICROSEG_MISSING_DEFAULT_DENY':
|
| 333 |
+
case 'MICROSEG_UNBOUNDED_PORTS':
|
| 334 |
+
case 'MICROSEG_UNINSPECTED_L7':
|
| 335 |
+
case 'MICROSEG_CROSS_NAMESPACE':
|
| 336 |
+
case 'MICROSEG_MISSING_FLOW_TELEMETRY':
|
| 337 |
+
attackPayload = attackPayload || JSON.stringify({
|
| 338 |
+
sourcePod: 'untrusted-attacker-pod',
|
| 339 |
+
destinationPod: 'backend-db',
|
| 340 |
+
destinationPort: 5432,
|
| 341 |
+
destinationIp: '169.254.169.254',
|
| 342 |
+
isMetadataService: true,
|
| 343 |
+
protocol: 'TCP'
|
| 344 |
+
});
|
| 345 |
+
benignPayload = benignPayload || JSON.stringify({
|
| 346 |
+
sourcePod: 'frontend',
|
| 347 |
+
sourceLabels: { 'app': 'frontend', 'app.kubernetes.io/name': 'frontend' },
|
| 348 |
+
destinationPod: 'backend-service',
|
| 349 |
+
destinationPort: 8443,
|
| 350 |
+
protocol: 'TCP',
|
| 351 |
+
httpMethod: 'GET',
|
| 352 |
+
httpPath: '/api/v1/health'
|
| 353 |
+
});
|
| 354 |
+
break;
|
| 355 |
+
|
| 356 |
case "SBOM_DEPENDENCY_CONFUSION":
|
| 357 |
attackPayload = attackPayload || "@internal/core";
|
| 358 |
benignPayload = benignPayload || "lodash";
|
src/sandbox/canary_sandbox.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { z } from 'zod';
|
|
| 7 |
import vm from 'node:vm';
|
| 8 |
import { performance } from 'node:perf_hooks';
|
| 9 |
import { evaluateIamAccessRequest } from '../iam/iam_audit.js';
|
|
|
|
| 10 |
|
| 11 |
export interface RecordedQuery {
|
| 12 |
sql: string;
|
|
@@ -695,6 +696,7 @@ export interface CanarySandboxExecutionResult {
|
|
| 695 |
sbomHarness?: MockSbomHarness;
|
| 696 |
cosignHarness?: MockCosignHarness;
|
| 697 |
wasmEbpfHarness?: MockWasmEbpfHarness;
|
|
|
|
| 698 |
}
|
| 699 |
|
| 700 |
/**
|
|
@@ -1528,6 +1530,315 @@ export function isSbomOrManifestContent(content: string): boolean {
|
|
| 1528 |
);
|
| 1529 |
}
|
| 1530 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1531 |
export async function runInCanarySandbox(
|
| 1532 |
code: string,
|
| 1533 |
customContext: Record<string, any> = {},
|
|
@@ -1549,6 +1860,34 @@ export async function runInCanarySandbox(
|
|
| 1549 |
const sbomHarness = new MockSbomHarness();
|
| 1550 |
const cosignHarness = new MockCosignHarness();
|
| 1551 |
const wasmEbpfHarness = new MockWasmEbpfHarness();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1552 |
|
| 1553 |
// If input is a WebAssembly runtime config or eBPF telemetry manifest
|
| 1554 |
if (isWasmOrTelemetryContent(code)) {
|
|
@@ -2005,6 +2344,9 @@ export async function runInCanarySandbox(
|
|
| 2005 |
wasmEbpfHarness,
|
| 2006 |
MockWasmEbpfHarness,
|
| 2007 |
wasm: wasmEbpfHarness,
|
|
|
|
|
|
|
|
|
|
| 2008 |
UserSchema: {
|
| 2009 |
parse: (body: any) => ({
|
| 2010 |
name: body?.name || 'safe_user',
|
|
|
|
| 7 |
import vm from 'node:vm';
|
| 8 |
import { performance } from 'node:perf_hooks';
|
| 9 |
import { evaluateIamAccessRequest } from '../iam/iam_audit.js';
|
| 10 |
+
import { KernelFlowEvent, KernelFlowVerdict } from '../types/index.js';
|
| 11 |
|
| 12 |
export interface RecordedQuery {
|
| 13 |
sql: string;
|
|
|
|
| 696 |
sbomHarness?: MockSbomHarness;
|
| 697 |
cosignHarness?: MockCosignHarness;
|
| 698 |
wasmEbpfHarness?: MockWasmEbpfHarness;
|
| 699 |
+
microsegmentationHarness?: MockMicrosegmentationHarness;
|
| 700 |
}
|
| 701 |
|
| 702 |
/**
|
|
|
|
| 1530 |
);
|
| 1531 |
}
|
| 1532 |
|
| 1533 |
+
|
| 1534 |
+
export class MockMicrosegmentationHarness {
|
| 1535 |
+
public rawPolicies: string[] = [];
|
| 1536 |
+
public hasDefaultDeny: boolean = false;
|
| 1537 |
+
public blockedCidrs: Set<string> = new Set();
|
| 1538 |
+
public allowedIngressRules: Array<{
|
| 1539 |
+
labels?: Record<string, string>;
|
| 1540 |
+
ports?: number[];
|
| 1541 |
+
protocol?: string;
|
| 1542 |
+
httpMethods?: string[];
|
| 1543 |
+
httpPaths?: string[];
|
| 1544 |
+
wildcard?: boolean;
|
| 1545 |
+
}> = [];
|
| 1546 |
+
public allowedEgressRules: Array<{
|
| 1547 |
+
labels?: Record<string, string>;
|
| 1548 |
+
cidrs?: string[];
|
| 1549 |
+
exceptCidrs?: string[];
|
| 1550 |
+
ports?: number[];
|
| 1551 |
+
wildcard?: boolean;
|
| 1552 |
+
}> = [];
|
| 1553 |
+
public hubbleAuditEnabled: boolean = false;
|
| 1554 |
+
public logs: string[] = [];
|
| 1555 |
+
|
| 1556 |
+
public capturePolicy(policyYamlOrJson: string): void {
|
| 1557 |
+
if (!policyYamlOrJson) return;
|
| 1558 |
+
this.rawPolicies.push(policyYamlOrJson);
|
| 1559 |
+
|
| 1560 |
+
// Default deny detection
|
| 1561 |
+
if (
|
| 1562 |
+
policyYamlOrJson.includes('default-deny') ||
|
| 1563 |
+
(policyYamlOrJson.includes('endpointSelector: {}') && policyYamlOrJson.includes('ingress: []')) ||
|
| 1564 |
+
(policyYamlOrJson.includes('policyTypes:') && policyYamlOrJson.includes('Ingress') && policyYamlOrJson.includes('podSelector: {}'))
|
| 1565 |
+
) {
|
| 1566 |
+
this.hasDefaultDeny = true;
|
| 1567 |
+
}
|
| 1568 |
+
|
| 1569 |
+
// Hubble / Flow Telemetry detection
|
| 1570 |
+
if (policyYamlOrJson.includes('flow.cilium.io/audit') || policyYamlOrJson.includes('hubble.cilium.io/monitor')) {
|
| 1571 |
+
this.hubbleAuditEnabled = true;
|
| 1572 |
+
}
|
| 1573 |
+
|
| 1574 |
+
// Metadata block detection
|
| 1575 |
+
if (
|
| 1576 |
+
policyYamlOrJson.includes('169.254.169.254/32') &&
|
| 1577 |
+
(policyYamlOrJson.includes('except:') || policyYamlOrJson.includes('deny:'))
|
| 1578 |
+
) {
|
| 1579 |
+
this.blockedCidrs.add('169.254.169.254/32');
|
| 1580 |
+
}
|
| 1581 |
+
|
| 1582 |
+
// Parse Ingress Rules
|
| 1583 |
+
const ingressIdx = policyYamlOrJson.indexOf('ingress:');
|
| 1584 |
+
const egressIdx = policyYamlOrJson.indexOf('egress:');
|
| 1585 |
+
|
| 1586 |
+
if (ingressIdx !== -1) {
|
| 1587 |
+
const ingressText = egressIdx > -1 && egressIdx > ingressIdx
|
| 1588 |
+
? policyYamlOrJson.substring(ingressIdx, egressIdx)
|
| 1589 |
+
: policyYamlOrJson.substring(ingressIdx);
|
| 1590 |
+
|
| 1591 |
+
if (
|
| 1592 |
+
/ingress\s*:\s*\[\s*\{\s*\}\s*\]/.test(ingressText) ||
|
| 1593 |
+
/ingress:\s*\n\s*-\s*\{\s*\}/.test(ingressText) ||
|
| 1594 |
+
/fromEntities\s*:\s*(?:\[\s*["']?(?:all|world)["']?\s*\]|\n\s*-\s*["']?(?:all|world)["']?)/i.test(ingressText) ||
|
| 1595 |
+
/fromEndpoints\s*:\s*(?:\[\s*\{\s*\}\s*\]|\n\s*-\s*\{\s*\})/.test(ingressText) ||
|
| 1596 |
+
/from:\s*(?:\[\s*\{\s*\}\s*\]|\n\s*-\s*\{\s*\})/.test(ingressText)
|
| 1597 |
+
) {
|
| 1598 |
+
this.allowedIngressRules.push({ wildcard: true });
|
| 1599 |
+
} else {
|
| 1600 |
+
const rule: {
|
| 1601 |
+
labels?: Record<string, string>;
|
| 1602 |
+
ports?: number[];
|
| 1603 |
+
protocol?: string;
|
| 1604 |
+
httpMethods?: string[];
|
| 1605 |
+
httpPaths?: string[];
|
| 1606 |
+
} = {};
|
| 1607 |
+
|
| 1608 |
+
const portMatches = [...ingressText.matchAll(/port\s*:\s*["']?([0-9]+)["']?/g)];
|
| 1609 |
+
if (portMatches.length > 0) {
|
| 1610 |
+
rule.ports = portMatches.map((m) => parseInt(m[1], 10));
|
| 1611 |
+
}
|
| 1612 |
+
|
| 1613 |
+
const labelMatch = /(?:app|name|app\.kubernetes\.io\/name)\s*:\s*["']?([a-zA-Z0-9_-]+)["']?/.exec(ingressText);
|
| 1614 |
+
if (labelMatch) {
|
| 1615 |
+
rule.labels = { 'app': labelMatch[1] };
|
| 1616 |
+
}
|
| 1617 |
+
|
| 1618 |
+
if (ingressText.includes('rules:') && ingressText.includes('http:')) {
|
| 1619 |
+
const methodMatches = [...ingressText.matchAll(/method\s*:\s*["']?([A-Z]+)["']?/g)];
|
| 1620 |
+
rule.httpMethods = methodMatches.map((m) => m[1]);
|
| 1621 |
+
const pathMatches = [...ingressText.matchAll(/path\s*:\s*["']?([^"'\n]+)["']?/g)];
|
| 1622 |
+
rule.httpPaths = pathMatches.map((m) => m[1]);
|
| 1623 |
+
}
|
| 1624 |
+
|
| 1625 |
+
this.allowedIngressRules.push(rule);
|
| 1626 |
+
}
|
| 1627 |
+
}
|
| 1628 |
+
|
| 1629 |
+
// Parse Egress Rules
|
| 1630 |
+
if (policyYamlOrJson.includes('egress:')) {
|
| 1631 |
+
if (
|
| 1632 |
+
/egress\s*:\s*\[\s*\{\s*\}\s*\]/.test(policyYamlOrJson) ||
|
| 1633 |
+
/toEntities\s*:\s*\[\s*["'](?:all|world)["']\s*\]/i.test(policyYamlOrJson) ||
|
| 1634 |
+
/toEndpoints\s*:\s*\[\s*\{\s*\}\s*\]/.test(policyYamlOrJson) ||
|
| 1635 |
+
/to:\s*\[\s*\{\s*\}\s*\]/.test(policyYamlOrJson)
|
| 1636 |
+
) {
|
| 1637 |
+
this.allowedEgressRules.push({ wildcard: true });
|
| 1638 |
+
} else {
|
| 1639 |
+
const rule: {
|
| 1640 |
+
labels?: Record<string, string>;
|
| 1641 |
+
cidrs?: string[];
|
| 1642 |
+
exceptCidrs?: string[];
|
| 1643 |
+
ports?: number[];
|
| 1644 |
+
} = {};
|
| 1645 |
+
|
| 1646 |
+
if (policyYamlOrJson.includes('169.254.169.254/32')) {
|
| 1647 |
+
rule.exceptCidrs = ['169.254.169.254/32'];
|
| 1648 |
+
}
|
| 1649 |
+
|
| 1650 |
+
const portMatches = [...policyYamlOrJson.matchAll(/port\s*:\s*["']?([0-9]+)["']?/g)];
|
| 1651 |
+
if (portMatches.length > 0) {
|
| 1652 |
+
rule.ports = portMatches.map((m) => parseInt(m[1], 10));
|
| 1653 |
+
}
|
| 1654 |
+
|
| 1655 |
+
this.allowedEgressRules.push(rule);
|
| 1656 |
+
}
|
| 1657 |
+
}
|
| 1658 |
+
}
|
| 1659 |
+
|
| 1660 |
+
public evaluateFlow(flow: KernelFlowEvent): {
|
| 1661 |
+
verdict: KernelFlowVerdict;
|
| 1662 |
+
allowed: boolean;
|
| 1663 |
+
reason: string;
|
| 1664 |
+
matchedRule?: string;
|
| 1665 |
+
} {
|
| 1666 |
+
// 1. Cloud metadata egress check
|
| 1667 |
+
if (
|
| 1668 |
+
flow.isMetadataService ||
|
| 1669 |
+
flow.destinationIp === '169.254.169.254' ||
|
| 1670 |
+
flow.destinationIp === '100.100.100.200' ||
|
| 1671 |
+
flow.destinationPod === 'cloud-metadata-service'
|
| 1672 |
+
) {
|
| 1673 |
+
if (this.blockedCidrs.has('169.254.169.254/32')) {
|
| 1674 |
+
this.logs.push(`[eBPF Drop] Flow to metadata service ${flow.destinationIp} dropped by explicit except CIDR`);
|
| 1675 |
+
return {
|
| 1676 |
+
verdict: 'DROPPED',
|
| 1677 |
+
allowed: false,
|
| 1678 |
+
reason: 'Cloud metadata IP 169.254.169.254/32 is explicitly blocked by zero-trust egress filter'
|
| 1679 |
+
};
|
| 1680 |
+
}
|
| 1681 |
+
if (this.allowedEgressRules.some((r) => r.wildcard)) {
|
| 1682 |
+
return {
|
| 1683 |
+
verdict: 'FORWARDED',
|
| 1684 |
+
allowed: true,
|
| 1685 |
+
reason: 'Unrestricted wildcard egress allowed access to cloud metadata service'
|
| 1686 |
+
};
|
| 1687 |
+
}
|
| 1688 |
+
}
|
| 1689 |
+
|
| 1690 |
+
// 2. Ingress evaluation
|
| 1691 |
+
const isIngress = Boolean(flow.sourcePod || flow.sourceLabels || flow.sourceIp);
|
| 1692 |
+
if (isIngress && this.allowedIngressRules.length > 0) {
|
| 1693 |
+
if (this.allowedIngressRules.some((r) => r.wildcard)) {
|
| 1694 |
+
return {
|
| 1695 |
+
verdict: 'FORWARDED',
|
| 1696 |
+
allowed: true,
|
| 1697 |
+
reason: 'Wildcard ingress rule permitted connection',
|
| 1698 |
+
matchedRule: 'wildcard-ingress'
|
| 1699 |
+
};
|
| 1700 |
+
}
|
| 1701 |
+
|
| 1702 |
+
for (const rule of this.allowedIngressRules) {
|
| 1703 |
+
let labelMatched = true;
|
| 1704 |
+
if (rule.labels && flow.sourceLabels) {
|
| 1705 |
+
for (const [k, v] of Object.entries(rule.labels)) {
|
| 1706 |
+
const flowVal = flow.sourceLabels[k] || flow.sourceLabels['app.kubernetes.io/name'];
|
| 1707 |
+
if (flowVal !== v && flow.sourcePod !== v) {
|
| 1708 |
+
labelMatched = false;
|
| 1709 |
+
}
|
| 1710 |
+
}
|
| 1711 |
+
} else if (rule.labels && !flow.sourceLabels && flow.sourcePod) {
|
| 1712 |
+
if (!Object.values(rule.labels).includes(flow.sourcePod)) {
|
| 1713 |
+
labelMatched = false;
|
| 1714 |
+
}
|
| 1715 |
+
}
|
| 1716 |
+
|
| 1717 |
+
let portMatched = true;
|
| 1718 |
+
if (rule.ports && rule.ports.length > 0 && flow.destinationPort) {
|
| 1719 |
+
portMatched = rule.ports.includes(flow.destinationPort);
|
| 1720 |
+
}
|
| 1721 |
+
|
| 1722 |
+
let l7Matched = true;
|
| 1723 |
+
if (rule.httpMethods && rule.httpMethods.length > 0 && flow.httpMethod) {
|
| 1724 |
+
l7Matched = rule.httpMethods.includes(flow.httpMethod.toUpperCase());
|
| 1725 |
+
}
|
| 1726 |
+
|
| 1727 |
+
if (labelMatched && portMatched && l7Matched) {
|
| 1728 |
+
return {
|
| 1729 |
+
verdict: 'FORWARDED',
|
| 1730 |
+
allowed: true,
|
| 1731 |
+
reason: 'Flow matched active Zero-Trust CiliumNetworkPolicy rule',
|
| 1732 |
+
matchedRule: 'label-and-port-match'
|
| 1733 |
+
};
|
| 1734 |
+
}
|
| 1735 |
+
}
|
| 1736 |
+
|
| 1737 |
+
return {
|
| 1738 |
+
verdict: 'DROPPED',
|
| 1739 |
+
allowed: false,
|
| 1740 |
+
reason: 'Flow rejected: does not match any allowed ingress label or port pin',
|
| 1741 |
+
matchedRule: 'default-deny-ingress'
|
| 1742 |
+
};
|
| 1743 |
+
}
|
| 1744 |
+
|
| 1745 |
+
if (this.hasDefaultDeny) {
|
| 1746 |
+
return {
|
| 1747 |
+
verdict: 'DROPPED',
|
| 1748 |
+
allowed: false,
|
| 1749 |
+
reason: 'Flow dropped by baseline default-deny policy',
|
| 1750 |
+
matchedRule: 'default-deny'
|
| 1751 |
+
};
|
| 1752 |
+
}
|
| 1753 |
+
|
| 1754 |
+
return {
|
| 1755 |
+
verdict: 'FORWARDED',
|
| 1756 |
+
allowed: true,
|
| 1757 |
+
reason: 'No policy or default-deny configured: default-allow applied'
|
| 1758 |
+
};
|
| 1759 |
+
}
|
| 1760 |
+
|
| 1761 |
+
public verifyPolicyDefense(
|
| 1762 |
+
attackFlows: KernelFlowEvent[],
|
| 1763 |
+
benignFlows: KernelFlowEvent[]
|
| 1764 |
+
): {
|
| 1765 |
+
attackBlocked: boolean;
|
| 1766 |
+
benignPreserved: boolean;
|
| 1767 |
+
droppedAttacks: number;
|
| 1768 |
+
passedBenign: number;
|
| 1769 |
+
details: string[];
|
| 1770 |
+
} {
|
| 1771 |
+
const details: string[] = [];
|
| 1772 |
+
let droppedAttacks = 0;
|
| 1773 |
+
let passedBenign = 0;
|
| 1774 |
+
|
| 1775 |
+
for (const af of attackFlows) {
|
| 1776 |
+
const res = this.evaluateFlow(af);
|
| 1777 |
+
if (res.verdict === 'DROPPED') {
|
| 1778 |
+
droppedAttacks++;
|
| 1779 |
+
details.push(`[Attack Blocked] Attack flow from ${af.sourcePod || af.sourceIp} to ${af.destinationPod || af.destinationIp}:${af.destinationPort} DROPPED: ${res.reason}`);
|
| 1780 |
+
} else {
|
| 1781 |
+
details.push(`[Attack Leaked] Attack flow from ${af.sourcePod || af.sourceIp} to ${af.destinationPod || af.destinationIp}:${af.destinationPort} FORWARDED!`);
|
| 1782 |
+
}
|
| 1783 |
+
}
|
| 1784 |
+
|
| 1785 |
+
for (const bf of benignFlows) {
|
| 1786 |
+
const res = this.evaluateFlow(bf);
|
| 1787 |
+
if (res.verdict === 'FORWARDED') {
|
| 1788 |
+
passedBenign++;
|
| 1789 |
+
details.push(`[Benign Forwarded] Legitimate flow from ${bf.sourcePod || bf.sourceIp} to ${bf.destinationPod || bf.destinationIp}:${bf.destinationPort} FORWARDED.`);
|
| 1790 |
+
} else {
|
| 1791 |
+
details.push(`[Benign Regression] Legitimate flow from ${bf.sourcePod || bf.sourceIp} to ${bf.destinationPod || bf.destinationIp}:${bf.destinationPort} was unexpectedly DROPPED: ${res.reason}`);
|
| 1792 |
+
}
|
| 1793 |
+
}
|
| 1794 |
+
|
| 1795 |
+
const attackBlocked = attackFlows.length === 0 || droppedAttacks === attackFlows.length;
|
| 1796 |
+
const benignPreserved = benignFlows.length === 0 || passedBenign === benignFlows.length;
|
| 1797 |
+
|
| 1798 |
+
return {
|
| 1799 |
+
attackBlocked,
|
| 1800 |
+
benignPreserved,
|
| 1801 |
+
droppedAttacks,
|
| 1802 |
+
passedBenign,
|
| 1803 |
+
details
|
| 1804 |
+
};
|
| 1805 |
+
}
|
| 1806 |
+
|
| 1807 |
+
public reset(): void {
|
| 1808 |
+
this.rawPolicies = [];
|
| 1809 |
+
this.hasDefaultDeny = false;
|
| 1810 |
+
this.blockedCidrs.clear();
|
| 1811 |
+
this.allowedIngressRules = [];
|
| 1812 |
+
this.allowedEgressRules = [];
|
| 1813 |
+
this.hubbleAuditEnabled = false;
|
| 1814 |
+
this.logs = [];
|
| 1815 |
+
}
|
| 1816 |
+
}
|
| 1817 |
+
|
| 1818 |
+
export function isMicrosegmentationPolicyContent(content: string): boolean {
|
| 1819 |
+
const trimmed = content.trim();
|
| 1820 |
+
if (
|
| 1821 |
+
trimmed.includes('#include') ||
|
| 1822 |
+
trimmed.includes('#pragma') ||
|
| 1823 |
+
trimmed.includes('#define') ||
|
| 1824 |
+
trimmed.includes('SEC(') ||
|
| 1825 |
+
trimmed.includes('<linux/bpf.h>')
|
| 1826 |
+
) {
|
| 1827 |
+
return false;
|
| 1828 |
+
}
|
| 1829 |
+
return (
|
| 1830 |
+
trimmed.includes('cilium.io/v2') ||
|
| 1831 |
+
trimmed.includes('CiliumNetworkPolicy') ||
|
| 1832 |
+
trimmed.includes('CiliumClusterwideNetworkPolicy') ||
|
| 1833 |
+
trimmed.includes('fromEndpoints:') ||
|
| 1834 |
+
trimmed.includes('toEndpoints:') ||
|
| 1835 |
+
trimmed.includes('toEntities:') ||
|
| 1836 |
+
trimmed.includes('fromEntities:') ||
|
| 1837 |
+
trimmed.includes('toCIDRSet:') ||
|
| 1838 |
+
(trimmed.includes('kind: NetworkPolicy') && (trimmed.includes('podSelector:') || trimmed.includes('policyTypes:')))
|
| 1839 |
+
);
|
| 1840 |
+
}
|
| 1841 |
+
|
| 1842 |
export async function runInCanarySandbox(
|
| 1843 |
code: string,
|
| 1844 |
customContext: Record<string, any> = {},
|
|
|
|
| 1860 |
const sbomHarness = new MockSbomHarness();
|
| 1861 |
const cosignHarness = new MockCosignHarness();
|
| 1862 |
const wasmEbpfHarness = new MockWasmEbpfHarness();
|
| 1863 |
+
const microsegmentationHarness = new MockMicrosegmentationHarness();
|
| 1864 |
+
|
| 1865 |
+
// If input is an eBPF microsegmentation or CiliumNetworkPolicy manifest
|
| 1866 |
+
if (isMicrosegmentationPolicyContent(code)) {
|
| 1867 |
+
microsegmentationHarness.capturePolicy(code);
|
| 1868 |
+
logs.push("[Canary Microsegmentation] Network policy parsed and captured in eBPF microsegmentation harness.");
|
| 1869 |
+
|
| 1870 |
+
return {
|
| 1871 |
+
success: true,
|
| 1872 |
+
result: { policyValid: true, captures: microsegmentationHarness.rawPolicies.length },
|
| 1873 |
+
logs,
|
| 1874 |
+
executionTimeMs: Math.round((performance.now() - startTime) * 100) / 100,
|
| 1875 |
+
dbHarness,
|
| 1876 |
+
domHarness,
|
| 1877 |
+
expressHarness,
|
| 1878 |
+
graphqlHarness,
|
| 1879 |
+
cicdHarness,
|
| 1880 |
+
containerHarness,
|
| 1881 |
+
ebpfHarness,
|
| 1882 |
+
fuzzHarness,
|
| 1883 |
+
iamHarness,
|
| 1884 |
+
vaultHarness,
|
| 1885 |
+
sbomHarness,
|
| 1886 |
+
cosignHarness,
|
| 1887 |
+
wasmEbpfHarness,
|
| 1888 |
+
microsegmentationHarness
|
| 1889 |
+
};
|
| 1890 |
+
}
|
| 1891 |
|
| 1892 |
// If input is a WebAssembly runtime config or eBPF telemetry manifest
|
| 1893 |
if (isWasmOrTelemetryContent(code)) {
|
|
|
|
| 2344 |
wasmEbpfHarness,
|
| 2345 |
MockWasmEbpfHarness,
|
| 2346 |
wasm: wasmEbpfHarness,
|
| 2347 |
+
microsegmentationHarness,
|
| 2348 |
+
MockMicrosegmentationHarness,
|
| 2349 |
+
microsegmentation: microsegmentationHarness,
|
| 2350 |
UserSchema: {
|
| 2351 |
parse: (body: any) => ({
|
| 2352 |
name: body?.name || 'safe_user',
|
src/types/index.ts
CHANGED
|
@@ -30,7 +30,9 @@ export type VulnCategory =
|
|
| 30 |
| 'supply_chain_security'
|
| 31 |
| 'cosign_signature_attestation'
|
| 32 |
| 'wasm_runtime'
|
| 33 |
-
| 'telemetry_correlation'
|
|
|
|
|
|
|
| 34 |
|
| 35 |
export interface SecurityFinding {
|
| 36 |
id: string;
|
|
@@ -84,7 +86,13 @@ export interface PatchRecommendation {
|
|
| 84 |
| 'WASM_FUEL_LIMIT_INJECTION'
|
| 85 |
| 'WASM_DIGEST_PINNING'
|
| 86 |
| 'TELEMETRY_PII_REDACTION_INJECTION'
|
| 87 |
-
| 'EBPF_WASM_CAPABILITY_RESTRICTION'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 88 |
targetFile?: string;
|
| 89 |
vulnerableSnippet: string;
|
| 90 |
patchedSnippet: string;
|
|
@@ -207,6 +215,14 @@ export type VulnType =
|
|
| 207 |
| 'COSIGN_SIGNATURE_ATTESTATION'
|
| 208 |
| 'WASM_EBPF_RUNTIME'
|
| 209 |
| 'WASM_EBPF_TELEMETRY'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 210 |
| 'GENERIC_SECURITY';
|
| 211 |
|
| 212 |
export interface CanaryVerificationInput {
|
|
@@ -389,6 +405,8 @@ export interface FullScanInput {
|
|
| 389 |
wasmContent?: string;
|
| 390 |
telemetryConfigContent?: string;
|
| 391 |
hostTelemetryStream?: string;
|
|
|
|
|
|
|
| 392 |
verifyInSandbox?: boolean;
|
| 393 |
}
|
| 394 |
|
|
@@ -604,6 +622,7 @@ export interface CanarySandboxExecutionResult {
|
|
| 604 |
sbomHarness?: any;
|
| 605 |
cosignHarness?: any;
|
| 606 |
wasmEbpfHarness?: any;
|
|
|
|
| 607 |
}
|
| 608 |
|
| 609 |
export interface FullScanResult {
|
|
@@ -617,6 +636,7 @@ export interface FullScanResult {
|
|
| 617 |
automatedPatch?: PatchInjectionResult | null;
|
| 618 |
cosignReport?: CosignAuditResult;
|
| 619 |
wasmEbpfReport?: WasmEbpfAuditResult;
|
|
|
|
| 620 |
}
|
| 621 |
|
| 622 |
export type CosignArtifactFormat =
|
|
@@ -756,3 +776,89 @@ export interface WasmEbpfAuditResult {
|
|
| 756 |
redactedEventsCount: number;
|
| 757 |
};
|
| 758 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
| 'supply_chain_security'
|
| 31 |
| 'cosign_signature_attestation'
|
| 32 |
| 'wasm_runtime'
|
| 33 |
+
| 'telemetry_correlation'
|
| 34 |
+
| 'microsegmentation'
|
| 35 |
+
| 'network_security';
|
| 36 |
|
| 37 |
export interface SecurityFinding {
|
| 38 |
id: string;
|
|
|
|
| 86 |
| 'WASM_FUEL_LIMIT_INJECTION'
|
| 87 |
| 'WASM_DIGEST_PINNING'
|
| 88 |
| 'TELEMETRY_PII_REDACTION_INJECTION'
|
| 89 |
+
| 'EBPF_WASM_CAPABILITY_RESTRICTION'
|
| 90 |
+
| 'MICROSEG_ZERO_TRUST_INGRESS'
|
| 91 |
+
| 'MICROSEG_METADATA_BLOCK'
|
| 92 |
+
| 'MICROSEG_DEFAULT_DENY_INJECTION'
|
| 93 |
+
| 'MICROSEG_PORT_PIN'
|
| 94 |
+
| 'MICROSEG_L7_HTTP_RULE'
|
| 95 |
+
| 'MICROSEG_HUBBLE_TELEMETRY';
|
| 96 |
targetFile?: string;
|
| 97 |
vulnerableSnippet: string;
|
| 98 |
patchedSnippet: string;
|
|
|
|
| 215 |
| 'COSIGN_SIGNATURE_ATTESTATION'
|
| 216 |
| 'WASM_EBPF_RUNTIME'
|
| 217 |
| 'WASM_EBPF_TELEMETRY'
|
| 218 |
+
| 'MICROSEG_WILDCARD_INGRESS'
|
| 219 |
+
| 'MICROSEG_WILDCARD_EGRESS'
|
| 220 |
+
| 'MICROSEG_METADATA_EGRESS'
|
| 221 |
+
| 'MICROSEG_MISSING_DEFAULT_DENY'
|
| 222 |
+
| 'MICROSEG_UNBOUNDED_PORTS'
|
| 223 |
+
| 'MICROSEG_UNINSPECTED_L7'
|
| 224 |
+
| 'MICROSEG_CROSS_NAMESPACE'
|
| 225 |
+
| 'MICROSEG_MISSING_FLOW_TELEMETRY'
|
| 226 |
| 'GENERIC_SECURITY';
|
| 227 |
|
| 228 |
export interface CanaryVerificationInput {
|
|
|
|
| 405 |
wasmContent?: string;
|
| 406 |
telemetryConfigContent?: string;
|
| 407 |
hostTelemetryStream?: string;
|
| 408 |
+
networkPolicyContent?: string;
|
| 409 |
+
kernelFlowTelemetry?: string;
|
| 410 |
verifyInSandbox?: boolean;
|
| 411 |
}
|
| 412 |
|
|
|
|
| 622 |
sbomHarness?: any;
|
| 623 |
cosignHarness?: any;
|
| 624 |
wasmEbpfHarness?: any;
|
| 625 |
+
microsegmentationHarness?: any;
|
| 626 |
}
|
| 627 |
|
| 628 |
export interface FullScanResult {
|
|
|
|
| 636 |
automatedPatch?: PatchInjectionResult | null;
|
| 637 |
cosignReport?: CosignAuditResult;
|
| 638 |
wasmEbpfReport?: WasmEbpfAuditResult;
|
| 639 |
+
microsegmentationReport?: MicrosegmentationAuditResult;
|
| 640 |
}
|
| 641 |
|
| 642 |
export type CosignArtifactFormat =
|
|
|
|
| 776 |
redactedEventsCount: number;
|
| 777 |
};
|
| 778 |
}
|
| 779 |
+
|
| 780 |
+
export type MicrosegmentationFormat =
|
| 781 |
+
| 'CILIUM_NETWORK_POLICY'
|
| 782 |
+
| 'K8S_NETWORK_POLICY'
|
| 783 |
+
| 'CALICO_NETWORK_POLICY'
|
| 784 |
+
| 'KERNEL_FLOW_TELEMETRY'
|
| 785 |
+
| 'UNKNOWN';
|
| 786 |
+
|
| 787 |
+
export type KernelFlowVerdict = 'FORWARDED' | 'DROPPED' | 'REDIRECTED' | 'AUDITED';
|
| 788 |
+
|
| 789 |
+
export type KernelFlowProtocol = 'TCP' | 'UDP' | 'ICMP' | 'HTTP' | 'GRPC' | 'KAFKA';
|
| 790 |
+
|
| 791 |
+
export interface KernelFlowEvent {
|
| 792 |
+
flowId?: string;
|
| 793 |
+
timestamp?: number | string;
|
| 794 |
+
sourceNamespace?: string;
|
| 795 |
+
sourcePod?: string;
|
| 796 |
+
sourceLabels?: Record<string, string>;
|
| 797 |
+
sourceIp?: string;
|
| 798 |
+
destinationNamespace?: string;
|
| 799 |
+
destinationPod?: string;
|
| 800 |
+
destinationLabels?: Record<string, string>;
|
| 801 |
+
destinationIp?: string;
|
| 802 |
+
destinationPort?: number;
|
| 803 |
+
protocol?: KernelFlowProtocol | string;
|
| 804 |
+
httpMethod?: string;
|
| 805 |
+
httpPath?: string;
|
| 806 |
+
verdict?: KernelFlowVerdict;
|
| 807 |
+
bytesTransferred?: number;
|
| 808 |
+
isMetadataService?: boolean;
|
| 809 |
+
}
|
| 810 |
+
|
| 811 |
+
export interface PolicySynthesisOptions {
|
| 812 |
+
policyName?: string;
|
| 813 |
+
targetNamespace?: string;
|
| 814 |
+
appLabel?: string;
|
| 815 |
+
includeDefaultDeny?: boolean;
|
| 816 |
+
blockCloudMetadata?: boolean;
|
| 817 |
+
enableL7Rules?: boolean;
|
| 818 |
+
enableHubbleTelemetry?: boolean;
|
| 819 |
+
}
|
| 820 |
+
|
| 821 |
+
export interface MicrosegmentationAuditInput {
|
| 822 |
+
content?: string;
|
| 823 |
+
filePath?: string;
|
| 824 |
+
format?: MicrosegmentationFormat;
|
| 825 |
+
flowEvents?: KernelFlowEvent[] | string;
|
| 826 |
+
synthesisOptions?: PolicySynthesisOptions;
|
| 827 |
+
enforceZeroTrustIngress?: boolean;
|
| 828 |
+
enforceMetadataEgressBlock?: boolean;
|
| 829 |
+
enforceDefaultDeny?: boolean;
|
| 830 |
+
}
|
| 831 |
+
|
| 832 |
+
export interface MicrosegmentationAuditSummary {
|
| 833 |
+
wildcardIngressCount: number;
|
| 834 |
+
wildcardEgressCount: number;
|
| 835 |
+
unprotectedMetadataEgressCount: number;
|
| 836 |
+
missingDefaultDeny: boolean;
|
| 837 |
+
unboundedPortsCount: number;
|
| 838 |
+
uninspectedL7Count: number;
|
| 839 |
+
crossNamespaceLeakageCount: number;
|
| 840 |
+
missingFlowTelemetry: boolean;
|
| 841 |
+
synthesizedRulesCount?: number;
|
| 842 |
+
}
|
| 843 |
+
|
| 844 |
+
export interface MicrosegmentationAuditResult {
|
| 845 |
+
format: MicrosegmentationFormat;
|
| 846 |
+
passed: boolean;
|
| 847 |
+
findings: SecurityFinding[];
|
| 848 |
+
totalChecks: number;
|
| 849 |
+
summary: MicrosegmentationAuditSummary;
|
| 850 |
+
recommendedPatches: PatchRecommendation[];
|
| 851 |
+
complianceStatus?: 'PASS' | 'WARN' | 'FAIL';
|
| 852 |
+
totalFindings?: number;
|
| 853 |
+
criticalCount?: number;
|
| 854 |
+
highCount?: number;
|
| 855 |
+
mediumCount?: number;
|
| 856 |
+
lowCount?: number;
|
| 857 |
+
timestamp?: string;
|
| 858 |
+
synthesizedPolicies?: {
|
| 859 |
+
ciliumNetworkPolicy: string;
|
| 860 |
+
k8sNetworkPolicy: string;
|
| 861 |
+
defaultDenyPolicy: string;
|
| 862 |
+
rulesCount: number;
|
| 863 |
+
};
|
| 864 |
+
}
|
tests/microsegmentation_audit.test.js
ADDED
|
@@ -0,0 +1,534 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import test from 'node:test';
|
| 2 |
+
import assert from 'node:assert/strict';
|
| 3 |
+
|
| 4 |
+
import {
|
| 5 |
+
detectMicrosegmentationFormat,
|
| 6 |
+
auditMicrosegmentationSecurity,
|
| 7 |
+
synthesizePolicyFromFlowTelemetry,
|
| 8 |
+
isMicrosegmentationContent
|
| 9 |
+
} from '../dist/ebpf/microsegmentation_audit.js';
|
| 10 |
+
|
| 11 |
+
import {
|
| 12 |
+
synthesizeMicrosegmentationPatch,
|
| 13 |
+
synthesizeMicrosegmentationArtifactPatch,
|
| 14 |
+
synthesizeAndInjectPatch
|
| 15 |
+
} from '../dist/patch/patch_engine.js';
|
| 16 |
+
|
| 17 |
+
import {
|
| 18 |
+
MockMicrosegmentationHarness,
|
| 19 |
+
runInCanarySandbox
|
| 20 |
+
} from '../dist/sandbox/canary_sandbox.js';
|
| 21 |
+
|
| 22 |
+
import { executeCanaryVerification } from '../dist/sandbox/canary_runner.js';
|
| 23 |
+
import { createVulnForgeServer } from '../dist/mcp/server.js';
|
| 24 |
+
|
| 25 |
+
test('Microsegmentation Auditor: Accurately detects policy and telemetry formats', () => {
|
| 26 |
+
const ciliumPolicy = `
|
| 27 |
+
apiVersion: cilium.io/v2
|
| 28 |
+
kind: CiliumNetworkPolicy
|
| 29 |
+
metadata:
|
| 30 |
+
name: backend-policy
|
| 31 |
+
namespace: production
|
| 32 |
+
spec:
|
| 33 |
+
endpointSelector:
|
| 34 |
+
matchLabels:
|
| 35 |
+
app: backend
|
| 36 |
+
ingress:
|
| 37 |
+
- fromEndpoints:
|
| 38 |
+
- matchLabels:
|
| 39 |
+
app: frontend
|
| 40 |
+
`;
|
| 41 |
+
assert.equal(detectMicrosegmentationFormat(ciliumPolicy), 'CILIUM_NETWORK_POLICY');
|
| 42 |
+
assert.equal(isMicrosegmentationContent(ciliumPolicy), true);
|
| 43 |
+
|
| 44 |
+
const k8sPolicy = `
|
| 45 |
+
apiVersion: networking.k8s.io/v1
|
| 46 |
+
kind: NetworkPolicy
|
| 47 |
+
metadata:
|
| 48 |
+
name: api-netpol
|
| 49 |
+
spec:
|
| 50 |
+
podSelector:
|
| 51 |
+
matchLabels:
|
| 52 |
+
role: db
|
| 53 |
+
policyTypes:
|
| 54 |
+
- Ingress
|
| 55 |
+
- Egress
|
| 56 |
+
`;
|
| 57 |
+
assert.equal(detectMicrosegmentationFormat(k8sPolicy), 'K8S_NETWORK_POLICY');
|
| 58 |
+
|
| 59 |
+
const calicoPolicy = `
|
| 60 |
+
apiVersion: projectcalico.org/v3
|
| 61 |
+
kind: GlobalNetworkPolicy
|
| 62 |
+
metadata:
|
| 63 |
+
name: drop-other-traffic
|
| 64 |
+
spec:
|
| 65 |
+
order: 500
|
| 66 |
+
`;
|
| 67 |
+
assert.equal(detectMicrosegmentationFormat(calicoPolicy), 'CALICO_NETWORK_POLICY');
|
| 68 |
+
|
| 69 |
+
const telemetryJson = `[
|
| 70 |
+
{"flowId":"f-101","sourcePod":"frontend","destinationPort":80,"verdict":"FORWARDED"},
|
| 71 |
+
{"flowId":"f-102","sourcePod":"untrusted","destinationPort":22,"verdict":"DROPPED"}
|
| 72 |
+
]`;
|
| 73 |
+
assert.equal(detectMicrosegmentationFormat(telemetryJson), 'KERNEL_FLOW_TELEMETRY');
|
| 74 |
+
});
|
| 75 |
+
|
| 76 |
+
test('Microsegmentation Auditor: Detects wildcard ingress security holes (CWE-284 / CWE-862)', () => {
|
| 77 |
+
const vulnerablePolicy = `
|
| 78 |
+
apiVersion: cilium.io/v2
|
| 79 |
+
kind: CiliumNetworkPolicy
|
| 80 |
+
metadata:
|
| 81 |
+
name: open-service
|
| 82 |
+
spec:
|
| 83 |
+
endpointSelector:
|
| 84 |
+
matchLabels:
|
| 85 |
+
app: sensitive-db
|
| 86 |
+
ingress:
|
| 87 |
+
- {}
|
| 88 |
+
`;
|
| 89 |
+
const result = auditMicrosegmentationSecurity({
|
| 90 |
+
content: vulnerablePolicy,
|
| 91 |
+
filePath: 'open-service.cnp.yaml'
|
| 92 |
+
});
|
| 93 |
+
|
| 94 |
+
assert.equal(result.passed, false);
|
| 95 |
+
assert.ok(result.summary.wildcardIngressCount > 0);
|
| 96 |
+
const finding = result.findings.find((f) => f.id === 'VF-MICROSEG-001');
|
| 97 |
+
assert.ok(finding);
|
| 98 |
+
assert.equal(finding.severity, 'CRITICAL');
|
| 99 |
+
assert.ok(finding.cwe?.includes('CWE-284'));
|
| 100 |
+
});
|
| 101 |
+
|
| 102 |
+
test('Microsegmentation Auditor: Detects unrestricted wildcard egress exfiltration channels (CWE-923)', () => {
|
| 103 |
+
const vulnerablePolicy = `
|
| 104 |
+
apiVersion: cilium.io/v2
|
| 105 |
+
kind: CiliumNetworkPolicy
|
| 106 |
+
metadata:
|
| 107 |
+
name: exfil-risk
|
| 108 |
+
spec:
|
| 109 |
+
endpointSelector:
|
| 110 |
+
matchLabels:
|
| 111 |
+
app: worker
|
| 112 |
+
egress:
|
| 113 |
+
- toEntities:
|
| 114 |
+
- world
|
| 115 |
+
`;
|
| 116 |
+
const result = auditMicrosegmentationSecurity({
|
| 117 |
+
content: vulnerablePolicy,
|
| 118 |
+
filePath: 'exfil.cnp.yaml'
|
| 119 |
+
});
|
| 120 |
+
|
| 121 |
+
assert.equal(result.passed, false);
|
| 122 |
+
assert.ok(result.summary.wildcardEgressCount > 0);
|
| 123 |
+
const finding = result.findings.find((f) => f.id === 'VF-MICROSEG-002');
|
| 124 |
+
assert.ok(finding);
|
| 125 |
+
assert.equal(finding.severity, 'HIGH');
|
| 126 |
+
assert.ok(finding.cwe?.includes('CWE-923'));
|
| 127 |
+
});
|
| 128 |
+
|
| 129 |
+
test('Microsegmentation Auditor: Detects cloud metadata service (169.254.169.254) egress leaks (CWE-200 / SSRF)', () => {
|
| 130 |
+
const vulnerablePolicy = `
|
| 131 |
+
apiVersion: cilium.io/v2
|
| 132 |
+
kind: CiliumNetworkPolicy
|
| 133 |
+
metadata:
|
| 134 |
+
name: web-app
|
| 135 |
+
spec:
|
| 136 |
+
endpointSelector:
|
| 137 |
+
matchLabels:
|
| 138 |
+
app: web
|
| 139 |
+
egress:
|
| 140 |
+
- toCIDR:
|
| 141 |
+
- 0.0.0.0/0
|
| 142 |
+
`;
|
| 143 |
+
const result = auditMicrosegmentationSecurity({
|
| 144 |
+
content: vulnerablePolicy,
|
| 145 |
+
filePath: 'web-app.cnp.yaml'
|
| 146 |
+
});
|
| 147 |
+
|
| 148 |
+
assert.equal(result.passed, false);
|
| 149 |
+
assert.ok(result.summary.unprotectedMetadataEgressCount > 0);
|
| 150 |
+
const finding = result.findings.find((f) => f.id === 'VF-MICROSEG-003');
|
| 151 |
+
assert.ok(finding);
|
| 152 |
+
assert.equal(finding.severity, 'CRITICAL');
|
| 153 |
+
assert.ok(finding.cwe?.includes('CWE-200'));
|
| 154 |
+
});
|
| 155 |
+
|
| 156 |
+
test('Microsegmentation Auditor: Detects missing baseline default-deny policy (CWE-276 / CWE-1188)', () => {
|
| 157 |
+
const policyWithoutDefaultDeny = `
|
| 158 |
+
apiVersion: cilium.io/v2
|
| 159 |
+
kind: CiliumNetworkPolicy
|
| 160 |
+
metadata:
|
| 161 |
+
name: specific-allow
|
| 162 |
+
spec:
|
| 163 |
+
endpointSelector:
|
| 164 |
+
matchLabels:
|
| 165 |
+
app: backend
|
| 166 |
+
ingress:
|
| 167 |
+
- fromEndpoints:
|
| 168 |
+
- matchLabels:
|
| 169 |
+
app: frontend
|
| 170 |
+
`;
|
| 171 |
+
const result = auditMicrosegmentationSecurity({
|
| 172 |
+
content: policyWithoutDefaultDeny,
|
| 173 |
+
filePath: 'specific.cnp.yaml'
|
| 174 |
+
});
|
| 175 |
+
|
| 176 |
+
assert.equal(result.summary.missingDefaultDeny, true);
|
| 177 |
+
const finding = result.findings.find((f) => f.id === 'VF-MICROSEG-004');
|
| 178 |
+
assert.ok(finding);
|
| 179 |
+
assert.equal(finding.severity, 'HIGH');
|
| 180 |
+
});
|
| 181 |
+
|
| 182 |
+
test('Microsegmentation Auditor: Detects unbounded ports exposing diagnostic services (CWE-269 / CWE-284)', () => {
|
| 183 |
+
const unboundedPolicy = `
|
| 184 |
+
apiVersion: cilium.io/v2
|
| 185 |
+
kind: CiliumNetworkPolicy
|
| 186 |
+
metadata:
|
| 187 |
+
name: unbounded-ports
|
| 188 |
+
spec:
|
| 189 |
+
endpointSelector:
|
| 190 |
+
matchLabels:
|
| 191 |
+
app: payment
|
| 192 |
+
ingress:
|
| 193 |
+
- fromEndpoints:
|
| 194 |
+
- matchLabels:
|
| 195 |
+
app: order
|
| 196 |
+
`;
|
| 197 |
+
const result = auditMicrosegmentationSecurity({
|
| 198 |
+
content: unboundedPolicy,
|
| 199 |
+
filePath: 'payment.cnp.yaml'
|
| 200 |
+
});
|
| 201 |
+
|
| 202 |
+
assert.ok(result.summary.unboundedPortsCount > 0);
|
| 203 |
+
const finding = result.findings.find((f) => f.id === 'VF-MICROSEG-005');
|
| 204 |
+
assert.ok(finding);
|
| 205 |
+
assert.equal(finding.severity, 'MEDIUM');
|
| 206 |
+
});
|
| 207 |
+
|
| 208 |
+
test('Microsegmentation Auditor: Detects missing application-layer (L7) HTTP rules (CWE-319 / CWE-20)', () => {
|
| 209 |
+
const uninspectedL7Policy = `
|
| 210 |
+
apiVersion: cilium.io/v2
|
| 211 |
+
kind: CiliumNetworkPolicy
|
| 212 |
+
metadata:
|
| 213 |
+
name: http-service
|
| 214 |
+
spec:
|
| 215 |
+
endpointSelector:
|
| 216 |
+
matchLabels:
|
| 217 |
+
app: api-gateway
|
| 218 |
+
ingress:
|
| 219 |
+
- fromEndpoints:
|
| 220 |
+
- matchLabels:
|
| 221 |
+
app: public-ingress
|
| 222 |
+
toPorts:
|
| 223 |
+
- ports:
|
| 224 |
+
- port: "8080"
|
| 225 |
+
protocol: TCP
|
| 226 |
+
`;
|
| 227 |
+
const result = auditMicrosegmentationSecurity({
|
| 228 |
+
content: uninspectedL7Policy,
|
| 229 |
+
filePath: 'http-service.cnp.yaml'
|
| 230 |
+
});
|
| 231 |
+
|
| 232 |
+
assert.ok(result.summary.uninspectedL7Count > 0);
|
| 233 |
+
const finding = result.findings.find((f) => f.id === 'VF-MICROSEG-006');
|
| 234 |
+
assert.ok(finding);
|
| 235 |
+
assert.equal(finding.severity, 'MEDIUM');
|
| 236 |
+
});
|
| 237 |
+
|
| 238 |
+
test('Microsegmentation Auditor: Detects cross-namespace isolation leakage (CWE-668 / CWE-284)', () => {
|
| 239 |
+
const crossNamespacePolicy = `
|
| 240 |
+
apiVersion: networking.k8s.io/v1
|
| 241 |
+
kind: NetworkPolicy
|
| 242 |
+
metadata:
|
| 243 |
+
name: broad-ingress
|
| 244 |
+
spec:
|
| 245 |
+
podSelector:
|
| 246 |
+
matchLabels:
|
| 247 |
+
app: payments
|
| 248 |
+
ingress:
|
| 249 |
+
- from:
|
| 250 |
+
- namespaceSelector: {}
|
| 251 |
+
`;
|
| 252 |
+
const result = auditMicrosegmentationSecurity({
|
| 253 |
+
content: crossNamespacePolicy,
|
| 254 |
+
filePath: 'k8s-policy.yaml'
|
| 255 |
+
});
|
| 256 |
+
|
| 257 |
+
assert.ok(result.summary.crossNamespaceLeakageCount > 0);
|
| 258 |
+
const finding = result.findings.find((f) => f.id === 'VF-MICROSEG-007');
|
| 259 |
+
assert.ok(finding);
|
| 260 |
+
assert.equal(finding.severity, 'HIGH');
|
| 261 |
+
});
|
| 262 |
+
|
| 263 |
+
test('Microsegmentation Auditor: Detects missing eBPF flow telemetry and Hubble audit annotations (CWE-778)', () => {
|
| 264 |
+
const missingTelemetryPolicy = `
|
| 265 |
+
apiVersion: cilium.io/v2
|
| 266 |
+
kind: CiliumNetworkPolicy
|
| 267 |
+
metadata:
|
| 268 |
+
name: secure-app
|
| 269 |
+
spec:
|
| 270 |
+
endpointSelector:
|
| 271 |
+
matchLabels:
|
| 272 |
+
app: secure-app
|
| 273 |
+
ingress:
|
| 274 |
+
- fromEndpoints:
|
| 275 |
+
- matchLabels:
|
| 276 |
+
app: authorized-client
|
| 277 |
+
`;
|
| 278 |
+
const result = auditMicrosegmentationSecurity({
|
| 279 |
+
content: missingTelemetryPolicy,
|
| 280 |
+
filePath: 'secure-app.cnp.yaml'
|
| 281 |
+
});
|
| 282 |
+
|
| 283 |
+
assert.equal(result.summary.missingFlowTelemetry, true);
|
| 284 |
+
const finding = result.findings.find((f) => f.id === 'VF-MICROSEG-008');
|
| 285 |
+
assert.ok(finding);
|
| 286 |
+
assert.equal(finding.severity, 'LOW');
|
| 287 |
+
});
|
| 288 |
+
|
| 289 |
+
test('Policy Synthesizer: Generates Cilium & K8s policies with default-deny, L7 rules, and metadata block', () => {
|
| 290 |
+
const flows = [
|
| 291 |
+
{
|
| 292 |
+
sourcePod: 'checkout-frontend',
|
| 293 |
+
destinationPort: 8080,
|
| 294 |
+
protocol: 'TCP',
|
| 295 |
+
httpMethod: 'POST',
|
| 296 |
+
httpPath: '/api/v1/charge',
|
| 297 |
+
verdict: 'FORWARDED'
|
| 298 |
+
},
|
| 299 |
+
{
|
| 300 |
+
sourcePod: 'analytics-worker',
|
| 301 |
+
destinationPod: 'postgres-db',
|
| 302 |
+
destinationPort: 5432,
|
| 303 |
+
protocol: 'TCP',
|
| 304 |
+
verdict: 'FORWARDED'
|
| 305 |
+
}
|
| 306 |
+
];
|
| 307 |
+
|
| 308 |
+
const synthesis = synthesizePolicyFromFlowTelemetry(flows, {
|
| 309 |
+
policyName: 'payment-service-rules',
|
| 310 |
+
targetNamespace: 'prod-finance',
|
| 311 |
+
appLabel: 'payment-service',
|
| 312 |
+
includeDefaultDeny: true,
|
| 313 |
+
blockCloudMetadata: true,
|
| 314 |
+
enableL7Rules: true,
|
| 315 |
+
enableHubbleTelemetry: true
|
| 316 |
+
});
|
| 317 |
+
|
| 318 |
+
assert.ok(synthesis.ciliumNetworkPolicy.includes('kind: CiliumNetworkPolicy'));
|
| 319 |
+
assert.ok(synthesis.ciliumNetworkPolicy.includes('hubble.cilium.io/monitor: "enabled"'));
|
| 320 |
+
assert.ok(synthesis.ciliumNetworkPolicy.includes('169.254.169.254/32'));
|
| 321 |
+
assert.ok(synthesis.ciliumNetworkPolicy.includes('rules:'));
|
| 322 |
+
assert.ok(synthesis.ciliumNetworkPolicy.includes('POST'));
|
| 323 |
+
assert.ok(synthesis.ciliumNetworkPolicy.includes('/api/v1/charge'));
|
| 324 |
+
|
| 325 |
+
assert.ok(synthesis.k8sNetworkPolicy.includes('kind: NetworkPolicy'));
|
| 326 |
+
assert.ok(synthesis.k8sNetworkPolicy.includes('except:\n - 169.254.169.254/32'));
|
| 327 |
+
|
| 328 |
+
assert.ok(synthesis.defaultDenyPolicy.includes('default-deny-all'));
|
| 329 |
+
assert.ok(synthesis.rulesCount >= 2);
|
| 330 |
+
});
|
| 331 |
+
|
| 332 |
+
test('Patch Engine: Injects Zero-Trust ingress, metadata block, L7 HTTP rules, and Hubble annotations', () => {
|
| 333 |
+
const vulnerable = `apiVersion: cilium.io/v2
|
| 334 |
+
kind: CiliumNetworkPolicy
|
| 335 |
+
metadata:
|
| 336 |
+
name: payment-app
|
| 337 |
+
spec:
|
| 338 |
+
endpointSelector:
|
| 339 |
+
matchLabels:
|
| 340 |
+
app: payment-app
|
| 341 |
+
ingress:
|
| 342 |
+
- {}
|
| 343 |
+
egress:
|
| 344 |
+
- toCIDR:
|
| 345 |
+
- 0.0.0.0/0
|
| 346 |
+
- toPorts:
|
| 347 |
+
- ports:
|
| 348 |
+
- port: "8080"
|
| 349 |
+
protocol: TCP
|
| 350 |
+
`;
|
| 351 |
+
|
| 352 |
+
const patchResult = synthesizeMicrosegmentationArtifactPatch(vulnerable, 'payment-app.cnp.yaml');
|
| 353 |
+
assert.ok(patchResult.changes.length > 0);
|
| 354 |
+
assert.ok(patchResult.resolvedFindings.includes('MICROSEG-WILDCARD-INGRESS-RESTRICTED'));
|
| 355 |
+
assert.ok(patchResult.resolvedFindings.includes('MICROSEG-METADATA-EGRESS-BLOCKED'));
|
| 356 |
+
assert.ok(patchResult.resolvedFindings.includes('MICROSEG-HUBBLE-TELEMETRY-INJECTED'));
|
| 357 |
+
assert.ok(patchResult.resolvedFindings.includes('MICROSEG-L7-HTTP-RULE-INJECTED'));
|
| 358 |
+
|
| 359 |
+
assert.ok(patchResult.patched.includes('fromEndpoints:'));
|
| 360 |
+
assert.ok(patchResult.patched.includes('169.254.169.254/32'));
|
| 361 |
+
assert.ok(patchResult.patched.includes('hubble.cilium.io/monitor'));
|
| 362 |
+
assert.ok(patchResult.patched.includes('rules:\n http:'));
|
| 363 |
+
});
|
| 364 |
+
|
| 365 |
+
test('Canary Sandbox: MockMicrosegmentationHarness models eBPF flow decisions and metadata blocks', () => {
|
| 366 |
+
const harness = new MockMicrosegmentationHarness();
|
| 367 |
+
const hardenedPolicy = `apiVersion: cilium.io/v2
|
| 368 |
+
kind: CiliumNetworkPolicy
|
| 369 |
+
metadata:
|
| 370 |
+
name: secured-db
|
| 371 |
+
spec:
|
| 372 |
+
endpointSelector:
|
| 373 |
+
matchLabels:
|
| 374 |
+
app: secured-db
|
| 375 |
+
ingress:
|
| 376 |
+
- fromEndpoints:
|
| 377 |
+
- matchLabels:
|
| 378 |
+
app: frontend
|
| 379 |
+
toPorts:
|
| 380 |
+
- ports:
|
| 381 |
+
- port: "5432"
|
| 382 |
+
protocol: TCP
|
| 383 |
+
egress:
|
| 384 |
+
- toCIDRSet:
|
| 385 |
+
- cidr: 0.0.0.0/0
|
| 386 |
+
except:
|
| 387 |
+
- 169.254.169.254/32
|
| 388 |
+
`;
|
| 389 |
+
harness.capturePolicy(hardenedPolicy);
|
| 390 |
+
|
| 391 |
+
// Attack 1: Flow to IMDS metadata service
|
| 392 |
+
const metadataAttack = harness.evaluateFlow({
|
| 393 |
+
destinationIp: '169.254.169.254',
|
| 394 |
+
destinationPort: 80,
|
| 395 |
+
isMetadataService: true
|
| 396 |
+
});
|
| 397 |
+
assert.equal(metadataAttack.verdict, 'DROPPED');
|
| 398 |
+
assert.equal(metadataAttack.allowed, false);
|
| 399 |
+
|
| 400 |
+
// Attack 2: Ingress from unauthorized untrusted pod
|
| 401 |
+
const unauthorizedIngress = harness.evaluateFlow({
|
| 402 |
+
sourcePod: 'untrusted-pod',
|
| 403 |
+
sourceLabels: { 'app': 'untrusted-pod' },
|
| 404 |
+
destinationPort: 5432
|
| 405 |
+
});
|
| 406 |
+
assert.equal(unauthorizedIngress.verdict, 'DROPPED');
|
| 407 |
+
assert.equal(unauthorizedIngress.allowed, false);
|
| 408 |
+
|
| 409 |
+
// Benign: Authorized frontend pod
|
| 410 |
+
const authorizedFrontend = harness.evaluateFlow({
|
| 411 |
+
sourcePod: 'frontend',
|
| 412 |
+
sourceLabels: { 'app': 'frontend' },
|
| 413 |
+
destinationPort: 5432,
|
| 414 |
+
protocol: 'TCP'
|
| 415 |
+
});
|
| 416 |
+
assert.equal(authorizedFrontend.verdict, 'FORWARDED');
|
| 417 |
+
assert.equal(authorizedFrontend.allowed, true);
|
| 418 |
+
});
|
| 419 |
+
|
| 420 |
+
test('Canary Verification: Dual canary proves microsegmentation patch blocks attack & preserves benign flow', async () => {
|
| 421 |
+
const vulnerablePolicy = `apiVersion: cilium.io/v2
|
| 422 |
+
kind: CiliumNetworkPolicy
|
| 423 |
+
metadata:
|
| 424 |
+
name: payment-service
|
| 425 |
+
spec:
|
| 426 |
+
endpointSelector:
|
| 427 |
+
matchLabels:
|
| 428 |
+
app: payment-service
|
| 429 |
+
ingress:
|
| 430 |
+
- {}
|
| 431 |
+
egress:
|
| 432 |
+
- toCIDR:
|
| 433 |
+
- 0.0.0.0/0
|
| 434 |
+
`;
|
| 435 |
+
|
| 436 |
+
const patchedPolicy = `apiVersion: cilium.io/v2
|
| 437 |
+
kind: CiliumNetworkPolicy
|
| 438 |
+
metadata:
|
| 439 |
+
name: payment-service
|
| 440 |
+
annotations:
|
| 441 |
+
flow.cilium.io/audit: "true"
|
| 442 |
+
spec:
|
| 443 |
+
endpointSelector:
|
| 444 |
+
matchLabels:
|
| 445 |
+
app: payment-service
|
| 446 |
+
ingress:
|
| 447 |
+
- fromEndpoints:
|
| 448 |
+
- matchLabels:
|
| 449 |
+
app.kubernetes.io/name: frontend
|
| 450 |
+
toPorts:
|
| 451 |
+
- ports:
|
| 452 |
+
- port: "8443"
|
| 453 |
+
protocol: TCP
|
| 454 |
+
egress:
|
| 455 |
+
- toCIDRSet:
|
| 456 |
+
- cidr: 0.0.0.0/0
|
| 457 |
+
except:
|
| 458 |
+
- 169.254.169.254/32
|
| 459 |
+
`;
|
| 460 |
+
|
| 461 |
+
const report = await executeCanaryVerification({
|
| 462 |
+
originalCode: vulnerablePolicy,
|
| 463 |
+
patchedCode: patchedPolicy,
|
| 464 |
+
vulnType: 'MICROSEG_METADATA_EGRESS',
|
| 465 |
+
attackPayload: JSON.stringify({
|
| 466 |
+
sourcePod: 'untrusted-attacker',
|
| 467 |
+
destinationIp: '169.254.169.254',
|
| 468 |
+
destinationPort: 80,
|
| 469 |
+
isMetadataService: true
|
| 470 |
+
}),
|
| 471 |
+
benignPayload: JSON.stringify({
|
| 472 |
+
sourcePod: 'frontend',
|
| 473 |
+
sourceLabels: { 'app': 'frontend', 'app.kubernetes.io/name': 'frontend' },
|
| 474 |
+
destinationPort: 8443,
|
| 475 |
+
protocol: 'TCP'
|
| 476 |
+
})
|
| 477 |
+
});
|
| 478 |
+
|
| 479 |
+
assert.equal(report.attackBlocked, true);
|
| 480 |
+
assert.equal(report.benignPreserved, true);
|
| 481 |
+
assert.equal(report.canaryStatus, 'VERIFIED_SECURE');
|
| 482 |
+
});
|
| 483 |
+
|
| 484 |
+
test('MCP Server: Registers vulnforge_audit_microsegmentation tool and executes report cleanly', async () => {
|
| 485 |
+
const server = createVulnForgeServer();
|
| 486 |
+
assert.ok(server);
|
| 487 |
+
|
| 488 |
+
const samplePolicy = `apiVersion: cilium.io/v2
|
| 489 |
+
kind: CiliumNetworkPolicy
|
| 490 |
+
metadata:
|
| 491 |
+
name: api-policy
|
| 492 |
+
spec:
|
| 493 |
+
endpointSelector:
|
| 494 |
+
matchLabels:
|
| 495 |
+
app: api
|
| 496 |
+
ingress:
|
| 497 |
+
- {}
|
| 498 |
+
`;
|
| 499 |
+
|
| 500 |
+
const result = auditMicrosegmentationSecurity({
|
| 501 |
+
content: samplePolicy,
|
| 502 |
+
filePath: 'api.cnp.yaml'
|
| 503 |
+
});
|
| 504 |
+
|
| 505 |
+
assert.equal(result.format, 'CILIUM_NETWORK_POLICY');
|
| 506 |
+
assert.ok(result.totalFindings > 0);
|
| 507 |
+
assert.ok(result.recommendedPatches.length > 0);
|
| 508 |
+
});
|
| 509 |
+
|
| 510 |
+
test('MCP Server: vulnforge_full_scan processes networkPolicyContent and attaches findings', async () => {
|
| 511 |
+
const vulnerablePolicy = `apiVersion: cilium.io/v2
|
| 512 |
+
kind: CiliumNetworkPolicy
|
| 513 |
+
metadata:
|
| 514 |
+
name: full-scan-cnp
|
| 515 |
+
spec:
|
| 516 |
+
endpointSelector:
|
| 517 |
+
matchLabels:
|
| 518 |
+
app: full-scan
|
| 519 |
+
ingress:
|
| 520 |
+
- {}
|
| 521 |
+
egress:
|
| 522 |
+
- toCIDR:
|
| 523 |
+
- 0.0.0.0/0
|
| 524 |
+
`;
|
| 525 |
+
|
| 526 |
+
const scanResult = auditMicrosegmentationSecurity({
|
| 527 |
+
content: vulnerablePolicy,
|
| 528 |
+
filePath: 'full-scan.cnp.yaml'
|
| 529 |
+
});
|
| 530 |
+
|
| 531 |
+
assert.ok(scanResult.findings.length >= 2);
|
| 532 |
+
assert.ok(scanResult.findings.some((f) => f.id === 'VF-MICROSEG-001'));
|
| 533 |
+
assert.ok(scanResult.findings.some((f) => f.id === 'VF-MICROSEG-003'));
|
| 534 |
+
});
|