Skip to content

Real-time network monitor + outbound firewall — see & block every connection. Privacy-first, local-first, Rust fleet agent, SIEM exports, 8 languages. / Moniteur réseau temps réel + pare-feu sortant, agent de flotte Rust, exports SIEM. 100 % local.

3.7 KB
Raw Blame
# Snitch — Docker Compose
# EN: Runs the full Snitch stack (backend + compiled frontend) with host networking.
#     Host networking is required so libpcap can capture real host interfaces.
#     Linux only — Docker Desktop (Mac/Windows) uses a VM and cannot capture host traffic.
#
#     SECURITY: SNITCH_BIND defaults to 127.0.0.1 — the API exposes your full
#     traffic graph, process names and alerts. Every request needs the API
#     token (printed once in `docker logs`, persisted in data/api_token.txt).
#     Open the UI with:  http://localhost:8000/?token=<TOKEN>
#     Only set SNITCH_BIND=0.0.0.0 if you explicitly want LAN access —
#     token auth still applies on every endpoint.
#
# FR: Lance toute la stack Snitch (backend + frontend compilé) en réseau hôte.
#     Le réseau hôte est requis pour que libpcap capture les vraies interfaces.
#     Linux uniquement — Docker Desktop (Mac/Windows) utilise une VM et ne peut pas
#     capturer le trafic de l'hôte.
#
#     SÉCURITÉ : SNITCH_BIND vaut 127.0.0.1 par défaut — l'API expose tout votre
#     graphe de trafic, vos noms de processus et vos alertes. Chaque requête
#     exige le jeton API (affiché une fois dans `docker logs`, persisté dans
#     data/api_token.txt). Ouvrez l'UI avec :  http://localhost:8000/?token=<JETON>
#     Ne mettez SNITCH_BIND=0.0.0.0 que pour un accès LAN explicite —
#     le jeton reste exigé sur tous les endpoints.

services:
  snitch:
    # EN: Pulls the prebuilt GHCR image — remove `image:` + keep `build: .` to
    #     compile from source instead (docker compose up --build).
    # FR: Tire l'image prébuildée GHCR — retirez `image:` et gardez `build: .`
    #     pour compiler depuis les sources (docker compose up --build).
    image: ghcr.io/aixisstudio/snitch:latest
    build: .
    network_mode: host
    cap_add:
      - NET_ADMIN   # EN: promiscuous mode / FR: mode promiscuité
      - NET_RAW     # EN: raw socket / packet capture / FR: socket brut / capture de paquets
    environment:
      # EN: Loopback by default — see SECURITY note above.
      # FR: Loopback par défaut — voir la note SÉCURITÉ ci-dessus.
      - SNITCH_BIND=${SNITCH_BIND:-127.0.0.1}
      - SNITCH_PORT=${SNITCH_PORT:-8000}
      # EN: Uncomment to pin a fixed token instead of an auto-generated one.
      # FR: Décommenter pour imposer un jeton fixe plutôt qu'un jeton généré.
      # - SNITCH_TOKEN=change-me
      # EN: NO online geolocation exists — the app never sends your IPs
      #     anywhere. Drop an .mmdb in data/geo/ for fully-offline lookups.
      # FR: AUCUNE géolocalisation en ligne — l'app n'envoie jamais vos IP.
      #     Déposez un .mmdb dans data/geo/ pour des recherches 100 % hors ligne.
    volumes:
      # EN: data/geo/*.mmdb   — optional, offline geolocation (DB-IP Lite or GeoLite2)
      #     data/snitch.db    — created automatically at runtime
      #     data/api_token.txt — generated API token (0600)
      # FR: data/geo/*.mmdb    — optionnel, géolocalisation hors ligne (DB-IP Lite ou GeoLite2)
      #     data/snitch.db     — créé automatiquement au démarrage
      #     data/api_token.txt — jeton API généré (0600)
      - ./data:/app/data
    healthcheck:
      # EN: /capture/status requires the token — use TCP connect as the liveness
      #     probe instead (unauthenticated requests get 401 by design).
      # FR: /capture/status exige le jeton — la sonde de vie est un simple
      #     connect TCP (les requêtes non authentifiées reçoivent 401 par design).
      test: ["CMD-SHELL", "python -c \"import socket,os; socket.create_connection(('127.0.0.1', int(os.environ.get('SNITCH_PORT','8000'))), 3)\""]
      interval: 30s
      timeout: 5s
      retries: 3
    restart: unless-stopped