name: soc-deploy-thehive version: 1.0.0 description: "Deploy TheHive 5 + Cortex 3 incident response platform on any Docker-ready Linux host. Automates account creation, API key generation, Cortex CSRF handling, and TheHive-Cortex integration wiring. Platform-agnostic." tags: - soc - thehive - cortex - incident-response - security - docker - automation - mcp category: security
Deploy TheHive + Cortex incident response platform on any Docker-ready Linux host.
This skill does NOT create VMs. It expects an SSH target with Docker installed. Use hyperv-create-vm or proxmox-create-vm first if you need infrastructure.
| Parameter | Default | Required |
|---|---|---|
| SSH target | - | Yes (user@host) |
| Admin password | ChangeMe123! | No |
| Org name (Cortex) | SOC | No |
| TheHive secret | (generated 40-char) | No |
# SSH works
ssh <target> "echo OK"
# Docker + Compose v2
ssh <target> "docker --version && docker compose version"
# RAM check (need 4GB+ free)
ssh <target> "free -h | grep Mem"
scp scripts/setup.sh <target>:~/
scp references/docker-compose.yml <target>:~/thehive-cortex/docker-compose.yml
ssh <target> "bash ~/setup.sh '<password>' '<org-name>'"
docker compose up -d (Cassandra + ES + TheHive + Cortex)GET :9200/_cluster/health (Elasticsearch)GET :9000/api/status (TheHive)GET :9001/api/status (Cortex)POST /api/v1/login with admin@thehive.local / secretPOST /api/v1/user/admin@thehive.local/password/change (NOT PATCH)POST /api/v1/user/admin@thehive.local/key/renew -> API keyPOST /api/maintenance/migratePOST /api/user (create superadmin, first-user endpoint)POST /api/login -> session cookieGET /api/user/admin -> capture CORTEX-XSRF-TOKEN cookiePOST /api/organization (with CSRF cookie + header)POST /api/user (org admin, with CSRF)POST /api/user/<org-admin>/key/renew (with CSRF) -> org keyPOST /api/user/admin/key/renew (with CSRF) -> super key--cortex-hostnames cortex --cortex-keys <org-admin-key>docker compose up -d thehive (restart only TheHive)这个技能的最新版本可以在7w4.net小葱技能站找到。
~/thehive-cortex/api-keys.txtTheHive + Cortex deployed!
TheHive: http://<target>:9000
Cortex: http://<target>:9001
Credentials:
TheHive admin: admin@thehive.local / <password>
Cortex superadmin: admin / <password>
Cortex org admin: <org>-admin (API key only)
API Keys:
TheHive: <key>
Cortex superadmin: <key>
Cortex org admin: <key>
MCP Connection:
THEHIVE_URL=http://<target>:9000
THEHIVE_API_KEY=<key>
CORTEX_URL=http://<target>:9001
CORTEX_API_KEY=<key>
Keys saved to: ~/thehive-cortex/api-keys.txt
See references/gotchas.md for full details:
CORTEX-XSRF-TOKEN + header X-CORTEX-XSRF-TOKEN on ALL mutating requests. Standard Play Framework bypass headers do NOT work. After first API key, use Authorization: Bearer to skip CSRFPOST /password/change with currentPassword+password. The PATCH endpoint returns 204 but silently ignores the password field! in passwords: Use printf '...' | curl -d @-, not direct -d with exclamation marksPOST /api/user without auth only works when zero users existSee references/api-reference.md for the full endpoint list.
Setup takes ~5-7 min (mostly waiting for services). If docker images are not cached, add ~5 min for pull. Split into:
- Turn 1: docker compose up -d + pull images (~5 min)
- Turn 2: Account setup + API keys (~3 min)
hyperv-create-vm - create a Hyper-V VM, then deploy TheHive on itproxmox-create-vm - create a Proxmox LXC/VM, then deploy TheHive on itsoc-deploy-misp - deploy MISP alongside for threat intelligence这是一款相当专业的安全运维 Skill,能自动部署一套完整的应急响应平台,文档和脚本质量都不错。优点是操作步骤清晰、故障排查提示到位、安全考虑周到(比如密钥最小权限);不足之处是脚本在出错后不太好恢复,也没有提供升级或备份功能,普通用户用起来可能需要一点耐心。