Return actual secret strings for private keys when appear in same line #646
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.
Currently when private key secrets are detected, the secret value that is returned in the output refers only to the generic
BEGIN PRIVATE KEY
opening and not to the secret key itself.Ideally this should be handled as a multiline secret, since its mostly includeing new lines within it and so the opening wrapper is inspected in a different
scan_line
iteration that the key itself.For now, I added this change that returns the actual key, if the input is parsed in a way that escapes new line characters, like json.dumps(). So it still doesnt cover all of the use cases with the right secret value, but at least those that can be easily treated with the single line scanning method.