-
Notifications
You must be signed in to change notification settings - Fork 18
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
git plugin - option to limit depth of historical scans (default all commits) #94
Comments
@jossef What does this "number" represents? I think we should use a "range" of time like we do in Discord, or use a counter to limit how many commits we scan, or use a specific commit baseline. Of course, as we are using the |
I'm working on this issue |
number = how many commits to go back from HEAD |
Closes #94 - add the `depth` field to the `GitPlugin` struct - add the `depth` option to the git plugin command - create a function called `buildScanOptions` to generate a string of scanning options for the _gitleaks_ `GitLog` function - by default, _gitleaks_ `GitLog` function scans using `--full-history` and `--all` options (see: https://github.com/gitleaks/gitleaks/blob/master/detect/git/git.go#L44). The reason these options are embedded in `buildScanOptions` is to maintain this behavior - tested manually **Proposed Changes** - feat: add `--depth <number>` option to git plugin command **Additional Considerations** - `GitLog` `--all` option scans the entire repo (including all branches). users may prefer to scan only a specific branch instead of the entire repository. - Not directly related, but the current behavior of the git plugin is to skip deleted files (https://github.com/Checkmarx/2ms/blob/master/plugins/git.go#L48). In case there is an unnoticed leak in a deleted file, the secret will still exist in the git history and will be missed. I submit this contribution under the Apache-2.0 license. --------- Co-authored-by: Jossef Harush Kadouri <[email protected]> Co-authored-by: Baruch Odem (Rothkoff) <[email protected]> Co-authored-by: Baruch Odem (Rothkoff) <[email protected]>
add a number argument that is going to limit the historical scans when using the
git
pluginThe text was updated successfully, but these errors were encountered: