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

add --max-target-megabytes : maximum size for a file/blob to be scanned #1003

Merged
merged 5 commits into from
Oct 10, 2022

Conversation

roma8389
Copy link
Contributor

@roma8389 roma8389 commented Oct 6, 2022

Description:

Adding maximum size for a file/blob to be scanned via a new switch case in the CLI --max-target-megabytes

Checklist:

  • Does your PR pass tests? yes
  • Have you written new tests for your changes? no
  • Have you lint your code locally prior to submission? yes

@jit-ci
Copy link

jit-ci bot commented Oct 6, 2022

Hi, I’m Jit, a friendly security platform designed to help developers build secure applications from day zero with an MVS (Minimal viable security) mindset.

All security workflows are defined in a centralized repository named .jit.
In case there are security findings, they will be communicated to you as a comment inside the PR.

Hope you’ll enjoy using Jit.

Questions? Comments? Want to learn more? Get in touch with us.

README.md Outdated
@@ -160,6 +160,7 @@ Flags:
-b, --baseline-path path to a previously generated report with known issues that gitleaks should ignore
-s, --source string path to source (git repo, directory, file)
-v, --verbose show verbose output from scan
--max-target-megabytes maximum size for a file/blob to be scanned
Copy link
Contributor

Choose a reason for hiding this comment

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

I suggest adding something like "Files larger than this will be skipped". Just to be totally explicit about the behavior.

@weineran
Copy link
Contributor

weineran commented Oct 6, 2022

Thanks for the PR @roma8389 !

Linking the PR to this issue: #1001 (Let me know if I misunderstood, but I believe this PR is intended to resolve this issue)

@roma8389
Copy link
Contributor Author

roma8389 commented Oct 6, 2022

Sure np will add Files larger than this will be skipped to read me as u mention. ty for your feedback

@roma8389
Copy link
Contributor Author

roma8389 commented Oct 7, 2022

@weineran any chance u can check the PR, i adjust the push according to your comment.
if u accept the PR can u create a build after it. ty!

Copy link
Collaborator

@zricethezav zricethezav left a comment

Choose a reason for hiding this comment

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

@roma8389 did some local testing of this feature and it seems to be working great! I think this is a really useful feature. Thanks for the PR. This will go into the next release. Just need to update one "help" message then this is good to go.

Per #1001

i was wonder if it possible to get a CLI switch where i will add timeout pre rule

I think this is also a worthwhile feature to introduce FWIW

cmd/root.go Outdated Show resolved Hide resolved
@zricethezav zricethezav merged commit c0caab0 into gitleaks:master Oct 10, 2022
@zricethezav zricethezav added the Hacktoberfest https://hacktoberfest.digitalocean.com/ label Oct 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Hacktoberfest https://hacktoberfest.digitalocean.com/
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants