fix(report): stop reports from leaking secrets and exclusion noise - #87
Draft
pixincreate wants to merge 2 commits into
Draft
fix(report): stop reports from leaking secrets and exclusion noise#87pixincreate wants to merge 2 commits into
pixincreate wants to merge 2 commits into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #86.
Summary
Reports leaked the very thing the tool exists to protect, and were mostly noise.
Changes
Finding.matched_contentwas serialized verbatim into JSON, so--verboseprinted credentials to stdout and--outputwrote 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-secretsopts back in.--outputinherited umask (0644 by default). Now created 0600.excluded_fileslisted every excluded path. Excludingtarget/**in a Rust repo produced 46,310 entries and a 4.6 MB report describing 61 scanned files. It is nowexcluded: { 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-secretsdoesn't); report-shape tests updated.