Skip to content

Commit d0fdc07

Browse files
committed
feat: add security policy suppressions
1 parent 77fa4ac commit d0fdc07

8 files changed

Lines changed: 386 additions & 15 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
5555
- Cybersecurity plugin roadmap covering broad agent-workspace security checks plus Brigade-specific scanner, doctor, import, and multi-harness security checks.
5656
- Built-in `security` station and `brigade security scan` for read-only agent workspace security checks.
5757
- `brigade security scan --import-findings` to route security findings into the local work import inbox for review.
58+
- `brigade security init` to write gitignored local defaults to `.brigade/security.toml`.
59+
- Security policy presets (`personal`, `public-repo`, `strict`), template scanning controls, stable finding fingerprints, and fingerprint suppressions.
60+
- Security scan secret evidence is redacted before reports or work imports are written.
5861
- `ROADMAP.md` covering the daily-driver path, scanner-ready inbox, chat-surface scanners, memory-card decay refresh, and portable operator setup.
5962
- `brigade work note` to append timestamped checkpoints to the active work session without ending it.
6063
- `brigade work doctor` to check dogfood config, Codex availability, local artifact paths, handoff inbox, ignore coverage, and latest run context for the daily work loop.
@@ -71,7 +74,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7174
- `brigade work run` now consumes the oldest pending ledger task before falling back to the latest extracted dogfood next step, and marks consumed tasks done after successful runs.
7275
- `brigade work task add --from-next` now reuses an equivalent pending task instead of adding duplicates.
7376
- `brigade work brief` now includes pending local work imports and import counts in both text and JSON output.
74-
- The managed gitignore block now treats `.brigade/dogfood.toml` and `.brigade/runs/` as local state.
77+
- The managed gitignore block now treats `.brigade/dogfood.toml`, `.brigade/security.toml`, and `.brigade/runs/` as local state.
7578
- Live smoke docs now keep Codex agent execution in a trusted repo cwd while writing temporary roster, artifacts, and handoff output under `/tmp`.
7679
- Handoff write failures now preserve final run artifacts, print the final answer, return nonzero, and mark `run.json` as `handoff-failed`.
7780
- Dogfood runs default to prompt-level read-only plus Codex's `danger-full-access` sandbox setting for trusted-workspace use so repo inspection works on hosts where native read-only sandboxing blocks shell inspection; `--native-read-only-sandbox` opts into stricter native enforcement.

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,9 @@ Inspect a completed run without opening each JSON file:
202202
brigade runs list --cwd /path/to/repo
203203
brigade runs latest --cwd /path/to/repo
204204
brigade runs show .brigade/runs/<run-id>
205+
brigade security init
205206
brigade security scan --target .
207+
brigade security scan --target . --policy public-repo
206208
brigade security scan --target . --import-findings
207209
```
208210

@@ -287,7 +289,7 @@ brigade add guard # content-guard
287289
brigade add tokens # tokenjuice
288290
```
289291

290-
`security` is a built-in station with no external managed tool yet. Run `brigade security scan --target .` for a read-only agent workspace security report, or add `--import-findings` to turn findings into local `brigade work import` review items.
292+
`security` is a built-in station with no external managed tool yet. Run `brigade security scan --target .` for a read-only agent workspace security report, or add `--import-findings` to turn findings into local `brigade work import` review items. Secret evidence is redacted before reports or imports are written. Use `brigade security init` to write gitignored local defaults to `.brigade/security.toml`; it supports policy presets (`personal`, `public-repo`, `strict`), `fail_on`, template scanning, and fingerprint suppressions for reviewed findings.
291293

292294
The current managed tools:
293295

ROADMAP.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,17 +63,18 @@ Brigade-specific additions:
6363
- Integrate with `brigade doctor` as a security station and with `brigade work import` so findings can become reviewable local tasks instead of only console output.
6464
- Provide safe auto-fix only for narrow cases such as replacing obvious hardcoded sample secrets, tightening generated allow-list examples, or adding missing ignore rules.
6565
- Produce Memory Handoffs for durable security findings while keeping raw secret evidence redacted.
66-
- Add policy packs for personal dogfooding, public-repo release checks, CI gates, and strict enterprise workspaces.
66+
- Add policy packs for personal dogfooding, public-repo release checks, CI gates, and strict enterprise workspaces. Status: started with `personal`, `public-repo`, and `strict`.
6767
- Include dependency and package-manager hardening checks for agent plugin ecosystems, MCP packages, skills, and local tool wrappers.
6868
- Track false-positive taxonomy, runtime-confidence rules, suppressions, and regression fixtures as first-class project artifacts.
6969

