Skip to content

fix(security): honor exclusions and stabilize fingerprints - #539

Merged
solomonneas merged 2 commits into
mainfrom
t3code/security-scanner-exclusions-fingerprints
Jul 26, 2026
Merged

fix(security): honor exclusions and stabilize fingerprints#539
solomonneas merged 2 commits into
mainfrom
t3code/security-scanner-exclusions-fingerprints

Conversation

@solomonneas

@solomonneas solomonneas commented Jul 26, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • make .brigade/** and other trailing /** exclusions prune their repo-relative subtree before files are opened
  • replace line-addressed finding fingerprints with rule, path, redacted matched content, duplicate cardinality, and duplicate occurrence
  • preserve exact legacy singleton suppressions across the upgrade with a validated local legacy-to-primary map
  • keep show, suppress, unsuppress, report review, diff, accepted-risk health, and work imports consistent with the new identity

#529 root cause

exclude_paths was already parsed, resolved, applied by the scan engine, and projected into reports. The failure was in _path_matches_any: it treated .brigade/** as literal path text, so neither .brigade nor its descendants matched and the walk entered evidence bundles.

The reported null config clue did not identify dropped plumbing. brigade security config --json nests resolved settings under .config, so the resolved value is .config.exclude_paths, not a top-level field.

The matcher keeps path settings as literal repo-relative prefixes. Only a trailing /** is accepted as an alias for the same prefix, including the named root. Bracketed paths such as app/[id] remain literal.

#530 identity and migration

The primary fingerprint no longer contains the absolute line. It hashes rule_id, repo-relative path, a normalized redacted excerpt, and occurrence. Identical matches in one file include duplicate cardinality and occurrence, so suppressing one does not hide another. Adding or removing an identical duplicate rekeys that group and requires review instead of transferring a suppression.

Each finding also carries the old line-based fingerprint. An exact legacy singleton suppression is migrated to the primary fingerprint and recorded in .brigade/security/fingerprint-migration-map.json. Duplicate groups never inherit a singleton legacy alias. Old report bundles and direct legacy IDs remain manageable through the map.

For the observed fingerprints, 68041634653069ec and 3076e8de762703a9 remain legacy line-based identities. If the first upgraded scan sees the finding at the original location, 68041634653069ec maps to one content fingerprint; after lines move, that primary stays unchanged and 3076e8de762703a9 is only the current legacy alias. If the first upgraded scan happens after the move, the old fingerprint cannot be matched safely and needs one review under the content identity.

This stops new history entries caused only by unrelated line shifts. Existing reports, imported history, and historical totals are not rewritten.

Verification

brigade work verify run --target . --command "./scripts/verify" --capture brigade-work

All checks passed!
532 files already formatted
Success: no issues found in 317 source files
version=0.25.1 checked=13 locations
managed snapshot: ok (6 manifests)
4252 passed, 3 skipped in 327.34s (0:05:27)
Total coverage: 82.77%

Codex review found and drove regression coverage for duplicate cardinality, symlinked closeout state, historical report IDs and diffs, accepted-risk health, stale-report unsuppression, scan-time map use, and severity changes in work imports.

Closes #529
Closes #530

_path_matches_any treated ** patterns as literal prefixes, so exclude_paths
never pruned .brigade evidence bundles or security.toml from scans.

Co-Authored-By: Codex <codex@openai.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@coderabbitai

coderabbitai Bot commented Jul 26, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one) (1)
  • coderabbit-review

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository: escoffier-labs/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 6cf869c7-b64e-42e0-a37d-537027231c69

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch t3code/security-scanner-exclusions-fingerprints

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@solomonneas solomonneas self-assigned this Jul 26, 2026
Keep suppressions stable across unrelated line shifts while preserving distinct identities for duplicate findings. Migrate exact legacy singleton suppressions through a validated local alias map and keep report, health, diff, and import behavior compatible.

Co-Authored-By: Codex <codex@openai.com>

Co-authored-by: Cursor <cursoragent@cursor.com>
@solomonneas
solomonneas force-pushed the t3code/security-scanner-exclusions-fingerprints branch from 735e593 to dcdde06 Compare July 26, 2026 17:20
@solomonneas
solomonneas marked this pull request as ready for review July 26, 2026 17:21
@solomonneas
solomonneas merged commit 61cb1dc into main Jul 26, 2026
28 checks passed
@solomonneas
solomonneas deleted the t3code/security-scanner-exclusions-fingerprints branch July 26, 2026 22:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant