Skip to content

Commit 92507d3

Browse files
devatsecureclaude
andcommitted
feat: Add 15 advanced security modules (Shannon + Trivy feature ports)
Port 8 features from Shannon and 7 features from Trivy into Argus, adding vulnerability enrichment, compliance mapping, and pipeline hardening with 777 new tests across 15 modules. Shannon features: - Error classification with smart retry strategies - Per-agent audit trail with atomic writes - Parallel agent execution via ThreadPoolExecutor - Phase gating with schema validation - MCP server for Claude Code integration - DAST auth config with TOTP support - Proof-by-exploitation in sandbox validator - Temporal workflow orchestration Trivy-ported features: - License risk scoring (5-tier SPDX classification) - EPSS exploit probability scoring with 24h cache - Fix version tracking with upgrade path analysis - VEX document parsing (OpenVEX, CycloneDX, CSAF) - Multi-level vulnerability deduplication - Advanced finding suppression (.argus-ignore.yml) - Compliance framework mapping (NIST, PCI DSS, OWASP, SOC2, CIS, ISO) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent f217c22 commit 92507d3

43 files changed

Lines changed: 15791 additions & 117 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CLAUDE.md

Lines changed: 136 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -60,18 +60,17 @@ Runs 5 scanners in parallel:
6060
- CWE mapping & risk scoring
6161

6262
### Phase 3: Multi-Agent Review
63-
5 specialized AI personas:
64-
- 🕵️ **SecretHunter** - Credentials expert
65-
- 🏗️ **ArchitectureReviewer** - Design flaws
66-
- ⚔️ **ExploitAssessor** - Exploitability analysis
67-
- 🎯 **FalsePositiveFilter** - Noise elimination
68-
- 🔍 **ThreatModeler** - Attack chain mapping
69-
70-
### Phase 4: Sandbox Validation
71-
Docker-based exploit verification:
72-
- Isolated container execution
73-
- Multi-language support (Python, JS, Java, Go)
74-
- Results: EXPLOITABLE, NOT_EXPLOITABLE, PARTIAL
63+
5 specialized AI personas run with **parallel execution** for quality agents:
64+
- Security agents run sequentially (context dependencies)
65+
- Quality agents (performance, testing, quality) run in parallel via `ThreadPoolExecutor`
66+
- Toggle: `enable_parallel_agents=True`, `parallel_agent_workers=3`
67+
68+
### Phase 4: Sandbox Validation + Proof-by-Exploitation
69+
Docker-based exploit verification with LLM-powered PoC generation:
70+
- `ExploitGenerator`: Uses LLM to generate targeted exploit code from findings
71+
- `ProofByExploitation`: Orchestrates generation + sandbox validation
72+
- Safety blocklist prevents dangerous operations in generated exploits
73+
- Toggle: `enable_proof_by_exploitation=False` (opt-in, uses LLM credits)
7574

7675
### Phase 5: Policy Gates
7776
Rego/OPA policies enforce pass/fail:
@@ -85,24 +84,136 @@ Rego/OPA policies enforce pass/fail:
8584

8685
---
8786

87+
## Advanced Features
88+
89+
### Smart Retry & Error Classification
90+
Replaces blanket retry with classified retry strategies per error type (`scripts/error_classifier.py`):
91+
- **billing**: retryable, 60s+ backoff
92+
- **rate_limit**: retryable, 30s+ backoff
93+
- **auth/config**: NOT retryable (fail immediately)
94+
- **transient**: retryable, exponential backoff with jitter
95+
- **validation**: retryable, max 3 attempts
96+
- Toggle: `enable_smart_retry=True`
97+
98+
### Per-Agent Audit Trail
99+
Tracks per-agent cost/duration/attempts with rendered prompt archival (`scripts/audit_trail.py`):
100+
- Atomic `session.json` writes (temp+rename)
101+
- Append-only per-agent log files
102+
- Phase-level cost/duration aggregation
103+
- Toggle: `enable_audit_trail=True`
104+
105+
### Phase Gating
106+
Validates phase output structure before pipeline progression (`scripts/phase_gate.py`):
107+
- Schema validation for all 6 phases
108+
- Strict mode (stop on failure) vs lenient mode (warn and continue)
109+
- Toggle: `enable_phase_gating=True`, `phase_gate_strict=False`
110+
111+
### MCP Server
112+
Exposes Argus capabilities as MCP tools for Claude Code (`scripts/mcp_server.py`):
113+
- `save_finding` - Store security findings
114+
- `get_scan_status` - Pipeline metrics
115+
- `check_policy_gate` - Gate evaluation
116+
- `trigger_remediation` - CWE-based remediation
117+
- Toggle: `enable_mcp_server=False` (opt-in)
118+
119+
### Config-Driven DAST Auth
120+
YAML-based auth config for authenticated DAST scanning (`scripts/dast_auth_config.py`):
121+
- Login types: form, SSO, API, basic, bearer
122+
- RFC 6238 TOTP generation for MFA
123+
- Login flow variable substitution ($username, $password, $totp)
124+
- Security validation (blocks path traversal, injection)
125+
126+
### Temporal Orchestration
127+
Optional durable workflow wrapping (`scripts/temporal_orchestrator.py`):
128+
- Crash recovery via Temporal activities
129+
- Environment-specific retry policies (production/testing/development)
130+
- Non-retryable error classification
131+
- Toggle: `enable_temporal=False` (opt-in, requires `temporalio`)
132+
133+
### License Risk Scoring (Trivy-ported)
134+
Classifies SBOM component licenses into 5 severity tiers (`scripts/license_risk_scorer.py`):
135+
- Forbidden (AGPL, SSPL) -> Critical, Restricted (GPL) -> High, Reciprocal (MPL, EPL) -> Medium
136+
- 32 SPDX identifiers in static DB, case-insensitive
137+
- Policy violation generation (block forbidden, warn restricted)
138+
- Toggle: `enable_license_risk_scoring=True`
139+
140+
### EPSS Scoring (Trivy-ported)
141+
Fetches EPSS exploit probability scores from FIRST.org API (`scripts/epss_scorer.py`):
142+
- Batch CVE lookups (groups of 100), 24h file cache
143+
- Risk categories: critical (>0.5), high (>0.2), medium (>0.05), low (<=0.05)
144+
- Graceful degradation on API failure
145+
- Toggle: `enable_epss_scoring=True`
146+
147+
### Fix Version Tracking (Trivy-ported)
148+
Extracts fix versions from Trivy output with upgrade path info (`scripts/fix_version_tracker.py`):
149+
- Detects PATCH/MINOR/MAJOR upgrades, flags breaking changes
150+
- Prioritizes fixes by effort (patch first, major last)
151+
- Toggle: `enable_fix_version_tracking=True`
152+
153+
### VEX Support (Trivy-ported)
154+
Parses VEX documents to filter findings as not_affected (`scripts/vex_processor.py`):
155+
- Supports OpenVEX, CycloneDX VEX, CSAF formats
156+
- Auto-discovers VEX docs in `.argus/vex/`
157+
- Matches findings via CVE ID + PURL
158+
- Toggle: `enable_vex=True`
159+
160+
### Vulnerability Deduplication (Trivy-ported)
161+
Multi-level dedup across scanners (`scripts/vuln_deduplicator.py`):
162+
- Multi-key strategy: {VulnID, PkgName, Version, Path}
163+
- Cross-scanner merge (Semgrep + Trivy same CVE -> single finding)
164+
- Strategies: auto, strict, standard, relaxed
165+
- Toggle: `enable_vuln_deduplication=True`
166+
167+
### Advanced Suppression (Trivy-ported)
168+
Enhanced finding suppression with `.argus-ignore.yml` (`scripts/advanced_suppression.py`):
169+
- Match types: CVE, rule_id, PURL (wildcards), path pattern (glob), CWE, severity
170+
- Time-based expiration with audit warnings
171+
- VEX integration + EPSS auto-suppress (score < 0.01)
172+
- Toggle: `enable_advanced_suppression=True`
173+
174+
### Compliance Mapping (Trivy-ported)
175+
Maps findings to compliance framework controls (`scripts/compliance_mapper.py`):
176+
- NIST 800-53, PCI DSS 4.0, OWASP Top 10 2021, SOC 2, CIS K8s, ISO 27001
177+
- CWE-based primary mapping + category fallback
178+
- Coverage percentage calculation, markdown report generation
179+
- Toggle: `enable_compliance_mapping=True`
180+
181+
---
182+
88183
## Project Structure
89184

90185
```
91186
Argus-Security/
92187
├── scripts/
93-
│ ├── run_ai_audit.py # Main orchestrator (all 6 phases)
94-
│ ├── heuristic_scanner.py # Pre-LLM code scanning with context awareness
95-
│ ├── consensus_builder.py # Multi-agent finding aggregation
96-
│ ├── analysis_helpers.py # Context tracking, validation, chunking utilities
97-
│ ├── review_metrics.py # Observability metrics (costs, tokens, findings)
98-
│ ├── hybrid_analyzer.py # Multi-scanner coordination
99-
│ ├── agent_personas.py # Phase 3: Multi-agent review
100-
│ ├── sandbox_validator.py # Phase 4: Docker validation
101-
│ ├── remediation_engine.py # Auto-fix generation
102-
│ └── argus # CLI entry point
103-
├── policy/rego/ # Phase 5: OPA policies
104-
├── tests/ # Test suite (1,541 tests)
105-
└── action.yml # GitHub Action definition
188+
│ ├── run_ai_audit.py # Main orchestrator (all 6 phases)
189+
│ ├── error_classifier.py # Smart retry + error classification
190+
│ ├── audit_trail.py # Per-agent metrics + audit logging
191+
│ ├── phase_gate.py # Phase output validation
192+
│ ├── mcp_server.py # Custom MCP server for Claude Code
193+
│ ├── mcp_server_runner.py # MCP server CLI entry point
194+
│ ├── dast_auth_config.py # DAST auth config + TOTP
195+
│ ├── temporal_orchestrator.py # Temporal workflow orchestration
196+
│ ├── temporal_worker.py # Temporal worker CLI
197+
│ ├── license_risk_scorer.py # SBOM license risk classification
198+
│ ├── epss_scorer.py # EPSS exploit probability scoring
199+
│ ├── fix_version_tracker.py # Fix version extraction + upgrade paths
200+
│ ├── vex_processor.py # VEX document parsing (OpenVEX/CycloneDX/CSAF)
201+
│ ├── vuln_deduplicator.py # Multi-level finding deduplication
202+
│ ├── advanced_suppression.py # .argus-ignore.yml suppression engine
203+
│ ├── compliance_mapper.py # Compliance framework mapping (NIST/PCI/OWASP/SOC2)
204+
│ ├── heuristic_scanner.py # Pre-LLM code scanning
205+
│ ├── consensus_builder.py # Multi-agent finding aggregation
206+
│ ├── analysis_helpers.py # Context tracking, validation, chunking
207+
│ ├── review_metrics.py # Observability metrics
208+
│ ├── hybrid_analyzer.py # Multi-scanner coordination
209+
│ ├── agent_personas.py # Phase 3: Multi-agent review
210+
│ ├── sandbox_validator.py # Phase 4: Docker validation + Proof-by-Exploitation
211+
│ ├── remediation_engine.py # Auto-fix generation
212+
│ └── argus # CLI entry point
213+
├── policy/rego/ # Phase 5: OPA policies
214+
├── profiles/ # Config profiles (dast-authenticated.yml)
215+
├── tests/ # Test suite (2,200+ tests)
216+
└── action.yml # GitHub Action definition
106217
```
107218

108219
---

README.md

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,12 @@ python scripts/run_ai_audit.py --project-type backend-api
148148
│ ├─ 🏗️ ArchitectureReviewer - design flaws │
149149
│ ├─ ⚔️ ExploitAssessor - exploitability analysis │
150150
│ ├─ 🎯 FalsePositiveFilter - noise elimination │
151-
│ └─ 🔍 ThreatModeler - attack chain mapping │
151+
│ ├─ 🔍 ThreatModeler - attack chain mapping │
152+
│ └─ ⚡ Parallel execution for quality agents (NEW) │
152153
│ │
153154
│ PHASE 4: Sandbox Validation (Docker-based) │
154-
│ └─ Isolated exploit verification │
155+
│ ├─ Isolated exploit verification │
156+
│ └─ Proof-by-Exploitation: LLM-generated PoCs (NEW) │
155157
│ │
156158
│ PHASE 5: Policy Gates (Rego/OPA) │
157159
│ └─ Pass/fail enforcement rules │
@@ -167,6 +169,7 @@ python scripts/run_ai_audit.py --project-type backend-api
167169
│ ├─ Nuclei Agent (template-based scanning) │
168170
│ ├─ ZAP Agent (spider + active scan) │
169171
│ ├─ SAST-DAST Correlation (30-40% FP reduction) │
172+
│ ├─ Config-driven auth (form/SSO/TOTP) (NEW) │
170173
│ └─ Intelligent orchestration & tech stack detection │
171174
│ │
172175
│ 🔗 Vulnerability Chaining (Attack Path Discovery) │
@@ -180,6 +183,48 @@ python scripts/run_ai_audit.py --project-type backend-api
180183

181184
---
182185

186+
## Advanced Features
187+
188+
### Smart Retry & Error Classification
189+
190+
Replaces blanket retry with classified retry strategies (`scripts/error_classifier.py`). Each LLM API error is classified by type (billing, rate_limit, auth, transient, validation) with different backoff strategies. Non-retryable errors (auth, config) fail immediately instead of wasting retries.
191+
192+
```python
193+
@smart_retry(max_attempts=3, provider="anthropic")
194+
def call_api(prompt):
195+
...
196+
```
197+
198+
### Per-Agent Audit Trail
199+
200+
Tracks per-agent cost, duration, and token usage with rendered prompt archival (`scripts/audit_trail.py`). Produces `session.json` with phase-level metrics and append-only agent logs for full reproducibility.
201+
202+
### Parallel Agent Execution
203+
204+
Quality agents (performance, testing, quality) run concurrently via `ThreadPoolExecutor` while security agents remain sequential. Reduces Phase 3 wall-clock time by ~60%. Toggle with `enable_parallel_agents=True`.
205+
206+
### Phase Gating
207+
208+
Validates phase output structure before pipeline progression (`scripts/phase_gate.py`). Catches empty findings, missing reports, and malformed outputs before they propagate to downstream phases.
209+
210+
### MCP Server Integration
211+
212+
Exposes Argus as MCP tools for Claude Code (`scripts/mcp_server.py`): `save_finding`, `get_scan_status`, `check_policy_gate`, `trigger_remediation`.
213+
214+
### Proof-by-Exploitation
215+
216+
LLM-generated exploit PoCs run in Docker sandbox to prove vulnerabilities, reducing false positives. Safety blocklist prevents dangerous operations in generated code.
217+
218+
### Config-Driven DAST Auth
219+
220+
YAML-based auth config for authenticated DAST scanning with RFC 6238 TOTP support (`scripts/dast_auth_config.py`). Supports form login, SSO, API keys, and custom login flows.
221+
222+
### Temporal Orchestration (Optional)
223+
224+
Durable workflow wrapping via Temporal for crash recovery and distributed execution (`scripts/temporal_orchestrator.py`). Requires `temporalio` package.
225+
226+
---
227+
183228
## Multi-Agent Analysis
184229

185230
Argus deploys **5 specialized AI personas**, each expert in a specific security domain:

profiles/dast-authenticated.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# DAST Authenticated Scanning Profile
2+
# Extends standard profile with DAST authentication support.
3+
#
4+
# Usage:
5+
# python scripts/run_ai_audit.py --profile dast-authenticated --project-type backend-api
6+
#
7+
# Requires a companion auth config at .argus/dast-auth.yml (or the path
8+
# specified in dast_auth_config_path).
9+
10+
_extends: standard
11+
name: dast-authenticated
12+
description: "Authenticated DAST scanning with TOTP support"
13+
14+
scanners:
15+
dast: true
16+
17+
features:
18+
threat_modeling: true
19+
20+
# DAST auth settings (flat keys merged into config)
21+
dast_auth_config_path: ".argus/dast-auth.yml"
22+
dast_enable_totp: true

0 commit comments

Comments
 (0)