Skip to content

🔒 Add Git-leaks Pre-commit Hook#58

Merged
vtiwari-story merged 1 commit intomainfrom
git-leaks-precommit-hook
Oct 23, 2025
Merged

🔒 Add Git-leaks Pre-commit Hook#58
vtiwari-story merged 1 commit intomainfrom
git-leaks-precommit-hook

Conversation

@vtiwari-story
Copy link
Contributor

This PR adds a pre-commit configuration with git-leaks to automatically detect and prevent commits containing secrets, API keys, passwords, and other sensitive information.

What's Changed

  • Added .pre-commit-config.yaml with git-leaks hook
  • Configured git-leaks v8.28.0 with verbose and redacted output
  • Pre-commit hooks are now installed and active

Why This Matters

  • Security: Prevents accidental commits of sensitive data
  • Compliance: Ensures repository follows security best practices
  • Automation: Runs automatically on every commit
  • Team Safety: Protects all contributors from security mistakes

How It Works

  • Git-leaks scans all staged files before each commit
  • If secrets are detected, the commit is blocked
  • Verbose output shows what was found (redacted for security)
  • Contributors can fix issues before committing

Testing

✅ The setup has been tested and verified to work correctly
✅ Test commits containing secrets are properly blocked
✅ Normal commits without secrets proceed as expected

Next Steps

After merging this PR:

  1. All team members should run pre-commit install in their local repos
  2. Existing secrets in the repository should be rotated if any are found
  3. Consider running gitleaks detect on the entire repository history

This change enhances our security posture and helps maintain clean, secure code.

@vtiwari-story vtiwari-story merged commit dbffda6 into main Oct 23, 2025
6 checks passed
@vtiwari-story vtiwari-story deleted the git-leaks-precommit-hook branch October 23, 2025 00:41
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.

1 participant