Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Git secret scanner and protection tool - prevent API keys, passwords, and credentials from being committed (Dual Licensed: GPL v3 / Commercial)

License

Notifications You must be signed in to change notification settings

strabo231/gitsecure

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

13 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Test GitSecure

GitSecure v2.0 - Enterprise Git Secret Scanner πŸ”’

License: GPL v3 Commercial License Version Security

Stop catastrophic secret leaks before they happen. Professional-grade secret scanner that detects AWS keys, API tokens, passwords, and 50+ secret patterns with high accuracy.

⚠️ One leaked AWS key can cost $10,000+ in hours. GitSecure prevents that.


πŸš€ What's New in v2.0

  • ✨ 50+ High-Confidence Patterns - AWS, GitHub, Stripe, Slack, and more
  • 🧠 Entropy Analysis - Detect generic secrets by randomness
  • πŸ“Š HTML Security Reports - Beautiful, shareable reports
  • 🎯 Confidence Levels - HIGH/MEDIUM classification
  • ⚑ Faster Scanning - Optimized pattern matching
  • πŸ“ˆ Repository Statistics - Detailed repo insights
  • πŸ›‘οΈ Enhanced .gitignore - Comprehensive protection rules

πŸ’Ό Commercial Use & Licensing

GitSecure is dual-licensed for maximum flexibility:

πŸ†“ Open Source (GPL v3)

Free for individuals, open source projects, and evaluation. Perfect for:

  • Personal projects
  • Open source contributions
  • Learning and testing
  • Non-commercial use

πŸ’Ό Commercial License

Required for:

  • βœ… Commercial/closed-source projects
  • βœ… Companies with 5+ developers
  • βœ… Products/services using GitSecure
  • βœ… Enterprise deployments

Benefits:

  • ⚑ Priority support & SLA guarantees
  • πŸ“ž Direct communication channel
  • 🎯 Feature requests & custom integrations
  • πŸ“‹ Compliance assistance
  • πŸ’Ό Commercial indemnification
  • πŸ”’ Advanced features (team dashboard, SSO, audit trails)

πŸ“§ Contact for Commercial Licensing | πŸ’° View Pricing


πŸ’– Support Open Source Development

Using GitSecure personally or in open source? Consider sponsoring!

Sponsor

Your sponsorship helps:

  • πŸ” More secret pattern detection
  • ⚑ Faster scanning algorithms
  • 🌍 Better multi-language support
  • πŸ“š Comprehensive documentation
  • πŸ†• Free security tools for everyone

Tiers: Individual $5/mo | Supporter $15/mo | Business Custom


🎯 Why GitSecure?

The Problem

Secret leaks are catastrophic and expensive:

  • πŸ’Έ AWS keys leaked β†’ $10,000+ charges in hours
  • πŸ”“ API tokens exposed β†’ Data breaches & compliance violations
  • πŸ—„οΈ Database credentials committed β†’ Complete security compromise
  • πŸ’” One mistake can destroy a company

The Solution

GitSecure provides automated, professional-grade secret detection:

  • πŸ›‘οΈ Scan before every commit (pre-commit hook)
  • 🎯 Detect 50+ specific secret patterns with high accuracy
  • 🧠 Entropy analysis for generic secrets
  • 🚫 Block dangerous commits automatically
  • πŸ“Š Audit entire repository history
  • πŸ“ˆ Generate beautiful HTML reports
  • ⚑ Zero false positives on well-tuned patterns

πŸ“¦ Installation

Quick Install (Recommended)

curl -sSL https://raw.githubusercontent.com/strabo231/gitsecure/main/install.sh | bash

Manual Install

# Download
curl -O https://raw.githubusercontent.com/strabo231/gitsecure/main/gitsecure
chmod +x gitsecure

# Move to PATH
sudo mv gitsecure /usr/local/bin/
# or for user install
mkdir -p ~/.local/bin && mv gitsecure ~/.local/bin/

Verify Installation

gitsecure --version
# Should output: gitsecure version 2.0.0

πŸš€ Quick Start

1. Install Pre-Commit Hook (Recommended)

cd your-repo
gitsecure install-hook

