thehivesocincident-response
MDstable
NoteSnippetChecklistPlaybook
TheHive — Gestion d'incidents & Cases
Déploiement et utilisation de TheHive 5 pour la gestion d'incidents SOC : cases, alertes, observables, Cortex
snippetintermediate 2026-05-30 4 min read
thehivesocincident-responsecortexsoar
Déploiement Docker
yaml
# docker-compose.ymlversion: "3.8"services:cassandra:image: cassandra:4environment:- CASSANDRA_CLUSTER_NAME=thehivevolumes:- cassandra_data:/var/lib/cassandraelasticsearch:image: elasticsearch:7.17.9environment:- discovery.type=single-node- xpack.security.enabled=false- "ES_JAVA_OPTS=-Xms512m -Xmx512m"volumes:- es_data:/usr/share/elasticsearch/datathehive:image: strangebee/thehive:5depends_on:- cassandra- elasticsearchports:- "9000:9000"environment:- JVM_OPTS=-Xms512m -Xmx512mvolumes:- ./thehive.conf:/etc/thehive/application.conf- thehive_data:/opt/thp/thehive/datacortex:image: thehiveproject/cortex:3ports:- "9001:9001"volumes:- cortex_data:/var/db/cortexvolumes:cassandra_data:es_data:thehive_data:cortex_data:
# Accès : http://localhost:9000# Compte par défaut : admin@thehive.local / secret
Configuration application.conf
hocon
# /etc/thehive/application.confdb {provider: janusgraphjanusgraph {storage {backend: cqlhostname: ["cassandra"]cql.cluster-name: thehive}index.search {backend: elasticsearchhostname: ["elasticsearch"]index-name: thehive}}}storage {provider: localfslocalfs.location: /opt/thp/thehive/data}# Cortex integrationcortex {servers = [{name = localurl = "http://cortex:9001"auth {type = bearerkey = "CORTEX_API_KEY"}}]}
Concepts clés
Hiérarchie
OrganisationCase incidentTasks actions raliserTask logs journalObservables IOCIP domain hash URLAnalyseurs CortexAlertes vnements sources
Statuts d'un case
| Statut | Description | |--------|-------------| | Open | En cours d'investigation | | Resolved | Clôturé avec résolution | | Deleted | Supprimé |
TLP / PAP
| Code | Signification | |------|---------------| | TLP:WHITE | Public | | TLP:GREEN | Communauté | | TLP:AMBER | Organisation | | TLP:RED | Restreint |
API TheHive
Authentification
bash
API_KEY"votre_api_key"BASE_URL"http://localhost:9000"# Test connexioncurl -H "Authorization: Bearer $API_KEY"$BASE_URL/api/v1/user/current
Créer un case
bash
curl -X POST-H "Authorization: Bearer $API_KEY"-H "Content-Type: application/json"-d"title" "Suspicious PowerShell execution""description" "SIEM alert - encoded PowerShell detected on WS-042""severity" 2"tlp" 2"tags" "powershell" "windows" "lateral-movement""tasks""title" "Isoler le poste WS-042""title" "Analyser les logs PowerShell""title" "Vérifier les connexions réseau"$BASE_URL/api/v1/case
Ajouter un observable
bash
curl -X POST-H "Authorization: Bearer $API_KEY"-H "Content-Type: application/json"-d"dataType" "ip""data" "185.220.101.45""tlp" 2"tags" "c2" "suspicious""message" "IP source de la connexion PowerShell"$BASE_URL/api/v1/case/CASE_ID/observable
Créer une alerte (depuis SIEM)
bash
curl -X POST-H "Authorization: Bearer $API_KEY"-H "Content-Type: application/json"-d"type" "siem""source" "elastic""sourceRef" "alert-20260530-001""title" "Brute Force SSH détecté""severity" 2"artifacts""dataType" "ip" "data" "10.0.0.50""dataType" "ip" "data" "192.168.1.10"$BASE_URL/api/v1/alert
Cortex — Analyseurs
bash
# Analyseurs populaires à activer dans CortexAbuse_Finder # WHOIS, abus contactAbuseIPDB # Réputation IPVirusTotal_v3 # Hash, IP, URL, domainShodan # Infos hostMaxMind_GeoIP # Géolocalisation IPUrlscan_io # Analyse URLMISP # Cross-référence MISP
Lancer une analyse depuis TheHive
Case > Observable > AnalyzeSlectionner analyseurs > RunRsultats visibles dans lobservable
Intégration Wazuh → TheHive
python
# /var/ossec/integrations/custom-thehive.pyimport json, requests, sysdef send_alert(alert, api_key, url):headers = {"Authorization": f"Bearer {api_key}"}payload = {"title": f"Wazuh Alert: {alert['rule']['description']}","severity": 2,"tags": ["wazuh", f"rule-{alert['rule']['id']}"],"artifacts": [{"dataType": "ip", "data": alert.get("agent", {}).get("ip", "")}]}requests.post(f"{url}/api/v1/alert", json=payload, headers=headers)alert = json.loads(sys.stdin.read())send_alert(alert, "API_KEY", "http://thehive:9000")
xml
<!-- /var/ossec/etc/ossec.conf --><integration><name>custom-thehive</name><level>10</level><alert_format>json</alert_format></integration>
Playbook type (Case template)
Template "Compromission de compte"Tasks1 Dsactiver le compte AD compromis2 Reset du mot de passe3 Analyser les dernires connexions audit logs4 Identifier les ressources accdes5 Vrifier les rgles de forwarding mail6 Notifier lutilisateur et sa hirarchie7 Rapport dincident
OPS·BRAIN v1.092 notes · Securitylocal