Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(secrets): Remove both random and base64 entropy secrets finding #6969

Merged
merged 5 commits into from
Feb 3, 2025

Conversation

pazbechor
Copy link
Contributor

@pazbechor pazbechor commented Jan 24, 2025

User description

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes # (issue)

New/Edited policies (Delete if not relevant)

Description

Include a description of what makes it a violation and any relevant external links.

Fix

How does someone fix the issue in code and/or in runtime?

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my feature, policy, or fix is effective and works
  • New and existing tests pass locally with my changes

Generated description

Below is a concise technical summary of the changes proposed in this PR:

Modifies the handling of high entropy secrets detection in the checkov/secrets/runner.py file. Introduces logic to prioritize Random High Entropy checks over Base64 High Entropy checks when both are detected on the same line. This change aims to reduce false positives and improve the accuracy of secret detection.

TopicDetails
Entropy Check Logic Refines the handling of high entropy secrets detection by prioritizing Random High Entropy over Base64 High Entropy checks.
Modified files (1)
  • checkov/secrets/runner.py
Latest Contributors(2)
UserCommitDate
[email protected]feat-secrets-Masking-s...November 17, 2024
[email protected]feat-secrets-Adding-ch...November 17, 2024
Code Refactoring Improves code organization by introducing new constants and restructuring the secrets processing logic.
Modified files (1)
  • checkov/secrets/runner.py
Latest Contributors(2)
UserCommitDate
[email protected]feat-secrets-Masking-s...November 17, 2024
[email protected]feat-secrets-Adding-ch...November 17, 2024
This pull request is reviewed by Baz. Join @pazbechor and the rest of your team on (Baz).

pazbechor added 2 commits January 24, 2025 15:34
… (in multiline policy) captured, so matching group will be the match & empty matching as only one pattern caught the secret
@tsmithv11 tsmithv11 changed the title fix(secrets) Remove both random and base64 entropy secrets finding fix(secrets): Remove both random and base64 entropy secrets finding Jan 24, 2025
@Saarett
Copy link
Contributor

Saarett commented Jan 27, 2025

Great work @pazbechor ! Do we have any relevant tests that needs to be changed/added?

@pazbechor pazbechor marked this pull request as ready for review February 3, 2025 15:40
@pazbechor pazbechor merged commit 0633858 into main Feb 3, 2025
47 checks passed
@pazbechor pazbechor deleted the bugfix-remove-both-random-and-base64-entropy branch February 3, 2025 16:15
Saarett pushed a commit that referenced this pull request Feb 3, 2025
…6969)

* fix a bug where multiple regex are being supplied seperated by | sign (in multiline policy) captured, so matching group will be the match & empty matching as only one pattern caught the secret

* adding the fix. Should be merged only after merging this PR #6967

* .

* .

---------

Co-authored-by: pazbechor <[email protected]>
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.

4 participants