7070
First build slice:
7171

72-
- Create a plugin scaffold and security scan contract. Status: started with built-in `security` station and `brigade security scan`.
72+
- Create a plugin scaffold and security scan contract. Status: started with built-in `security` station, `brigade security init`, and `brigade security scan`.
7373
- Start with config discovery and read-only reporting for Brigade, Claude Code, Codex, and MCP config files. Status: started.
7474
- Add core rule categories for secrets, permissions, hooks, MCP servers, supply-chain patterns, and agent instructions. Status: started.
7575
- Output JSON plus readable text, then route selected findings into `brigade work import`. Status: started with `--import-findings`.
7676
- Keep all raw findings local and gitignored unless the operator explicitly exports an evidence pack. Status: current default.
77+
- Add local policy defaults, stable finding fingerprints, and suppressions. Status: started with `.brigade/security.toml`.
7778

7879
## Later Phase: Memory Card Decay And Refresh
7980

src/brigade/cli.py

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,15 +388,37 @@ def _build_parser() -> argparse.ArgumentParser:
388388
p_security = sub.add_parser("security", help="Scan agent workspace security posture.")
389389
security_sub = p_security.add_subparsers(dest="security_command", metavar="<security-command>")
390390
security_sub.required = True
391+
p_security_init = security_sub.add_parser("init", help="Write local security scan defaults.")
392+
p_security_init.add_argument("--target", "-t", type=Path, default=Path("."), help="Repo or workspace to configure.")
393+
p_security_init.add_argument("--force", action="store_true", help="Overwrite an existing security config.")
391394
p_security_scan = security_sub.add_parser("scan", help="Run a read-only agent workspace security scan.")
392395
p_security_scan.add_argument("--target", "-t", type=Path, default=Path("."), help="Repo or workspace to scan.")
393396
p_security_scan.add_argument("--json", action="store_true", help="Print machine-readable JSON.")
397+
p_security_scan.add_argument(
398+
"--policy",
399+
choices=["personal", "public-repo", "strict"],
400+
default=None,
401+
help="Policy preset. Defaults to .brigade/security.toml or personal.",
402+
)
394403
p_security_scan.add_argument(
395404
"--fail-on",
396405
choices=["none", "low", "medium", "high", "critical"],
397-
default="critical",
406+
default=None,
398407
help="Return nonzero when a finding at or above this severity exists.",
399408
)
409+
p_security_scan.add_argument(
410+
"--include-templates",
411+
dest="include_templates",
412+
action="store_true",
413+
default=None,
414+
help="Include public template files in scanner findings.",
415+
)
416+
p_security_scan.add_argument(
417+
"--no-include-templates",
418+
dest="include_templates",
419+
action="store_false",
420+
help="Exclude public template files from scanner findings.",
421+
)
400422
p_security_scan.add_argument(
401423
"--import-findings",
402424
action="store_true",
@@ -761,11 +783,15 @@ def main(argv=None) -> int:
761783
if cmd == "security":
762784
from . import security_cmd
763785

786+
if args.security_command == "init":
787+
return security_cmd.init(target=args.target, force=args.force)
764788
if args.security_command == "scan":
765789
return security_cmd.scan(
766790
target=args.target,
767791
json_output=args.json,
792+
policy=args.policy,
768793
fail_on=args.fail_on,
794+
include_templates=args.include_templates,
769795
import_findings=args.import_findings,
770796
)
771797
parser.error(f"unknown security command: {args.security_command}")

src/brigade/install.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ def build_gitignore_block(selection: Selection) -> str:
6262
"",
6363
"# brigade local state (logs, scrub cache, dogfood runs, work sessions).",
6464
".brigade/dogfood.toml",
65+
".brigade/security.toml",
6566
".brigade/logs/",
6667
".brigade/runs/",
6768
".brigade/scrub-cache/",

0 commit comments

Comments
 (0)