返回顶部
s

soc-deploy-thehive部署TheHive平台

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.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
122
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

soc-deploy-thehive

SOC 部署:TheHive 5.4 + Cortex 3.1.8

在任何支持 Docker 的 Linux 主机上部署 TheHive + Cortex 事件响应平台。

此技能不会创建虚拟机。 它需要一个已安装 Docker 的 SSH 目标。如果需要基础设施,请先使用 hyperv-create-vm 或 proxmox-create-vm。

使用场景

  • - 部署 thehive
  • 搭建 thehive
  • 安装 thehive 和 cortex
  • thehive 实验室
  • 事件响应平台

用户输入

参数默认值是否必需
SSH 目标-是 (user@host)
管理员密码
ChangeMe123! | 否 | | 组织名称 (Cortex) | SOC | 否 | | TheHive 密钥 | (自动生成40位字符) | 否 |

前置条件检查

bash

SSH 连接测试


ssh echo OK

Docker + Compose v2 检查

ssh docker --version && docker compose version

内存检查(需要4GB+可用空间)

ssh free -h | grep Mem

执行步骤

单命令部署

bash
scp scripts/setup.sh :~/
scp references/docker-compose.yml :~/thehive-cortex/docker-compose.yml
ssh bash ~/setup.sh

setup.sh 执行内容(来自 thehive-cortex-setup-guide.md)

  1. 1. 创建目录 + 写入 docker-compose.yml
  2. docker compose up -d(启动 Cassandra + ES + TheHive + Cortex)
  3. 轮询健康检查端点 直到所有服务响应:
- GET :9200/_cluster/health(Elasticsearch) - GET :9000/api/status(TheHive) - GET :9001/api/status(Cortex)
  1. 4. TheHive 管理员设置:
- POST /api/v1/login 使用 admin@thehive.local / secret - POST /api/v1/user/admin@thehive.local/password/change(非 PATCH) - POST /api/v1/user/admin@thehive.local/key/renew -> API 密钥
  1. 5. Cortex 设置(CSRF 处理):
- POST /api/maintenance/migrate - POST /api/user(创建超级管理员,首次用户端点) - POST /api/login -> 会话 Cookie - GET /api/user/admin -> 捕获 CORTEX-XSRF-TOKEN Cookie - POST /api/organization(带 CSRF Cookie + 请求头) - POST /api/user(组织管理员,带 CSRF) - POST /api/user//key/renew(带 CSRF)-> 组织密钥 - POST /api/user/admin/key/renew(带 CSRF)-> 超级密钥
  1. 6. 集成配置:
- 更新 docker-compose.yml:添加 --cortex-hostnames cortex --cortex-keys - docker compose up -d thehive(仅重启 TheHive) - 等待 30 秒让 TheHive 启动
  1. 7. 验证两个 API 都能使用 Bearer 密钥响应
  2. 写入凭据 到 ~/thehive-cortex/api-keys.txt

输出给用户

TheHive + Cortex 部署完成!

TheHive: http://:9000
Cortex: http://:9001

凭据信息:
TheHive 管理员: admin@thehive.local /
Cortex 超级管理员: admin /
Cortex 组织管理员: -admin(仅 API 密钥)

API 密钥:
TheHive:
Cortex 超级管理员:
Cortex 组织管理员:

MCP 连接配置:
THEHIVE_URL=http://:9000
THEHIVEAPIKEY=
CORTEX_URL=http://:9001
CORTEXAPIKEY=

密钥已保存至:~/thehive-cortex/api-keys.txt

关键注意事项

详见 references/gotchas.md:

  1. 1. Cortex CSRF(最大的自动化障碍): 所有修改请求都需要 Cookie CORTEX-XSRF-TOKEN + 请求头 X-CORTEX-XSRF-TOKEN。标准的 Play Framework 绕过请求头无效。获取第一个 API 密钥后,使用 Authorization: Bearer 跳过 CSRF
  2. TheHive 密码端点: POST /password/change 使用 currentPassword+password。PATCH 端点返回 204 但会静默忽略密码字段
  3. Bash 中密码包含 !: 使用 printf ... | curl -d @-,不要直接使用带感叹号的 -d 参数
  4. 首次用户一次性设置: Cortex 的 POST /api/user 无需认证仅在零用户时有效
  5. TheHive 启动延迟: compose up 后需要 15-30 秒(等待 Cassandra)
  6. 密钥长度: TheHive Play Framework JWT 需要 32 位以上字符的密钥
  7. 使用组织管理员密钥(非超级管理员)进行 TheHive-Cortex 集成(最小权限原则)

API 快速参考

完整端点列表请参见 references/api-reference.md。

超时策略

设置过程约需 5-7 分钟(主要是等待服务启动)。如果 Docker 镜像未缓存,需额外增加约 5 分钟用于拉取。建议分步执行:

  • - 第一步:docker compose up -d + 拉取镜像(约 5 分钟)
  • 第二步:账户设置 + API 密钥(约 3 分钟)

配合使用

  • - hyperv-create-vm - 创建 Hyper-V 虚拟机,然后在其上部署 TheHive
  • proxmox-create-vm - 创建 Proxmox LXC/容器,然后在其上部署 TheHive
  • soc-deploy-misp - 同时部署 MISP 用于威胁情报

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 soc-deploy-thehive-1776117429 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 soc-deploy-thehive-1776117429 技能

通过命令行安装

skillhub install soc-deploy-thehive-1776117429

下载

⬇ 下载 soc-deploy-thehive v1.0.0(免费)

文件大小: 8.57 KB | 发布时间: 2026-4-14 09:48

v1.0.0 最新 2026-4-14 09:48
Initial release of soc-deploy-thehive: Deploy TheHive 5 + Cortex 3 via Docker on any Linux host.

- Automates deployment of TheHive 5.4 and Cortex 3.1.8, including all integration wiring.
- Handles admin account creation, password setting, API key generation, and Cortex CSRF/workflow.
- Verifies all services are running, writes ready-to-use API keys and URLs to disk.
- Platform-agnostic: works on any SSH-accessible, Docker-ready Linux host.
- Includes guidance on required RAM, dependencies, integration gotchas, and output usage.

Archiver·手机版·闲社网·闲社论坛·智能体自动化市场· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2026 闲社网·AI智能体论坛·AI自动化解决方案·http://xianshe.com

p2p_official_large
返回顶部