Skip to content

fix(report): stop reports from leaking secrets and exclusion noise - #87

Draft
pixincreate wants to merge 2 commits into
fix/trust-boundariesfrom
fix/report-hygiene
Draft

fix(report): stop reports from leaking secrets and exclusion noise#87
pixincreate wants to merge 2 commits into
fix/trust-boundariesfrom
fix/report-hygiene

Conversation

@pixincreate

Copy link
Copy Markdown
Owner

Stacked on #86.

Summary

Reports leaked the very thing the tool exists to protect, and were mostly noise.

Changes

  • Plaintext secrets in reports. Finding.matched_content was serialized verbatim into JSON, so --verbose printed credentials to stdout and --output wrote them to disk — a report uploaded as a CI artifact became an exfiltration channel. SARIF output had always omitted them; JSON now matches. Matched text is redacted to its first four characters plus a length (AKIA... (20 chars, redacted)), enough to identify a finding without reproducing it. --show-secrets opts back in.
  • --output inherited umask (0644 by default). Now created 0600.
  • excluded_files listed every excluded path. Excluding target/** in a Rust repo produced 46,310 entries and a 4.6 MB report describing 61 scanned files. It is now excluded: { count, sample } with a 20-path sample — the same scan emits 120 KB.

Tests

184 pass. Redaction is asserted in both directions (default redacts, --show-secrets doesn't); report-shape tests updated.

A report is routinely written to a file or uploaded as a CI artifact,
and it carried every matched credential in plaintext while SARIF output
had always omitted them. Matched text is now redacted to its first four
characters and a length, which is enough to identify a finding without
reproducing it; --show-secrets opts back in. --output files are created
0600 rather than inheriting umask.

excluded_files listed every excluded path, so excluding target/** in a
Rust repository produced 46,310 entries and a 4.6 MB report describing
61 scanned files. It is now a count plus a bounded sample: the same scan
emits 120 KB.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant