Spider-Snoop DLP
System
🕷️ Spider-Snoop is a comprehensive Data Loss Prevention (DLP) system with AI-powered scanning, ICAP protocol support, and a modern web dashboard.
🌟 Features
- ✅ User Authentication & Authorization - JWT-based auth with role-based access control
- ✅ Multi-User Support - Admin, Analyst, and Viewer roles
- ✅ AI-Powered DLP Scanning - OpenAI-enhanced content analysis
- ✅ ICAP Protocol Support - Standard DLP integration for proxies and gateways
- ✅ Pattern-Based Detection - Detects credit cards, SSNs, API keys, emails, and more
- ✅ Real-time Dashboard - Analytics, trends, and statistics
- ✅ RESTful API - Complete API for all operations
- ✅ Database Persistence - SQLite/PostgreSQL support
🚀 Quick Start
Prerequisites
- Python 3.8+
- pip
Installation
- Clone the repository
git clone https://github.com/sumeetgp/spider-snoop.git
cd spider-snoop
- Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
- Install dependencies
pip install -r requirements.txt
- Configure environment
cp .env.example .env
# Edit .env with your settings (OpenAI API key, etc.)
- Initialize database
python scripts/init_db.py
- Run the application
python -m app.main
# Or using uvicorn directly:
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
- Access the application
- Web Dashboard: http://localhost:8000
- API Documentation: http://localhost:8000/docs
- ICAP Server: icap://localhost:1344/dlp_scan
👥 Default Users
After running init_db.py, these users are created:
| Username | Password | Role | Permissions |
|---|---|---|---|
| admin | admin123 | Admin | Full access |
| analyst | analyst123 | Analyst | View all, scan |
| viewer | viewer123 | Viewer | View own scans |
⚠️ Change these passwords in production!
📡 API Endpoints
Authentication
POST /api/auth/login- Login and get JWT token
User Management
GET /api/users/me- Get current user infoGET /api/users/- List all users (Admin/Analyst)POST /api/users/- Create user (Admin)PUT /api/users/{id}- Update user (Admin)DELETE /api/users/{id}- Delete user (Admin)
DLP Scanning
POST /api/scans/- Create and execute scanGET /api/scans/- List scansGET /api/scans/{id}- Get scan detailsGET /api/scans/stats- Get scan statistics
Dashboard
GET /api/dashboard/overview- Dashboard overview with stats
🔌 ICAP Integration
Configure your proxy or gateway to use Spider-Snoop as ICAP server:
ICAP Server: icap://your-server-ip:1344/dlp_scan
Methods: REQMOD, RESPMOD
Supported ICAP Clients
- Squid Proxy
- c-icap
- Any ICAP-compliant proxy/gateway
🔍 Detected Data Types
- 💳 Credit Card Numbers - Visa, MasterCard, Amex, Discover
- 🆔 Social Security Numbers (SSN)
- 📧 Email Addresses
- 📞 Phone Numbers
- 🌐 IP Addresses
- 🔑 API Keys & Access Tokens
- ☁️ AWS Access Keys
🏗️ Architecture
spider-snoop/
├── app/
│ ├── __init__.py
│ ├── main.py # FastAPI application
│ ├── config.py # Configuration
│ ├── database.py # Database setup
│ ├── dlp_engine.py # DLP scanning engine
│ ├── icap_server.py # ICAP protocol server
│ ├── models/ # Database models
│ │ ├── user.py
│ │ └── scan.py
│ ├── schemas/ # Pydantic schemas
│ │ ├── user.py
│ │ └── scan.py
│ ├── routes/ # API routes
│ │ ├── auth.py
│ │ ├── users.py
│ │ ├── scans.py
│ │ └── dashboard.py
│ └── utils/
│ └── auth.py # Authentication utilities
├── scripts/
│ └── init_db.py # Database initialization
├── requirements.txt
├── .env.example
└── README.md
🧪 Testing
Test DLP Scan via API
# Login
curl -X POST http://localhost:8000/api/auth/login \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "username=admin&password=admin123"
# Scan content
curl -X POST http://localhost:8000/api/scans/ \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"content": "My credit card is 4532-1234-5678-9012", "source": "API"}'
Test ICAP Server
# Using c-icap-client
c-icap-client -i localhost -p 1344 -s dlp_scan -f test_file.txt
🔒 Security Considerations
- Change default passwords immediately in production
- Use strong SECRET_KEY in .env file
- Enable HTTPS in production
- Configure CORS appropriately
- Use PostgreSQL instead of SQLite for production
- Implement rate limiting
- Enable API key rotation
📊 Database Schema
Users Table
- id, email, username, hashed_password
- full_name, role, is_active
- created_at, updated_at
DLP Scans Table
- id, user_id, source, content
- status, risk_level, findings, verdict
- scan_duration_ms, created_at, completed_at
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
📝 License
MIT License - see LICENSE file for details
🆘 Support
For issues and questions:
- GitHub Issues: https://github.com/sumeetgp/spider-snoop/issues
🎯 Roadmap
- Web Dashboard UI (HTML/Jinja2)
- Email notifications for critical findings
- Custom detection rules
- Machine learning model training
- Multi-language support
- Reporting & exports
- Integration with SIEM systems
- Docker containerization
☁️ Cloud Deployment
Spider-Snoop is cloud-ready and includes a full Docker stack with Nginx as a reverse proxy.
1. Requirements
- A cloud server (AWS EC2, DigitalOcean Droplet, Linode, etc.)
- OS: Ubuntu 20.04+ (Recommended)
- Git installed on the server (to clone the repo)
2. Quick Deployment Script
We provide a zero-configuration deployment script (deploy.sh) that automates everything: checking/installing Docker, setting up credentials, and launching the services.
-
Clone the repository/copy files to your server:
git clone https://github.com/sumeetgp/spider-snoop.git cd spider-snoop
-
Run the deployment script:
chmod +x deploy.sh ./deploy.sh
The script will prompt you for your
OPENAI_API_KEYif it's not present in.env. -
Access the application:
- Open your browser and navigate to:
http://<your-server-ip> - The application usually listens on Port 80. Ensure your firewall allows HTTP traffic.
- Open your browser and navigate to:
3. Manual Docker Deployment
If you prefer to run docker-compose manually:
-
Configure Environment:
cp .env.example .env # Add your OPENAI_API_KEY to .env
-
Start Services:
docker-compose up -d --build
-
Verify:
docker ps # You should see 3 containers: spider-snoop-nginx, spider-snoop-api, spider-snoop-db
4. Nginx Configuration
The included nginx/nginx.conf handles reverse proxying to the API and serving static files. It is configured to run on Port 80 inside the Docker network.
Made with ❤️ by the Spider-Snoop team
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 spidercob-0.2.0.tar.gz.
File metadata
- Download URL: spidercob-0.2.0.tar.gz
- Upload date:
- Size: 72.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7601ce7e1d7e52a49ce5e8a4c5eed86c6ab2ddc3ee1f1ea8e1c7d893acb34585
|
|
| MD5 |
854102fd339347d6b89277adb369bd5c
|
|
| BLAKE2b-256 |
873a23b4485fe9623804caad6ff4c9138002287e86515e29c4bee838aa44ec79
|
File details
Details for the file spidercob-0.2.0-py3-none-any.whl.
File metadata
- Download URL: spidercob-0.2.0-py3-none-any.whl
- Upload date:
- Size: 11.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
46300fa2a5c6cc6ed555b782f80e5f4252401b40b6bef49576a330c8b24338fc
|
|
| MD5 |
e6683414243b8ba56704fc37a6e42a37
|
|
| BLAKE2b-256 |
fe9263fbd20b5624b465587cc81eb165245cd421204e9813aaa52f1f1ffa1a25
|