🛡️ GitHub Guardian is a real-time, zero-dependency forensic security audit assistant and secret shield for VS Code.
It runs locally on your machine, highlighting exposed secrets and insecure patterns inline in the editor and aggregating them in the Problems tab.
Features
- Inline Scanning: Instantly flags exposed API keys and security issues directly in your editor as you open, type, or save.
- Problems Panel Integration: Aggregates all issues in the Workspace Problems panel for easy navigation.
- Enterprise-Grade platform detections: Includes signatures for AWS, GitHub, Slack, Stripe, OpenAI, Google, Twilio, Databases, JWT, NPM, SSH Private Keys, etc.
- Dynamic Shannon-Entropy Engine: Analyzes generic variable assignments (
password = "...") using Shannon Entropy calculations, warning you about custom keys while preventing noise. - Quick Fix Redaction: Provides editor lightbulb actions to automatically redact flagged secrets with one click.
- Workspace Scan: Offers a command to scan your entire workspace.
Extension Settings
This extension contributes the following settings:
github-guardian.enable: Toggle real-time scanning (default:true).github-guardian.enableOnSave: Scan documents automatically when saving (default:true).github-guardian.enableOnType: Scan and update diagnostics as you edit/type (default:true).github-guardian.entropyThreshold: Entropy value threshold for generic secrets (default:3.2).
Commands
GitHub Guardian: Scan Workspace for Secrets: Searches all files in the current workspace (excludingvenv,node_modules, and build artifacts) and registers findings.
Manual Testing & Development
To test the extension:
- Open this repository inside VS Code.
- Open the file
github-guardian-vscode/extension.js. - Press
F5(or go to Run > Start Debugging). This launches a new Extension Development Host window. - Open any file in the Extension Development Host window.
- Type an exposed key (e.g.,
aws_secret_access_key = "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY") and see it underlined in red immediately!