Now every commit is automatically scanned for secrets! πŸ”’

2. Scan Staged Files

# Make changes
git add .

# Scan before commit
gitsecure scan

3. Audit Entire Repository

# Check all tracked files for secrets
gitsecure audit

4. Generate Security Report

# Create beautiful HTML report
gitsecure report

# Opens automatically in browser

πŸ” What Gets Detected

High Confidence Patterns (50+)

  • βœ… AWS - Access Keys, Secret Keys, Session Tokens
  • βœ… GitHub - PAT, OAuth, App Tokens, Refresh Tokens
  • βœ… Stripe - Live Keys, Secret Keys, Restricted Keys
  • βœ… Google Cloud - API Keys, OAuth Tokens, Service Accounts
  • βœ… Slack - Bot Tokens, Webhooks, Legacy Tokens
  • βœ… Private Keys - RSA, SSH, EC, PGP, DSA
  • βœ… Database URLs - PostgreSQL, MySQL, MongoDB, Redis
  • βœ… Twilio - API Keys, Account SIDs
  • βœ… SendGrid - API Keys
  • βœ… Discord - Bot Tokens, Webhooks
  • βœ… Telegram - Bot Tokens
  • βœ… DigitalOcean - Personal Access Tokens
  • βœ… Heroku - API Keys
  • βœ… Azure - Storage Keys, Connection Strings

Medium Confidence Patterns

  • ⚠️ JWT Tokens
  • ⚠️ Generic API Keys
  • ⚠️ Generic Secrets & Tokens
  • ⚠️ Bearer Tokens
  • ⚠️ Passwords in Code

Sensitive Files

  • πŸ”’ .env, .env.* files
  • πŸ”’ Private key files (.pem, .key, id_rsa)
  • πŸ”’ Certificate files (.p12, .pfx)
  • πŸ”’ Config files (credentials.json, secrets.json)

Advanced Features

  • 🧠 Entropy Analysis - Detects high-randomness strings (likely secrets)
  • πŸ“ Smart File Filtering - Ignores binary/minified files
  • 🎯 Context-Aware - Understands code structure

πŸ“– Usage Guide

Commands

scan - Scan Staged Files

Scans files staged for commit. Perfect for pre-commit hooks.

gitsecure scan

audit - Full Repository Audit

Scans all tracked files in the repository.

gitsecure audit

check <file> - Check Specific File

Scan a single file with detailed output.

gitsecure check config.json
gitsecure check .env.production

patterns - Show Detection Patterns

List all secret patterns GitSecure can detect.

gitsecure patterns

protect - Generate Secure .gitignore

Adds comprehensive secret protection rules to .gitignore.

gitsecure protect

install-hook - Install Pre-Commit Hook

Installs automatic scanning on every commit.

gitsecure install-hook

uninstall-hook - Remove Pre-Commit Hook

Removes the pre-commit hook.

gitsecure uninstall-hook

report - Generate HTML Report

Creates a beautiful, shareable security report.

gitsecure report
# Opens in browser automatically

stats - Repository Statistics

Show repository metrics and security status.

gitsecure stats

πŸ›‘οΈ Pre-Commit Hook

The pre-commit hook is the most powerful feature - it automatically scans every commit and blocks secrets from entering your repository.

Install

cd your-repository
gitsecure install-hook

How It Works

  1. You stage files with git add
  2. You run git commit
  3. GitSecure automatically scans staged files
  4. If secrets found β†’ commit is blocked ❌
  5. If clean β†’ commit proceeds βœ…

Example Output

$ git commit -m "Add config"
πŸ” GitSecure: Scanning for secrets...

═══════════════════════════════════════════════════════════════
              πŸ” SCANNING STAGED FILES FOR SECRETS
═══════════════════════════════════════════════════════════════

🚨 AWS Access Key detected: config.py
  β†’ Line 5: [REDACTED for security]

═══════════════════════════════════════════════════════════════
                        πŸ“Š SCAN RESULTS
═══════════════════════════════════════════════════════════════

🚨 Found 1 potential secret(s) in staged files
πŸ›‘ COMMIT BLOCKED - DO NOT COMMIT!

