Check it here: https://marketplace.visualstudio.com/items?itemName=amitk003.vibe-guard
A real-time security assistant for developers that detects insecure code patterns and provides helpful warnings and best practices.
VibeGuard automatically scans your code in real-time and detects:
- API keys, tokens, and passwords in source code
- Suggests using environment variables instead
- HTTP URLs in fetch/axios calls
- Recommends HTTPS for secure communication
- CORS policies allowing all origins (*)
- Warns about potential security risks in production
- Checks if
.envfiles are properly ignored in.gitignore - Offers to automatically add
.envto.gitignore
- Detects when environment variables are being logged or exposed
- Prevents accidental leakage of sensitive information
- JavaScript (
.js,.jsx) - TypeScript (
.ts,.tsx) - Python (
.py) - Environment files (
.env)
- Open VS Code
- Go to Extensions (
Ctrl+Shift+X) - Search for "VibeGuard"
- Click Install
- The extension will automatically activate and start monitoring your files
git clone https://github.com/Amitk003/VibeGuard.git
cd VibeGuard
npm install
npm run compileThen press F5 in VS Code to launch the Extension Development Host.
VibeGuard: Enable- Enable real-time security scanningVibeGuard: Disable- Disable security scanning
VibeGuard runs in the background and:
- File Watching: Monitors changes to supported file types
- Pattern Detection: Uses regex patterns to identify security issues
- Real-time Alerts: Shows warning popups when issues are detected
- Actionable Suggestions: Provides specific recommendations for fixes
Currently, VibeGuard works out of the box with sensible defaults. Future versions will include customizable security rules and severity levels.
// Hardcoded API key
const apiKey = "sk-1234567890abcdef";
// HTTP instead of HTTPS
fetch("http://api.example.com/data");
// CORS allowing all origins
app.use(cors({ origin: "*" }));
// Logging environment variables
console.log(process.env);// Use environment variables
const apiKey = process.env.API_KEY;
// Use HTTPS
fetch("https://api.example.com/data");
// Specific CORS origins
app.use(cors({ origin: "https://yourdomain.com" }));
// Log specific values, not entire env
console.log("App started on port:", process.env.PORT);We welcome contributions! Here's how you can help:
- Use the GitHub Issues page
- Include code samples that trigger false positives/negatives
- Provide your VS Code version and operating system
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Add tests if applicable
- Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
See CONTRIBUTING.md for detailed guidelines.
- Clone the repository
- Run
npm installto install dependencies - Run
npm run compileto build the extension - Press
F5to launch a new VS Code window with the extension loaded
- Edit
src/security-detector.ts - Add new regex patterns to the
patternsobject - Update the detection logic in
detectIssues() - Add appropriate warning messages
src/
βββ extension.ts # Main extension logic
βββ file-watcher.ts # File monitoring and change detection
βββ security-detector.ts # Security pattern detection and warnings
- Test your changes by opening various file types
- Verify that security patterns are detected correctly
- Ensure warning messages are helpful and actionable
Run the pattern detection tests:
node test-patterns.jsThis will verify that all security patterns are working correctly.
- Open the project in VS Code
- Press
F5to launch the Extension Development Host - Open the test files (
test-security.js,.env) to trigger detections - Check the Debug Console for any error messages
- Use
Developer: Reload Windowto restart the extension
- Configurable security rules
- Custom pattern definitions
- Integration with popular linters
- Diagnostic highlighting in editor
- Severity level customization
- Whitelist/ignore functionality
- Security report generation
MIT License - see LICENSE file for details.
If you encounter issues or have suggestions:
- Check existing issues on GitHub
- Create a new issue with detailed information
- Include code samples that trigger false positives/negatives
Stay secure, code with confidence! π‘οΈ