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 check for overridden hooks path #91

Merged
merged 2 commits into from
Aug 26, 2024

Conversation

markdboyd
Copy link
Contributor

Changes proposed in this pull request:

Follow-up to #89

We discovered that for repos which were overriding core.hooksPath, such as those using tools like husky, gitleaks was not running. And the test in make audit that should catch when core.hooksPath is overridden was not failing on these repos.

This PR fixes the check to correctly detect when core.hooksPath is overridden and fails appropriately. The PR also adds a CI test to ensure that this behavior works as expected.

security considerations

This PR improves security by ensuring that make audit for gitleaks will fail on any repo where core.hooksPath is overridden, which in turn prevents gitleaks from running. The make audit failure should in turn force the repo owners to remove the override for core.hooksPath.

@markdboyd markdboyd requested review from a team as code owners August 26, 2024 19:38
@markdboyd markdboyd merged commit b584c81 into main Aug 26, 2024
2 checks passed
@markdboyd markdboyd deleted the fix-check-for-overridden-hooks-path branch August 26, 2024 19:50
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.

2 participants