Skip to content

Commit 19a90a6

Browse files
committed
feat(update): working on next release
♬ Dana Jean Phoenix & Powernerd - Figure Me Out (New Arcades Remix)
1 parent 165f2f6 commit 19a90a6

96 files changed

Lines changed: 2044 additions & 958 deletions

File tree

Some content is hidden

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

‎CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Added
1111
- VulnInstruct specification-guided vulnerability detection (`src/vuln_spec` module: schema, extractor, BM25+vector retriever) behind `[vuln_spec] enabled = false` default
12+
- `baco report --config <PATH>` to load evidence-gate config for standalone reports
1213

1314
### Changed
1415
- Threat-modeling phase disabled by default (`enable_threat_modeling = false`) — it generated a static STRIDE template rather than code-derived analysis

‎Cargo.toml‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@ keywords = ["security", "vulnerability", "scanner", "sast", "llm"]
1212
categories = ["command-line-utilities", "development-tools"]
1313
rust-version = "1.85"
1414

15+
16+
exclude = [
17+
"baco-output/**",
18+
"core*",
19+
"*.profraw",
20+
"lcov.info",
21+
]
22+
1523
[dependencies]
1624
# Async trait support
1725
async-trait = "0.1"
@@ -71,6 +79,7 @@ dirs = "5"
7179
thiserror = "1.0"
7280
tempfile = "3"
7381
regex = "1"
82+
libc = "0.2"
7483

7584
# Tree-sitter for AST parsing
7685
tree-sitter = "0.26"

‎README.md‎

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ Grounded in 36 surveyed papers (16 integrated) from [Awesome-LLMs-for-Vulnerabil
88
[![CI](https://github.com/CodeAtCode/baco-scanner/actions/workflows/ci.yml/badge.svg)](https://github.com/CodeAtCode/baco-scanner/actions/workflows/ci.yml)
99
[![Coverage](https://codecov.io/gh/CodeAtCode/baco-scanner/branch/master/graph/badge.svg)](https://app.codecov.io/gh/CodeAtCode/baco-scanner)
1010
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
11-
[![Rust](https://img.shields.io/badge/rust-1.74+-orange.svg)](https://www.rust-lang.org)
11+
[![Rust](https://img.shields.io/badge/rust-1.85+-orange.svg)](https://www.rust-lang.org)
1212

1313
[![Example Report](docs/example-report-screenshot.png)](example-report.html)
1414

1515
---
1616

1717
## Prerequisites
1818

19-
- **Rust** 1.74+ (`rustup`)
19+
- **Rust** 1.85+ (`rustup`)
2020
- **An LLM API key** (Mistral, OpenAI, or any OpenAI-compatible endpoint)
2121
- **Semgrep** installed on PATH (`pip install semgrep` or [see install options](https://semgrep.dev/docs/getting-started/))
2222

@@ -41,7 +41,7 @@ export LLM_DISCOVERY_KEY="your-key-here" # or LLM_API_KEY for generic fallback
4141
./target/release/baco doctor
4242

4343
# 5. Scan
44-
./target/release/baco scan --config config.toml
44+
./target/release/baco scan --config /path/to/project/baco.toml
4545
```
4646

4747
### Additional subcommands
@@ -54,7 +54,8 @@ export LLM_DISCOVERY_KEY="your-key-here" # or LLM_API_KEY for generic fallback
5454
./target/release/baco eval --target /path/to/fixtures --ground-truth eval/oracles/target.json
5555

5656
# Generate report
57-
./target/release/baco report --input findings.json --format html
57+
# Use --config only when the evidence gate must apply to a standalone report
58+
./target/release/baco report --input findings.json --format html --config config.toml
5859

5960
# Verify findings
6061
./target/release/baco verify --input findings.json
@@ -72,6 +73,8 @@ export LLM_DISCOVERY_KEY="your-key-here" # or LLM_API_KEY for generic fallback
7273
./target/release/baco scan --config my.toml --dry-run # Print estimate and exit
7374
./target/release/baco scan --config my.toml --target /path # Override target path
7475
./target/release/baco scan --config my.toml --force # Force full rescan
76+
./target/release/baco scan --config my.toml --diff main...HEAD # Limit report to files changed in git revspec
77+
./target/release/baco scan --config my.toml -q # Suppress non-essential output (global flag)
7578
```
7679

7780
- **Phases**: 4 parallel (Indexing, Semgrep, CpgSlice, LlmStaticAnalysis) + 19 sequential phases — some disabled by default (see [Configuration](docs/configuration.md))
@@ -81,13 +84,13 @@ export LLM_DISCOVERY_KEY="your-key-here" # or LLM_API_KEY for generic fallback
8184
## Features
8285

8386
- **Pipeline profiles**: `core` (default) runs essential phases; `all` enables experimental phases (still individually flag-gated) — set with `scanner.profile = "core" | "all"`
84-
- **Pipeline phases**: Indexing → Semgrep → CpgSlice (`[cpg]` section, requires Joern) → LlmStaticAnalysis → CweRouting (`router.enabled`) → RuleSynthesis (experimental) → LlmDiscovery → LlmVerification → Validate (opt-in) → SecurityAgentVerification (opt-in) → TicketCrossRef → GitAnalysis → CrossFileAnalysis → ConfidenceScoring → AiAggregation → ThreatModeling (`enable_threat_modeling`) → RootCauseDedup → MultiVerifier (`enable_multi_verifier`, experimental) → AutoPatching (`enable_auto_patching`, opt-in) → CveBootstrap → PocCompiler (`enable_poc_compilation`, opt-in) → ExploitSynth (`[exploit]` section, experimental) → VariantSearch → Reporting
87+
- **Pipeline phases**: Indexing → Semgrep → CpgSlice (`[cpg]` section, requires Joern) → LlmStaticAnalysis → CweRouting (`router.enabled`) → RuleSynthesis (experimental) → LlmDiscovery → LlmVerification → Validate (opt-in) → SecurityAgentVerification (opt-in) → TicketCrossRef → GitAnalysis → CrossFileAnalysis → ConfidenceScoring → AiAggregation → ThreatModeling (`enable_threat_modeling`) → RootCauseDedup → AutoPatching (`enable_auto_patching`, opt-in) → CveBootstrap → PocCompiler (`enable_poc_compilation`, opt-in) → ExploitSynth (`[exploit]` section, experimental) → VariantSearch → Reporting
8588
- **Parallel execution**: Indexing, Semgrep, CpgSlice, and LlmStaticAnalysis run concurrently; 19 sequential phases follow
8689
- **CWE-aware MoE (opt-in)**: BM25 RAG retrieval from CWE knowledge base, routes to specialized analysis paths — enable with `router.enabled = true`
8790
- **Research-backed**: 16 academic papers integrated (VulTriage, VulIn, MoCQ, MoEVD, AgentFlow) — see [Research Integration](docs/research-integration.md)
8891
- **Checkpoint/resume**: Crash recovery after each phase
8992
- **Pre-flight checks**: `baco doctor` validates config, presets, LLM phases, semgrep, python3, Joern (if CPG enabled), output dir, and disk space
90-
- **Multiple outputs**: JSON, HTML, SARIF
93+
- **Multiple outputs**: JSON, HTML, SARIF, Markdown
9194
- **Config-driven**: TOML config with env var overrides
9295
- **Ticket systems**: Configurable via `[[tickets.systems]]` TOML blocks (supports any system type via `system_type` field) — see [Configuration](docs/configuration.md) for setup
9396

@@ -149,6 +152,7 @@ export LLM_DISCOVERY_KEY="your-key-here" # or LLM_API_KEY for generic fallback
149152
- `findings.json` — complete vulnerability data (all fields, machine-readable)
150153
- `report.html` — interactive report with severity filtering, code highlighting, confidence/CWE badges
151154
- `report.sarif` — SARIF 2.1 for CI/CD integration (GitHub Code Scanning, Azure DevOps)
155+
- `findings.md` — Markdown summary of findings (written alongside JSON)
152156

153157
## Architecture
154158

@@ -169,6 +173,9 @@ See [Research Integration](docs/research-integration.md) for per-paper details (
169173
- [Operator Tuning](docs/operator-tuning.md) — Performance flags and scenario-based tuning
170174
- [Output Interpretation](docs/output-interpretation.md) — Reading findings, confidence, triage verdicts
171175
- [Troubleshooting](docs/troubleshooting.md) — Common errors and fixes
176+
- [Argus Analysis](docs/argus-analysis.md) — Evidence verification techniques
177+
- [CI Integration](docs/ci-integration.md) — Continuous integration setup
178+
- [Cloudflare Security Audit Skill Analysis](docs/cloudflare-security-audit-skill-analysis.md) — Domain-routed hunt prompts
172179

173180

174181
### Reading Order

‎docs/README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Documentation for baco — a 23-phase LLM-assisted code scanner.
1010
|------|-------------|
1111
| [architecture.md](architecture.md) | The 23-phase pipeline, PhaseGraph, data flow |
1212
| [configuration.md](configuration.md) | All config options, LLM setup, phase flags |
13-
| [research-integration.md](research-integration.md) | The 31 papers integrated into baco |
13+
| [research-integration.md](research-integration.md) | Research-backed design and paper integrations |
1414
| [ci-integration.md](ci-integration.md) | CI/CD setup with SARIF output |
1515
| [llm-vuln-detection-papers-survey.md](llm-vuln-detection-papers-survey.md) | Full survey of 36 papers |
1616
| [example-report-screenshot.png](example-report-screenshot.png) | Sample HTML report preview |

‎docs/architecture.md‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ BACO uses a **data-driven PhaseGraph** (`src/scanner/pipeline/orchestrator.rs`)
3030
| 11 | Ticket Cross-Reference | `tickets.systems` non-empty |
3131
| 12 | Git Analysis | Target is a git repository |
3232
| 13 | Cross-File Analysis | Always-on |
33-
| 14 | Confidence Scoring | `normalization.enabled=false` |
33+
| 14 | Confidence Scoring | `scanner.performance.enable_confidence_refinement=false` |
3434
| 15 | AI Aggregation | `llm.phases.aggregation` (API key present) |
3535
| 16 | Threat Modeling | `scanner.performance.enable_threat_modeling=false` |
3636
| 17 | Root Cause Deduplication | `scanner.performance.enable_root_cause_dedup=true` |
@@ -67,7 +67,7 @@ flowchart LR
6767
6868
subgraph PostProcessing["Post-Processing"]
6969
direction TB
70-
E1[Root Cause Dedup] --> E2[Multi-Verifier] --> E3[Auto-Patch] --> E4[CVE Bootstrap] --> E5[PoC Compiler] --> E6[Variant Search]
70+
E1[Root Cause Dedup] --> E2[Auto-Patch] --> E3[CVE Bootstrap] --> E4[PoC Compiler] --> E5[Variant Search]
7171
end
7272
7373
subgraph Output["Output"]
@@ -79,7 +79,7 @@ flowchart LR
7979
B3 --> C1
8080
C5 --> D1
8181
D2 --> E1
82-
E6 --> F1
82+
E5 --> F1
8383
8484
classDef parallel fill:#e1f5fe
8585
classDef discovery fill:#fff3e0
@@ -100,7 +100,7 @@ The pipeline includes several verification gates and calibration layers that aug
100100

101101
Before rendering the final report, deterministic checks verify that all citations (file paths + line ranges) match the scanned source tree. Findings failing this check have their confidence score halved and a note added explaining the discrepancy.
102102

103-
Configured via `[citation_verification] enabled = true`.
103+
Configured via `[citation_verification] enabled = false` (disabled by default).
104104

105105
### Prior-Runs Store (Discovery Phase)
106106

@@ -132,5 +132,5 @@ When the Docker sandbox is unavailable, unverifiable findings are marked with `r
132132

133133
### Eval Harness (External)
134134

135-
Known-answer oracle scoring under `eval/` with labeled vulnerable/secure fixture pairs and oracle files. Recall/precision scoring via `src/eval.rs`; end-to-end runs require `BACO_EVAL=1` + LLM key. See [`eval/README.md`](../eval/README.md).
135+
Known-answer oracle scoring under `eval/` with labeled vulnerable/secure fixture pairs and oracle files. Recall/precision scoring via `src/eval.rs`; end-to-end runs use `BACO_EVAL_FLOOR` env var. See [`eval/README.md`](../eval/README.md).
136136

‎docs/argus-analysis.md‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
# Research: argusappsec/argus → baco adoption analysis
22

33
Source: https://github.com/argusappsec/argus (Go daemon, Apache-2.0, pre-1.0,
4-
24 ADRs + design docs). Analyzed 2026-09-01. Companion analysis:
5-
docs/cloudflare-security-audit-skill-analysis.md (5 items from that report
6-
already implemented in commit 61e2c80 — not repeated here).
4+
24 ADRs + design docs). Analyzed 2026-09-01.
75

86
## Summary
97

‎docs/ci-integration.md‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# CI Integration Guide
22

3-
BACO outputs SARIF 2.1 format (`report.sarif`), which GitHub Code Scanning, Azure DevOps, and other CI tools can ingest to display findings as PR annotations and security alerts.
3+
A scan writes `findings.json`, `findings.md` and `report.html` to the output directory. SARIF 2.1 is produced separately, with `baco report --format sarif`, and that file (`report.sarif`) is what GitHub Code Scanning, Azure DevOps and other CI tools ingest to display findings as PR annotations and security alerts.
44

55
## GitHub Actions Setup
66

@@ -32,16 +32,21 @@ jobs:
3232

3333
- name: Run BACO Scan
3434
env:
35-
MISTRAL_API_KEY: ${{ secrets.MISTRAL_API_KEY }}
35+
LLM_API_KEY: ${{ secrets.LLM_API_KEY }}
3636
run: ./target/release/baco scan --config baco.toml
3737

38+
- name: Generate SARIF
39+
run: ./target/release/baco report --input baco-output/findings.json --format sarif --config baco.toml
40+
3841
- name: Upload SARIF to GitHub Code Scanning
3942
uses: github/codeql-action/upload-sarif@v3
4043
with:
4144
sarif_file: baco-output/report.sarif
4245
```
4346
44-
**Required:** Set `MISTRAL_API_KEY` (or your LLM provider key) as a GitHub repository secret.
47+
**Required:** Set `LLM_API_KEY` as a GitHub repository secret. Without it the LLM phases are skipped and the scan falls back to the non-LLM phases only.
48+
49+
**Note on `baco report --config`:** The `baco report` command accepts a `--config` flag to apply the evidence gate to report output. Without `--config`, the evidence gate is not applied to `baco report` output.
4550

4651
## Configuration
4752

‎docs/cloudflare-security-audit-skill-analysis.md‎

Lines changed: 0 additions & 121 deletions
This file was deleted.

0 commit comments

Comments
 (0)