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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pre-push hook for brakeman #413

Closed

Conversation

@morizyun
Copy link
Contributor

@morizyun morizyun commented Aug 13, 2016

This hook is to run brakeman to check static analysis security vulnerability.
As @ZeroS said in #406, I would like to run the hook to scan all project before git-push.

I am not good at English, but I will always do my best.
If you have any question or advice, please don't hesitate to tell me. 馃嵒

README.md Outdated
@@ -533,6 +533,7 @@ aborted.
* [ProtectedBranches](lib/overcommit/hook/pre_push/protected_branches.rb)
* [RSpec](lib/overcommit/hook/pre_push/r_spec.rb)
* [TestUnit](lib/overcommit/hook/pre_push/test_unit.rb)
* [Brakeman](lib/overcommit/hook/pre_commit/brakeman.rb)

This comment has been minimized.

@sds

sds Aug 18, 2016
Owner

This should be lib/overcommit/hook/pre_push/brakeman.rb as it is a pre-push hook.

This comment has been minimized.

@morizyun

morizyun Aug 18, 2016
Author Contributor

Thanks!!

flags: ['--exit-on-warn', '--quiet', '--summary']
install_command: 'gem install brakeman'
include:
- '**/*.rb'

This comment has been minimized.

@sds

sds Aug 18, 2016
Owner

Brakeman operates on more than just Ruby files. It also cares about ERB templates and other code.

It might be worth auditing their codebase to find all the file types and include an exhaustive list here, or we can omit the include option entirely and always run Brakeman on every push.

This comment has been minimized.

@morizyun

morizyun Aug 18, 2016
Author Contributor

That's right. I will omit include option.

@sds sds added the enhancement label Aug 18, 2016
@sds
Copy link
Owner

@sds sds commented Aug 18, 2016

Thanks for the pull request, @morizyun!

Too small comments which need addressing and this is good to go!

@sds sds closed this Aug 18, 2016
@sds sds reopened this Aug 18, 2016
@morizyun
Copy link
Contributor Author

@morizyun morizyun commented Aug 18, 2016

@sds Thank you very much for your kind comments. I am going to fix them.

@sds
Copy link
Owner

@sds sds commented Aug 18, 2016

Merged in b504142. Thanks!

@sds sds closed this Aug 18, 2016
@morizyun morizyun changed the title Add pre-commit hook for brakeman Add pre-push hook for brakeman Aug 20, 2016
@lfv89
Copy link

@lfv89 lfv89 commented Aug 31, 2016

Hey @sds!

I'm really looking forward to use this, but I don't want to point the gem directly to github. When will this be released to rubygems? Thank you.

@sds
Copy link
Owner

@sds sds commented Aug 31, 2016

0.36.0 has been released.

@lfv89
Copy link

@lfv89 lfv89 commented Sep 1, 2016

I'm not able to make it work :-(

I updated overcommit to 0.36.0, added the brakeman gem, configured the .overcommit.yml file, run overcommit --install again but brakeman doesn't run before a git push. Any ideas? Thanks.

@sds
Copy link
Owner

@sds sds commented Sep 1, 2016

Hey @lfv89,

Perhaps @morizyun can share his configuration with you to help out. Make sure your configuration is under the PrePush section, and not the PreCommit (which was where Brakeman used to be located).

Otherwise you'll need to include your .overcommit.yml in order for anyone to help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants