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): omit all secrets value in line #6802

Merged
merged 5 commits into from
Oct 30, 2024

Conversation

achiar99
Copy link
Contributor

@achiar99 achiar99 commented Oct 29, 2024

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)
If there are more than one secrets in one line - omit all the values

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

Dear maintainer, below is a concise technical summary of the changes proposed in this PR:

Enhance the Runner class in checkov/secrets/runner.py to handle multiple secrets on a single line by omitting all secret values. Introduce a new data structure to map secrets by line and update the logic to censor each secret value. Add a test case in tests/secrets/test_runner.py to verify the functionality with a sample input file multiple_secrets_one_line.txt.

TopicDetails
Testing Enhancements Add a test case to verify the omission of multiple secrets on a single line.
Modified files (2)
  • tests/secrets/test_runner.py
  • tests/secrets/omit_multiple_secrets/test/multiple_secrets_one_line.txt
Latest Contributors(2)
EmailCommitDate
57212002+ChanochShayne...feat-secrets-Improve-t...July 09, 2023
[email protected]feat-secrets-add-suppo...February 01, 2023
Secret Handling Enhance the Runner class to handle multiple secrets on a single line by omitting all secret values.
Modified files (1)
  • checkov/secrets/runner.py
Latest Contributors(2)
EmailCommitDate
47931006+RabeaZr@users...fix-secrets-fix-suppre...September 10, 2024
57212002+ChanochShayne...feat-secrets-add-CKV_S...July 25, 2024
This pull request is reviewed by Baz. Join @achiar99 and the rest of your team on (Baz).

@achiar99 achiar99 changed the title omit all secrets value in line fix(secrets): omit all secrets value in line Oct 29, 2024
@achiar99 achiar99 merged commit 9ccaeaa into main Oct 30, 2024
42 checks passed
@achiar99 achiar99 deleted the omit-all-secrets-values-in-line branch October 30, 2024 15:33
Saarett pushed a commit to alanszlosek/checkov that referenced this pull request Oct 30, 2024
* omit all secrets value in line

* lint

* add test
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.

3 participants