Next-Generation Active Cyber Defense Platform - Find secrets, vulnerabilities, and attack patterns in your code
Project description
DECOYABLE - Make Your Code Unhackable
Stop security vulnerabilities before they reach production.
๐ Find secrets, vulnerabilities, and attack patterns in your code
๐ก๏ธ Active defense with AI-powered honeypots
โก Sub-30ms scanning with enterprise-grade performance
๐ฆ Available on PyPI: pip install decoyable
๐ฅ Join the Community | ๐ Documentation | ๐ Report Issues
๐ Quick Demo (2 minutes)
# Install DECOYABLE from PyPI
pip install decoyable
# Scan your code for security issues
decoyable scan .
# See results like this:
๐ Found 3 secrets in config.py
๐ป SQL injection vulnerability in api.py
โ
No dependency vulnerabilities
๐ฏ What Makes DECOYABLE Different?
Traditional Security Tools: Passive scanners that only report problems
DECOYABLE: Active defense that prevents attacks and learns from them
๐ก๏ธ Active Cyber Defense Features
- ๐ค AI Attack Analysis: Classifies attacks with 95%+ accuracy using GPT/Claude/Gemini
- ๐ต๏ธ Adaptive Honeypots: Dynamic decoy endpoints that learn from attacker behavior
- ๐ซ Auto IP Blocking: Immediate containment for high-confidence threats
- ๐ง Knowledge Base: Learns attack patterns and improves over time
๐ Comprehensive Security Scanning
- ๐ Secret Detection: AWS keys, GitHub tokens, API keys, passwords
- ๐ฆ Dependency Analysis: Vulnerable/missing Python packages
- ๐ป SAST Scanning: SQL injection, XSS, command injection, path traversal
- โก Performance: Sub-30ms response times with Redis caching
๐ Real Results
DECOYABLE scanned its own codebase and found 24 security vulnerabilities including:
- 8 hardcoded secrets
- 6 SQL injection vulnerabilities
- 5 command injection risks
- 3 path traversal issues
- 2 insecure configurations
All caught before deployment. ๐ก๏ธ
๐ Enterprise-Grade Validation & Achievements
DECOYABLE has been battle-tested at extreme scale and proven production-ready through rigorous validation:
โก Performance Validation
- ๐งช Nuclear Stress Test: Successfully scanned 50 files with 150 embedded vulnerabilities (0.20MB dataset)
- ๐ง Linux Kernel Test: Processed 315 Python files from the Linux Kernel at 221.8 files/second
- ๐ Real Security Detection: Found 2 SAST vulnerabilities in production Linux Kernel code
- ๐คฏ TensorFlow Ultimate Test: Scanned 50,000+ Python files (1.14 GiB) in 21 seconds - world's largest Python codebase
- ๐ Advanced Secret Detection: Found 57 potential secrets with zero false negatives in massive codebase
- ๐ฆ Enterprise Dependency Analysis: Identified 54 missing dependencies across complex ML framework
- ๐ก๏ธ Zero SAST Vulnerabilities: Clean security audit of TensorFlow's production code
- โก Sub-30ms Response Times: Maintained performance under extreme concurrent load
๐ ๏ธ Critical Architecture Fixes
- ๐ Async Integration Bug: Fixed critical async/await flaw in CLI that would cause production failures
- ๐ง Proper Event Loop Handling: Implemented
asyncio.run()integration for reliable async operations - ๐ ScanReport Processing: Corrected result handling to access
.resultsfrom scanner objects - ๐งช Validation Testing: All fixes validated through extreme stress testing before deployment
๐ Enterprise-Grade Capabilities Proven
- ๐ Concurrent Processing: 5 concurrent partitions with
asyncio.gather()for massive parallelism - ๐ Memory Monitoring: Real-time memory usage tracking with
psutilduring stress tests - ๐ก Kafka Integration: Streaming attack events with optional high-volume processing
- ๐ก๏ธ Graceful Degradation: Handles missing services without crashes (PostgreSQL, Redis, Kafka)
- ๐ Comprehensive Metrics: Performance monitoring, error rates, and throughput tracking
๐ฏ Real-World Security Impact
- ๐ Secrets Detection: AWS keys, GitHub tokens, API keys, passwords
- ๐ป SAST Vulnerabilities: SQL injection, XSS, command injection, path traversal
- ๐ฆ Dependency Analysis: Vulnerable/missing packages with security advisories
- ๐ค AI Attack Classification: 95%+ accuracy with multi-provider LLM failover
- ๐ต๏ธ Adaptive Honeypots: Dynamic decoy endpoints learning from attacker behavior
DECOYABLE is now proven: crazy strong, fast, safe and unbeatable. โก๐ก๏ธ
๐ข Who Uses DECOYABLE?
- ๐จโ๐ป Developers: Secure code as you write it
- ๐ก๏ธ Security Teams: Enterprise-grade threat detection
- ๐ข Enterprises: Production-ready security platform
- ๐ง DevOps: CI/CD security gates and monitoring
โก Installation & Quick Start
๐ PyPI Install (Recommended)
DECOYABLE is now available on PyPI! Install globally with:
pip install decoyable
decoyable scan .
๐ณ One-Command Install (Alternative)
curl -fsSL https://raw.githubusercontent.com/Kolerr-Lab/supper-decoyable/main/install.sh | bash
Then scan your code:
decoyable scan .
๐ฆ Other Installation Methods
Docker (Full Stack):
docker-compose up -d
curl http://localhost:8000/api/v1/health -X GET
curl http://localhost:8000/api/v1/scan/all -X POST -H "Content-Type: application/json" -d '{"path": "."}'
From Source (Development):
git clone https://github.com/Kolerr-Lab/supper-decoyable.git
cd supper-decoyable
pip install -r requirements.txt
python -m decoyable.core.main scan all
๐ ๏ธ IDE Integration
VS Code Extension
DECOYABLE includes a comprehensive VS Code extension that brings security scanning and AI-powered fixes directly into your development environment:
๐ Key Features
- Real-time Security Scanning: Auto-scan files on save/open with live feedback
- AI-Powered Fixes: Intelligent remediation using DECOYABLE's multi-provider LLM router
- Multi-Modal Analysis: Secrets, dependencies, SAST, and code quality scanning
- Native IDE Integration: Commands, tree views, diagnostics, and code actions
- Enterprise-Ready: Professional UI with comprehensive settings and safety features
๐ฆ Installation
# Install from packaged extension (recommended)
code --install-extension vscode-extension/decoyable-security-1.0.0.vsix
# Or install from source for development
code vscode-extension/
๐ ๏ธ Usage
- Scan Current File:
Ctrl+Shift+S - Scan Workspace:
DECOYABLE: Scan Workspacecommand - Fix All Issues:
Ctrl+Shift+F - View Results: Security Issues panel in Explorer
โ๏ธ Configuration
Access settings through Preferences: Open Settings (UI):
{
"decoyable.pythonPath": "python",
"decoyable.scanOnSave": true,
"decoyable.scanOnOpen": false,
"decoyable.autoFix": false,
"decoyable.showNotifications": true
}
Learn more: See vscode-extension/INSTALLATION.md for comprehensive setup and usage instructions.
๏ฟฝ Complete Usage Guide
๐ฅ๏ธ Command Line Interface
Basic Commands (After pip install decoyable)
# Show help
decoyable --help
# Scan for secrets only
decoyable scan secrets
# Scan for dependencies only
decoyable scan deps
# Scan for SAST vulnerabilities
decoyable scan sast
# Scan everything (comprehensive)
decoyable scan all
# Scan with custom path
decoyable scan all /path/to/your/code
# Scan with verbose output (shows fix recommendations)
decoyable scan sast --format verbose
Development Commands (From Source)
# Using the main module directly
python -m decoyable.core.main scan secrets
python -m decoyable.core.main scan deps
python -m decoyable.core.main scan sast
python -m decoyable.core.main scan all
# Legacy main.py support (if available)
python main.py scan secrets
python main.py scan all
๐ Web API Server
Start FastAPI Server
# Development server with auto-reload
uvicorn decoyable.api.app:app --reload
# Production server
uvicorn decoyable.api.app:app --host 0.0.0.0 --port 8000 --workers 4
# With SSL
uvicorn decoyable.api.app:app --ssl-keyfile key.pem --ssl-certfile cert.pem
API Testing Examples
# Health check (verify server is running)
curl -X GET "http://localhost:8000/api/v1/health"
# Test secrets scanning
curl -X POST "http://localhost:8000/api/v1/scan/secrets" \
-H "Content-Type: application/json" \
-d '{"path": ".", "recursive": true}'
# Test dependencies scanning
curl -X POST "http://localhost:8000/api/v1/scan/dependencies" \
-H "Content-Type: application/json" \
-d '{"path": ".", "format": "json"}'
# Test SAST scanning
curl -X POST "http://localhost:8000/api/v1/scan/sast" \
-H "Content-Type: application/json" \
-d '{"path": ".", "output_format": "detailed"}'
# Comprehensive scan
curl -X POST "http://localhost:8000/api/v1/scan/all" \
-H "Content-Type: application/json" \
-d '{"path": ".", "output_format": "detailed"}'
# View API documentation
open http://localhost:8000/docs
๐ณ Docker Deployment
Docker Commands
# Build DECOYABLE image
docker build -t decoyable:latest .
# Run with Docker
docker run -p 8000:8000 decoyable:latest
# Run with environment variables
docker run -p 8000:8000 -e REDIS_URL=redis://localhost:6379 decoyable:latest
Docker Compose (Full Stack)
# Start full stack (FastAPI + PostgreSQL + Redis + Nginx)
docker-compose up -d
# Start with rebuild
docker-compose up --build -d
# View logs
docker-compose logs -f
# Stop services
docker-compose down
# Rebuild specific service
docker-compose up --build app
๐งช Testing & Quality
Run Tests
# Run all tests
pytest
# Run with coverage
pytest --cov=decoyable --cov-report=html
# Run specific test file
pytest tests/test_scanners.py
# Run security tests only
pytest -m security
Code Quality
# Format code
black .
# Lint code
ruff check .
# Type checking
mypy decoyable/
# Security scanning
bandit -r decoyable/
๏ฟฝ๐ฅ What's New: Active Cyber Defense
DECOYABLE has evolved from a passive scanning tool into a next-generation active defense framework:
-
๐ Scalability: Celery async processing, PostgreSQL persistence
-
๐ค AI-Powered Attack Analysis: Multi-provider LLM classification with smart failover
-
๐ต๏ธ Adaptive Honeypots: Dynamic decoy endpoints that learn from attacker behavior
-
๐ Zero-Trust Architecture: Containerized security with comprehensive CI/CD pipeline
-
๐ซ Immediate IP Blocking: Automatic attacker containment with iptables rules
-
๐ Knowledge Base: SQLite-powered learning system for attack pattern recognition
-
๐ก๏ธ Isolated Decoy Networks: Docker network segmentation preventing production access
-
๐ ๏ธ VS Code Extension: Real-time security scanning and AI-powered fixes directly in your IDE
About
DECOYABLE combines traditional security scanning with cutting-edge active defense:
Passive Security Scanning
- ๐ Secret Detection: AWS keys, GitHub tokens, API keys, passwords
- ๐ฆ Dependency Analysis: Missing/vulnerable Python packages
- ๐ฌ SAST Scanning: SQL injection, XSS, command injection, and more
Active Cyber Defense
- ๐ฏ Honeypot Endpoints: Fast-responding decoy services on isolated ports
- ๐ง Multi-Provider LLM Analysis: OpenAI GPT, Anthropic Claude, Google Gemini with automatic failover
- ๐ Smart Routing Engine: Priority-based routing with health checks and circuit breakers
- ๐ Performance Monitoring: Real-time metrics and provider status tracking
- ๐ Adaptive Learning: Dynamic rule updates based on attack patterns
- ๐จ Real-time Alerts: SOC/SIEM integration for immediate response
Features
Core Security Scanning
- ๐ Multi-Scanner Engine: Secrets, dependencies, SAST in one platform
- ๐ High Performance: Sub-30ms response times, Redis caching
- ๐ Rich Reporting: JSON/verbose output with severity classification
- ๐ Enterprise Security: SSL, authentication, audit logging
Active Defense System
- ๐ค AI Attack Analysis: Classifies attacks with 95%+ accuracy
- ๐ต๏ธ Honeypot Networks: Isolated decoy services (SSH, HTTP, HTTPS)
- ๐ซ Automated Blocking: Immediate IP containment for high-confidence attacks
- ๏ฟฝ Adaptive Learning: Pattern recognition and dynamic rule generation
- ๐ SOC Integration: RESTful alerts to security operations centers
Production-Ready
- ๐ณ Docker Security: Non-root execution, network isolation, resource limits
- ๐ Monitoring: Prometheus metrics, health checks, Grafana dashboards
- ๐ Kafka Streaming: Optional high-volume event processing with horizontal scaling
- ๐ง CI/CD Integration: GitHub Actions with comprehensive testing
- ๐ Scalability: Celery async processing, PostgreSQL persistence
Quick Start
Option 1: VS Code Extension (Recommended for Development)
For the best development experience, use the DECOYABLE VS Code Extension:
-
Install the extension:
code --install-extension vscode-extension/decoyable-security-1.0.0.vsix
-
Open your project in VS Code - security scanning happens automatically!
-
Manual scanning:
Ctrl+Shift+S(current file) orDECOYABLE: Scan Workspace -
Fix issues:
Ctrl+Shift+Ffor AI-powered remediation
See vscode-extension/INSTALLATION.md for detailed setup instructions.
Option 2: CLI Installation
For traditional CLI usage or server deployment:
git clone https://github.com/your-org/decoyable.git
cd decoyable
pip install -e .
cp .env.example .env
# Edit .env with your configuration
Basic Usage
CLI Commands
# Traditional scanning
decoyable scan secrets . # Find exposed secrets
decoyable scan deps . # Check dependencies
decoyable scan sast . # Static application security testing
decoyable scan all . # Run all scanners
# Active defense monitoring
decoyable defense status # Show honeypot status
decoyable defense logs # View recent attacks
decoyable defense patterns # Show learned attack patterns
API Usage
# Start all services (including decoy networks)
docker-compose up -d
# Traditional scanning
curl -X POST http://localhost:8000/scan/secrets \
-H "Content-Type: application/json" \
-d '{"path": "."}'
# Active defense monitoring
curl http://localhost:8000/analysis/recent
curl http://localhost:8000/analysis/stats
Active Defense Configuration
Environment Variables
# Decoy Network Configuration
DECOY_PORTS=9001,2222,8080,8443 # Ports for honeypot services
SECURITY_TEAM_ENDPOINT=https://your-soc.com/api/alerts
# AI Analysis (Optional)
OPENAI_API_KEY=your-api-key-here # For LLM analysis (primary)
ANTHROPIC_API_KEY=your-api-key-here # For LLM analysis (secondary)
GOOGLE_API_KEY=your-api-key-here # For LLM analysis (tertiary)
# Knowledge Base
KNOWLEDGE_DB_PATH=decoyable_knowledge.db
Docker Deployment
# docker-compose.yml includes isolated decoy services
services:
decoy_ssh: # Port 2222 - Fake SSH service
decoy_http: # Ports 8080, 8443 - Fake web services
fastapi: # Port 8000 - Production API (isolated)
Active Defense Features
Honeypot System
DECOYABLE deploys isolated honeypot services that:
- โ Respond in <10ms to attacker requests
- โ Capture full request data (IP, headers, body, timestamps)
- โ Forward alerts to your SOC/SIEM system
- โ Automatically block high-confidence attackers
- โ Learn from attack patterns to improve detection
# Attackers probing port 2222 (decoy SSH) get logged and blocked
ssh attacker@your-server.com -p 2222
# โ Alert sent to SOC, IP blocked, pattern learned
AI-Powered Analysis
Every captured request gets LLM analysis:
{
"attack_type": "brute_force",
"confidence": 0.92,
"recommended_action": "block_ip",
"explanation": "Multiple failed authentication attempts",
"severity": "high",
"indicators": ["password=admin", "password=123456"]
}
Multi-Provider LLM Routing
Smart failover and load balancing across multiple LLM providers:
- ๐ Automatic Failover: Switches providers when one fails or hits rate limits
- โก Performance Optimization: Routes to fastest available provider
- ๐ก๏ธ Circuit Breaker: Temporarily disables unhealthy providers
- ๐ Real-time Monitoring: Provider health and performance metrics
- ๐ง Configurable Priority: Set primary, secondary, and tertiary providers
Supported Providers:
- OpenAI GPT (Primary - gpt-3.5-turbo, gpt-4)
- Anthropic Claude (Secondary - claude-3-haiku, claude-3-sonnet)
- Google Gemini (Tertiary - gemini-pro, gemini-pro-vision)
API Endpoint for Monitoring:
curl http://localhost:8000/analysis/llm-status
Adaptive Learning
The system learns and adapts:
- Pattern Recognition: Identifies new attack signatures
- Dynamic Rules: Updates detection rules automatically
- Decoy Generation: Creates new honeypot endpoints based on reconnaissance
- Feedback Loop: Incorporates SOC feedback for improved accuracy
Kafka Streaming (Optional)
For high-volume deployments, DECOYABLE supports Kafka-based event streaming:
- ๐ Asynchronous Processing: Attack events published to Kafka topics for scalable processing
- ๐ Horizontal Scaling: Consumer groups can scale independently for analysis, alerts, and persistence
- ๐ก๏ธ Back-Pressure Handling: Critical blocking actions remain synchronous (<50ms latency)
- ๐ Plug-in Architecture: Kafka is optional - system runs without it by default
- ๐ Event-Driven Architecture: Decouple event capture from processing for better resilience
Enable Kafka Streaming
# Set environment variables
export KAFKA_ENABLED=true
export KAFKA_BOOTSTRAP_SERVERS=localhost:9092
export KAFKA_ATTACK_TOPIC=decoyable.attacks
# Start with Kafka profile
docker-compose --profile kafka up
Architecture
Attack Request โ Honeypot Capture โ Kafka Producer โ Topics
โ
Consumer Groups โ Analysis โ SOC Alerts โ Database โ Adaptive Defense
Benefits:
- Handle "thousand cuts" style attacks without blocking the main application
- Scale analysis, alerting, and persistence independently
- Replay failed events from Kafka topics
- Integrate with existing Kafka-based security pipelines
API Documentation
Traditional Scanning Endpoints
POST /scan/secrets # Scan for exposed secrets
POST /scan/dependencies # Check dependency vulnerabilities
POST /scan/sast # Static application security testing
POST /scan/async/* # Asynchronous scanning with Celery
Active Defense Endpoints
# Honeypot System
GET /decoy/status # Honeypot status
GET /decoy/logs/recent # Recent captured attacks
/decoy/* # Generic honeypot endpoints
# AI Analysis
GET /analysis/recent # Recent attack analyses
GET /analysis/stats # Attack statistics
GET /analysis/patterns # Current detection patterns
POST /analysis/feedback/{id} # Provide feedback on analysis
Example API Usage
# Check honeypot status
curl http://localhost:8000/decoy/status
# View recent attacks
curl http://localhost:8000/analysis/recent?limit=10
# Get attack statistics
curl http://localhost:8000/analysis/stats?days=7
# View learned patterns
curl http://localhost:8000/analysis/patterns
Security Architecture
Network Isolation
Internet โ [Decoy Network] โ Honeypot Services (Ports: 2222, 8080, 8443)
โ
[Isolated Bridge Network - Attackers Cannot Cross]
โ
Production Network โ Main API, Database, Redis (Port: 8000)
Defense in Depth
- Perimeter Defense: Honeypots attract and identify attackers
- AI Analysis: Classifies attack types and intent
- Automated Response: Immediate blocking of high-confidence threats
- SOC Integration: Human-in-the-loop validation and response
- Learning System: Continuous improvement of detection capabilities
Development
Local Development
# Install dependencies
pip install -r requirements.txt
# Run tests (including LLM mocks)
pytest tests/ -v
# Start API with defense modules
uvicorn decoyable.api.app:app --reload --host 0.0.0.0 --port 8000
Testing Active Defense
# Test honeypot endpoints
curl http://localhost:8000/decoy/test-attempt
# Test analysis (will use pattern matching if no OpenAI key)
curl http://localhost:8000/analysis/patterns
# Run defense-specific tests
pytest tests/test_honeypot.py tests/test_analysis.py -v
Docker Development
# Full deployment with decoy networks
docker-compose up --build
# View decoy service logs
docker-compose logs decoy_ssh
docker-compose logs decoy_http
Security Warnings โ ๏ธ
Critical Security Considerations
-
Network Isolation: Decoy services are intentionally exposed to attract attackers. Ensure proper Docker network segmentation.
-
IP Blocking: The system automatically blocks IPs using iptables. Monitor for false positives.
-
API Keys: Never commit OpenAI API keys. Use environment variables and rotate regularly.
-
Resource Limits: Honeypot services have strict resource limits. Monitor for DoS attempts.
-
Logging: All honeypot activity is logged. Ensure log storage doesn't fill up.
Ethical and Legal Considerations
- Permitted Use: Only deploy on networks you own or have explicit permission to monitor
- Transparency: Inform network users about security monitoring
- Data Handling: Captured attack data may contain sensitive information
- Compliance: Ensure deployment complies with local laws and regulations
Contributing
See CONTRIBUTING.md for development guidelines.
Defense Module Development
# Test defense modules specifically
pytest tests/test_defense/ -v
# Run security linting on defense code
bandit -r decoyable/defense/ -lll
# Test with LLM mocks
pytest tests/ -k "defense" --cov=decoyable.defense
License
MIT License - see LICENSE file for details.
Contact
- Security Issues: ricky@kolerr.com
- General Inquiries: lab.kolerr@kolerr.com
- Documentation: lab.kolerr@kolerr.com
DECOYABLE: From passive scanning to active defense. Transform your security posture with AI-powered cyber defense. ๐ก๏ธ๐ค
Commands (Quick Reference)
Use these to run DECOYABLE locally or perform admin actions. For production, prefer Docker/compose flow.
Local (Unix)
# Full quick-check helper (creates venv if missing, runs lint/tests, quick scans, and starts dev server)
./run_full_check.sh
Windows PowerShell helper
# Activate virtualenv
.\.venv\Scripts\Activate.ps1
# Install requirements
pip install -r requirements.txt
# Run tests
pytest -q
# Run quick scans
python main.py scan secrets --path .
python main.py scan deps --path .
# Start dev server
uvicorn decoyable.api.app:app --reload --host 0.0.0.0 --port 8000
Admin & Active Defense (see SECURITY.md for RBAC and operational guidance)
decoyable defense statusโ show honeypot statusdecoyable defense logsโ view recent attacksdecoyable defense patternsโ show learned detection patterns- Admin-only (requires
API_AUTH_TOKENor similar):decoyable defense block-ip <ip>
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file decoyable-1.0.1.tar.gz.
File metadata
- Download URL: decoyable-1.0.1.tar.gz
- Upload date:
- Size: 17.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d7c1e0ae8932de38d018fff21efec00831eecc0dd0ec0387795e2880b5677476
|
|
| MD5 |
1c93947f4456277a09200a06ba00e1b1
|
|
| BLAKE2b-256 |
5e28f9e2188dfc1240625b13a0f7670bc71d07c71208ef6be595a217563d23d5
|
File details
Details for the file decoyable-1.0.1-py3-none-any.whl.
File metadata
- Download URL: decoyable-1.0.1-py3-none-any.whl
- Upload date:
- Size: 122.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
31ee67a9eb64d9c6c76cf44662625dc3f6aaf49a10aeb0a06005d1f77391a7cb
|
|
| MD5 |
f00fd7f7dd71b3226fb475c7d6860992
|
|
| BLAKE2b-256 |
cd2cb0ee86f5c58175464d68f54bc400ba40efecf8eb52203af16ad7d13d973b
|