Skip to main content

Spider-Snoop DLP CI Status 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

  1. Clone the repository
git clone https://github.com/sumeetgp/spider-snoop.git
cd spider-snoop
  1. Create virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install dependencies
pip install -r requirements.txt
  1. Configure environment
cp .env.example .env
# Edit .env with your settings (OpenAI API key, etc.)
  1. Initialize database
python scripts/init_db.py
  1. Run the application
python -m app.main
# Or using uvicorn directly:
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
  1. 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 info
  • GET /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 scan
  • GET /api/scans/ - List scans
  • GET /api/scans/{id} - Get scan details
  • GET /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

  1. Change default passwords immediately in production
  2. Use strong SECRET_KEY in .env file
  3. Enable HTTPS in production
  4. Configure CORS appropriately
  5. Use PostgreSQL instead of SQLite for production
  6. Implement rate limiting
  7. 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:

🎯 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.

  1. Clone the repository/copy files to your server:

    git clone https://github.com/sumeetgp/spider-snoop.git
    cd spider-snoop
    
  2. Run the deployment script:

    chmod +x deploy.sh
    ./deploy.sh
    

    The script will prompt you for your OPENAI_API_KEY if it's not present in .env.

  3. 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.

3. Manual Docker Deployment

If you prefer to run docker-compose manually:

  1. Configure Environment:

    cp .env.example .env
    # Add your OPENAI_API_KEY to .env
    
  2. Start Services:

    docker-compose up -d --build
    
  3. 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

spidercob-0.2.0.tar.gz (72.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

spidercob-0.2.0-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

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

Hashes for spidercob-0.2.0.tar.gz
Algorithm Hash digest
SHA256 7601ce7e1d7e52a49ce5e8a4c5eed86c6ab2ddc3ee1f1ea8e1c7d893acb34585
MD5 854102fd339347d6b89277adb369bd5c
BLAKE2b-256 873a23b4485fe9623804caad6ff4c9138002287e86515e29c4bee838aa44ec79

See more details on using hashes here.

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

Hashes for spidercob-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 46300fa2a5c6cc6ed555b782f80e5f4252401b40b6bef49576a330c8b24338fc
MD5 e6683414243b8ba56704fc37a6e42a37
BLAKE2b-256 fe9263fbd20b5624b465587cc81eb165245cd421204e9813aaa52f1f1ffa1a25

See more details on using hashes here.

Release history Release notifications | RSS feed

0.5.0

2 files

0.4.0

2 files

0.3.0

2 files

0.2.1

2 files

This release

0.2.0 This release

2 files

0.1.2

1 file

0.1.1

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page