πŸ”§ Recommended Actions:
  β†’ 1. Remove secrets from files
  β†’ 2. Use environment variables instead
  β†’ 3. Add sensitive files to .gitignore

Bypass (Not Recommended)

# Only if you're absolutely sure
git commit --no-verify

πŸ“Š HTML Reports

Generate professional security reports perfect for:

  • πŸ“‹ Compliance audits
  • πŸ‘₯ Team reviews
  • πŸ“ˆ Security tracking
  • πŸ—‚οΈ Documentation
gitsecure report

Features:

  • 🎨 Beautiful, modern design
  • πŸ“Š Visual metrics & statistics
  • πŸ” Detailed scan results
  • πŸ’‘ Actionable recommendations
  • πŸ“€ Easy sharing & archiving

🎯 Best Practices

βœ… DO

  1. Install pre-commit hook - Prevent secrets from entering repo
  2. Use environment variables - Never hardcode secrets
  3. Use secret management - Vault, AWS Secrets Manager, Doppler
  4. Generate .gitignore protection - Run gitsecure protect
  5. Regular audits - Run gitsecure audit monthly
  6. Rotate exposed secrets immediately - Assume compromised

❌ DON'T

  1. Don't commit secrets - Even in private repos
  2. Don't rely on deleting commits - Secrets remain in history
  3. Don't store secrets in code - Use environment variables
  4. Don't ignore warnings - Every detection matters
  5. Don't use --no-verify - Defeats the purpose

πŸ”§ Advanced Configuration

Entropy Threshold

Default: 4.5 (detects high-randomness strings)

# Edit in gitsecure script
ENTROPY_THRESHOLD=4.5

Minimum Secret Length

Default: 20 characters

# Edit in gitsecure script
MIN_SECRET_LENGTH=20

Custom Patterns

Add custom patterns by editing the SECRET_PATTERNS array in the script.


πŸ†š Comparison with Other Tools

Feature GitSecure git-secrets gitleaks truffleHog
Easy Install βœ… One-liner ⚠️ Complex βœ… Go binary ⚠️ Python
Pre-commit Hook βœ… Auto-install βœ… Manual βœ… Manual ❌ No
Pattern Count βœ… 50+ ⚠️ Basic βœ… 50+ βœ… Many
Entropy Detection βœ… Yes ❌ No βœ… Yes βœ… Yes
HTML Reports βœ… Yes ❌ No ⚠️ JSON ⚠️ JSON
Zero Config βœ… Yes ❌ No ⚠️ Some ❌ No
Speed βœ… Fast (Bash) βœ… Fast βœ… Fast (Go) ⚠️ Slow
Commercial Support βœ… Available ❌ No βœ… Yes ❌ No

πŸ§ͺ Testing

Run the comprehensive test suite:

./test-gitsecure.sh

Tests cover:

  • βœ… All secret pattern detection
  • βœ… File scanning accuracy
  • βœ… Pre-commit hook functionality
  • βœ… .gitignore generation
  • βœ… Clean file handling (no false positives)

🀝 Contributing

We welcome contributions! See CONTRIBUTING.md for guidelines.

Areas we need help:

  • πŸ” Additional secret patterns
  • 🌍 Language-specific patterns
  • ⚑ Performance improvements
  • πŸ“š Documentation
  • πŸ§ͺ More test cases

πŸ“œ License & Support

Open Source (GPL v3)

Free for individuals and open source projects. See LICENSE-GPL3.

Commercial Use

Commercial license required for businesses. See COMMERCIAL.md for pricing.

Get Help


🌟 Star Us!

If GitSecure saved you from a secret leak, please star the repository!

GitHub Stars


πŸ“ˆ Statistics

  • 50+ Secret Patterns detected
  • Zero Configuration required
  • One-Line Install in seconds
  • 100% Bash - No dependencies
  • Used by 1000+ developers worldwide (growing!)

πŸŽ“ Learn More


Built with ❀️ by strabo231 | Securing developers worldwide πŸ”’

Remember: The best secret is the one that never gets committed.

About

Git secret scanner and protection tool - prevent API keys, passwords, and credentials from being committed (Dual Licensed: GPL v3 / Commercial)

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Languages