Skip to content

Latest commit

 

History

History
330 lines (230 loc) · 12 KB

File metadata and controls

330 lines (230 loc) · 12 KB

🛡️ GitGuard - GitHub Security Scanner

Python 3.10+ Tkinter GUI MIT License Cross Platform

Security Scanning 37+ Patterns Multi-Format Export

🔍 A powerful desktop GUI application for scanning GitHub repositories and commit history to detect accidentally committed sensitive information like API keys, passwords, tokens, and other security vulnerabilities.

🚀 Fast • 🎯 Accurate • 🔒 Secure • 🎨 User-Friendly


🚨 Security Notice

⚠️ IMPORTANT: GitGuard is a defensive security tool designed to help users identify accidentally committed sensitive information in their own repositories. Never use this tool to scan repositories you don't own or have explicit permission to analyze.


✨ Features Overview

🔍 Core Scanning & Detection

  • 🌟 Comprehensive Scanning: Analyzes entire repository history including all commits
  • 🧠 Advanced Pattern Detection: Identifies 37+ types of sensitive data with intelligent context-aware filtering
  • 🎯 False Positive Elimination: Smart filtering for test files, documentation, checksums, and development configs
  • 📊 Risk Assessment: Automatic risk scoring with color-coded visualization and severity categorization

🖥️ User Interface & Workflow

  • Professional GUI: User-friendly Tkinter interface with 4-tab workflow and comprehensive menu system
  • 🔐 Authentication Management: Secure token storage with optional obfuscation and user consent warnings
  • 🎨 Custom Pattern Editor: GUI-based creation, testing, and management of custom detection rules
  • 🛠️ Advanced Error Handling: Context-aware error dialogs with technical details and suggested solutions

Performance & Export

  • 🚀 High-Performance Scanning: 10x faster with batch processing and smart file prioritization
  • 🌐 Professional HTML Reports: Auto-opening responsive reports with statistics and risk visualization
  • 📄 Multi-Format Export: Generate reports in CSV, JSON, and HTML with comprehensive metadata
  • 🧠 Intelligent Caching: Repository-specific result caching with commit-hash validation

🔒 Security & Privacy

  • 🏠 Local Processing: All scanning performed locally - no data transmitted to external services
  • 🛡️ Secure Authentication: Optional GitHub token storage with encryption warnings and user control
  • ⚙️ Configuration Management: Persistent settings with import/export and security controls
  • 📝 Comprehensive Logging: Full application logging with session tracking and performance metrics

🕵️ Detected Sensitive Data Types

🔑 API Keys & Tokens (Click to expand)
Service Pattern Example Risk Level
🔶 AWS Access Keys AKIA[0-9A-Z]{16} 🔴 Critical
🐙 GitHub PAT ghp_[a-zA-Z0-9]{36} 🔴 Critical
🔥 Firebase Keys AIza[0-9A-Za-z-_]{35} 🟠 High
💳 Stripe API sk_live_, sk_test_ 🔴 Critical
📧 SendGrid SG.[0-9A-Za-z-_]{22} 🟠 High
📱 Twilio AC[a-f0-9]{32} 🟠 High
💰 PayPal EO[0-9A-Za-z-_]{50} 🔴 Critical
🛍️ Shopify shpat_[a-zA-Z0-9]{32} 🟠 High
🗃️ Database Credentials (Click to expand)
  • 🍃 MongoDB: mongodb://[user:pass@]host:port/db
  • 🐬 MySQL: mysql://[user:pass@]host:port/db
  • 🐘 PostgreSQL: postgresql://[user:pass@]host:port/db
  • 🗄️ Redis: Connection strings with embedded credentials
  • 🔗 Generic DB URLs: Any connection URL with embedded credentials
🔐 Private Keys & Certificates (Click to expand)
  • 🔑 RSA Private Keys: -----BEGIN RSA PRIVATE KEY-----
  • 🔒 SSH Private Keys: -----BEGIN OPENSSH PRIVATE KEY-----
  • 🛡️ PGP Private Keys: -----BEGIN PGP PRIVATE KEY-----
  • 📜 SSL/TLS Certificates: Various certificate formats
  • 🎫 JWT Tokens: JSON Web Tokens with high entropy
🌍 Environment Variables (Click to expand)
  • Common Secrets: SECRET, PASSWORD, TOKEN, KEY
  • ☁️ AWS Variables: AWS_ACCESS_KEY, AWS_SECRET_KEY
  • 🔧 API Keys: .env format API keys and tokens
  • 🐳 Docker Secrets: Docker Compose environment secrets
  • ☸️ Kubernetes: Secret manifests and config maps

🆕 Latest Improvements (Session 7)

🎉 Major Feature Updates 🎉

🔐 Authentication & Token Management

  • 💾 Save Authentication Button: New manual save option for GitHub credentials
  • 🔐 Secure Token Storage: Optional GitHub token persistence with Base64 obfuscation
  • ⚠️ Security Warnings: Clear consent dialogs for token storage with risk explanations
  • 🔄 Auto-Load Credentials: Automatic restoration of saved authentication on startup

📊 Export & Report Enhancements

  • 🌐 Auto-Open HTML Reports: HTML exports now automatically open in browser
  • 📈 Enhanced Report Quality: Improved error handling and fallback mechanisms
  • 📁 Output Organization: Default output folder creation with proper gitignore protection

🎯 False Positive Detection Improvements

  • 🧪 Smart Test File Filtering: Automatic detection and filtering of test files (_test.go, /tests/, etc.)
  • 📚 Documentation Exclusions: Skip obvious examples in .md files and documentation
  • 🔧 Development Config Filtering: Intelligent handling of docker-compose.dev.yml and localhost configs

🔬 Detection Accuracy Improvements

  • ⚔️ Basic Auth False Positives: Enhanced filtering for game content ("Basic Sword" vs authentication)
  • 🧮 Checksum File Handling: Proper exclusion of Go package checksums (go.sum) from secret detection
  • 🔍 Template Pattern Recognition: Filter environment variable templates like ${JWT_SECRET}
  • 🗃️ Database Credential Filtering: Smart detection of test/development database connections

🚀 Quick Start

📋 Prerequisites

Python 3.10+ Git Required GitHub Token

📥 Installation

# Clone the repository
git clone https://github.com/dev-alt/GitGuard.git
cd GitGuard

# Install dependencies
pip install -r requirements.txt

# Launch GitGuard
python src/gui.py

🎯 Quick Usage

  1. 🔐 Authenticate: Enter your GitHub token in the Authentication tab
  2. 📂 Load Repositories: Browse and select repositories from your GitHub account
  3. 🔍 Configure Scan: Choose scan depth and configure detection patterns
  4. ▶️ Start Scanning: Click scan and watch real-time progress
  5. 📊 Review Results: Export results to HTML, CSV, or JSON formats

🎨 Custom Pattern Editor

🛠️ Create Your Own Detection Rules!

GitGuard includes a powerful GUI-based pattern editor for creating custom detection rules:

# Example Custom Pattern
Name: Internal API Key
Description: Company-specific API key format  
Pattern: MYCO_API_[A-Za-z0-9]{32}
Risk Level: HIGH

Features:

  • 🎯 Real-time Regex Testing: Test patterns before saving
  • 📚 Pattern Library: Import/Export pattern collections
  • 🔧 JSON Export/Import: Share patterns across installations
  • Validation: Automatic pattern validation and suggestions

🛠️ Advanced Configuration

⚙️ Scanning Configuration (Click to expand)

Scan Depth Options

  • 🏄 Surface (Latest Commit): Fast scanning of current repository state
  • 🏊 Deep (Full History): Complete commit history analysis
  • 🏗️ Custom: User-defined commit range and file filtering

Performance Tuning

  • 📊 Batch Processing: Configure concurrent file operations
  • 🎯 File Prioritization: Scan high-risk files first
  • 💾 Intelligent Caching: Skip unchanged repositories
  • ⏱️ Timeout Controls: Prevent hung operations
📊 Export Formats (Click to expand)

Available Formats

  • 🌐 HTML: Interactive reports with charts and statistics
  • 📄 CSV: Spreadsheet-compatible tabular data
  • 📝 JSON: Structured data for programmatic analysis

Report Features

  • 📈 Risk Visualization: Color-coded severity indicators
  • 📊 Statistical Analysis: Finding counts by type and severity
  • 🔗 Interactive Navigation: Click-to-view source code
  • 📅 Metadata: Scan configuration and timestamp information

🤝 Contributing

We welcome contributions! Here's how you can help:

Report Issues Submit PR Join Discussion

  1. 🍴 Fork the repository
  2. 🌿 Create a feature branch (git checkout -b feature/amazing-feature)
  3. 💾 Commit your changes (git commit -m 'Add amazing feature')
  4. 🚀 Push to branch (git push origin feature/amazing-feature)
  5. 📮 Open a Pull Request

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

MIT License

🙏 Acknowledgments

  • 🐙 GitHub API: For providing excellent repository access
  • 🐍 Python Community: For the amazing ecosystem and libraries
  • 🔐 Security Researchers: For inspiration and pattern identification
  • 👥 Open Source Community: For feedback and contributions

🌟 Star this repository if you find it helpful!

GitHub Stars GitHub Forks GitHub Watchers

Made with ❤️ for the security community


GitGuard - Protecting your repositories, one commit at a time 🛡️