fix(preset.py): Enforce redacted secrets - #3136
Merged
Merged
Conversation
Collaborator
|
Hey! thanks for the PR. We agree that the current behavior of writing secrets should not be the default behavior. I just want to add a comment in the resulting preset.yml noting that the keys have been redacted, and instructing on how to reenable. I'd also like this to be an actual config option - your change makes it option at the function level, but its currently not wired to anything. |
Every run was printing API tokens directly to disk.
ausmaster
approved these changes
Jun 8, 2026
Contributor
|
Thanks very much for the PR @OAuthBringer ! |
ausmaster
approved these changes
Jun 8, 2026
ausmaster
self-requested a review
June 9, 2026 01:27
ausmaster
approved these changes
Jun 9, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #3136 +/- ##
=====================================
+ Coverage 90% 90% +1%
=====================================
Files 447 447
Lines 40462 40476 +14
=====================================
+ Hits 36320 36335 +15
+ Misses 4142 4141 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Merged
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.
Observed Behavior
Presets were dumping tokens to disk on every scan, specifically when using api_token credentials for github_org.
Expected Behavior
Presets should not dump secrets to text (by default), and this minimally should be configurable.
Notes
There may be some reason this is desirable behavior (repeat scan configurations etc), but in my case it was adding a lot of text drift and I at least wanted to turn it off locally. This was a very quick pass at patching things on my end. Happy to hear any feedback.