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

feat(secrets): improve timing git history #4890

Merged
merged 14 commits into from
Apr 16, 2023
Merged

Conversation

marynaKK
Copy link
Contributor

@marynaKK marynaKK commented Apr 13, 2023

  • added skip file list for skipping .md files in githistory
  • moved static functions to a class in GitHistoryScanner
  • added root folder in the git command:
base_diff_format = f'diff --git {root_folder}/{file_diff.a_path} {root_folder}/{file_diff.b_path}' \
                   f'\nindex 0000..0000 0000\n--- {root_folder}/{file_diff.a_path}\n+++ {root_folder}/{file_diff.b_path}\n'

Checklist:

  • My code follows the style guidelines of this project
  • 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
  • Any dependent changes have been merged and published in downstream modules

checkov/secrets/scan_git_history.py Outdated Show resolved Hide resolved
checkov/secrets/scan_git_history.py Outdated Show resolved Hide resolved
checkov/secrets/scan_git_history.py Outdated Show resolved Hide resolved
def __init__(self, root_folder: str, secrets: SecretsCollection,
history_store: Optional[GitHistorySecretStore] = None, timeout: int = 43200):
self.root_folder = root_folder
self.secrets = secrets
self.timeout = timeout
# in case we start from mid-history (git) we want to continue from where we've been
self.history_store = history_store or GitHistorySecretStore()
self.history_store: GitHistorySecretStore = history_store or GitHistorySecretStore()
self.raw_store: List[RawStore] = []
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't see a reason to save it in the class as it's being used once to trasfer from history store to secret store

@omryMen omryMen merged commit 944bc36 into main Apr 16, 2023
@omryMen omryMen deleted the enhance-timing-githistory branch April 16, 2023 08:42
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