Akash-Bhavsar/ot-soc-in-a-box

GitHub: Akash-Bhavsar/ot-soc-in-a-box

一条命令部署的生产级工控安全运营中心实验室,集 PLC 仿真、网络监控、检测工程、攻击模拟和 SOAR 自动化响应于一体。

Stars: 1 | Forks: 0

# OT SOC-in-a-Box 一个生产级的 OT/ICS 安全监控实验室,具备检测工程、自动化 SOAR 响应和完整的 ICS Cyber Kill Chain 攻击模拟。 一条命令即可部署一个包含 8 个服务的工业控制系统安全运营中心——从 PLC 模拟器到 SIEM 关联分析,再到自动化隔离。自定义检测规则映射到 [MITRE ATT&CK for ICS](https://attack.mitre.org/techniques/ics/),并通过 7 阶段攻击模拟端到端地演练整个检测管道。 ## 演示 https://github.com/Akash-Bhavsar/ot-soc-in-a-box/releases/download/v1.0.0/demo.webm ## 架构 ``` ┌────────────────────── OT Zone (Purdue Level 1/2) ───────────────────────┐ │ │ │ OpenPLC (PLC sim) ◄──── Modbus/TCP ────► Modbus Simulator │ │ :8080 (HMI web) :5020 (Modbus server) │ │ │ └──────────────────────────────┬───────────────────────────────────────────┘ │ mirrored traffic (passive tap) ┌────────────────────── OT DMZ (Level 3.5) ───────────────────────────────┐ │ │ │ Zeek (NSM) Suricata (IDS) │ │ ├─ conn.log (JSON) ├─ eve.json (alerts) │ │ └─ protocol metadata └─ 8 custom ICS rules │ │ │ │ └──────── /var/ot/telemetry/ (shared volume) ───────┘ │ │ │ └──────────────────────────────┬───────────────────────────────────────────┘ │ log ingestion ┌────────────────────── IT Zone (Level 4/5) ──────────────────────────────┐ │ │ │ Wazuh Manager (SIEM + SOAR) │ │ ├─ 13 custom correlation rules (ot-soc_rules.xml) │ │ ├─ Decoder chains: JSON → Suricata/Zeek → OT correlation │ │ ├─ Active Response: auto-block on unauthorized Modbus writes │ │ └─ Ingests: Suricata, Zeek, auth.log, web access logs │ │ │ │ Wazuh Agent (host monitoring) │ │ ├─ File integrity monitoring (FIM) │ │ ├─ Rootkit detection │ │ └─ System inventory (syscollector) │ │ │ │ OpenSearch ──► Wazuh Dashboard │ │ :19200 :15601 │ │ │ └──────────────────────────────────────────────────────────────────────────┘ ``` ## 快速开始 ``` # 克隆并配置 git clone https://github.com/Akash-Bhavsar/ot-soc-in-a-box.git cd ot-soc-in-a-box cp .env.example .env # Edit .env to set your own passwords # 启动所有内容 ./scripts/start.sh # 导入 OT SOC 仪表盘 ./scripts/create_dashboard.sh # 运行 7 阶段攻击模拟 ./scripts/attack_sim.sh ``` 在 **http://localhost:15601** 打开 Wazuh Dashboard,并使用 `.env` 文件中的凭据登录。导航到 **Security Events** 查看告警。 ## 组件 | 服务 | 镜像 | 用途 | 区域 | 端口 | |---------|-------|---------|------|------| | OpenPLC | `fdamador/openplc` | 带有 Modbus/TCP + HMI Web UI 的 PLC 模拟器 | OT | 8080, 502 | | Modbus Simulator | `oitc/modbus-server` | OT 流量生成器 (Modbus 服务器) | OT | 1502 | | Zeek | `zeek/zeek` | 协议感知的网络元数据 | DMZ | — | | Suricata | `jasonish/suricata` | 带有自定义 ICS/Modbus 规则的 IDS | DMZ | — | | Wazuh Manager | `wazuh/wazuh-manager:4.13.0` | SIEM 关联分析 + SOAR 自动化 | IT | 1514, 1515, 15500 | | OpenSearch | `opensearchproject/opensearch:2.11.1` | 日志存储和索引 | IT | 19200 | | Wazuh Dashboard | `wazuh/wazuh-dashboard:4.13.0` | 安全事件可视化 | IT | 15601 | | Wazuh Agent | `wazuh/wazuh-agent:4.13.0` | 主机级监控 (FIM, rootcheck) | IT | — | ## MITRE ATT&CK for ICS 覆盖范围 该实验室检测跨越完整 ICS Cyber Kill Chain 的攻击,每个检测都映射到 MITRE ATT&CK for ICS 技术: | Kill Chain 阶段 | 技术 ID | 技术名称 | 检测规则 | 级别 | 传感器 | |-----------------|-------------|----------------|----------------|-------|--------| | Reconnaissance | T0802 | Automated Collection | 100102 | 5 | Suricata | | Reconnaissance | T0846 | Remote System Discovery | 100104 | 6 | Suricata | | Initial Access | T0886 | Remote Services (SSH) | 100110 | 12 | Wazuh | | Exploitation | T0866 | Exploitation of Remote Services (SQLi) | 100120 | 12 | Wazuh | | Exploitation | T0866 | Exploitation of Remote Services (XSS) | 100121 | 10 | Wazuh | | Exploitation | T0866 | Successful Web Attack (200 OK) | 100122 | 14 | Wazuh | | Manipulation | T0883 | Change Operating Mode | 100101 | 7 | Suricata | | Impact | T0813 | Denial of Control | 100103 | 12 | Suricata | | Persistence | — | File Integrity Change | 550/554 | 7 | Wazuh | | Response | — | Automated Containment | 651 | 3 | Wazuh | ## 攻击模拟(7 阶段) `scripts/attack_sim.sh` 脚本模拟完整的 ICS Cyber Kill Chain 用于实时演示: | 阶段 | 攻击 | 作用 | 预期检测 | |-------|--------|--------------|-------------------| | 1 | **Reconnaissance** | 5 次端口探测 + Modbus 寄存器读取 + 设备指纹识别 | 规则 100102, 100104 | | 2 | **Initial Access** | 10 次使用常见 ICS 用户名的 SSH 暴力破解尝试 | 规则 100110 (级别 12) | | 3 | **Web Exploitation** | 针对 OpenPLC HMI 的 4 次 SQL 注入 + 3 次 XSS 载荷 | 规则 100120, 100121 | | 4 | **OT Manipulation** | 所有 4 种 Modbus 写入功能码 (FC 0x05/06/0F/10) | 规则 100101 + 主动响应 | | 5 | **Persistence** | 配置文件篡改 (/etc/resolv.conf, /etc/hosts) | FIM 规则 550/554 | | 6 | **Denial of Control** | 10 次快速 Modbus 写入泛洪 | 规则 100103 (级别 12) | | 7 | **Verification** | 跨所有检测层的自动告警摘要 | — | 每个阶段都包含颜色编码的输出、MITRE ATT&CK 参考以及供检测管道处理事件的暂停间隔。 ## 检测工程 ### Suricata IDS 规则(8 条规则) | SID | 描述 | 功能码 | 类别 | |-----|-------------|---------------|----------| | 9000001 | Write Single Coil | FC 0x05 | Exploitation | | 9000002 | Write Single Register | FC 0x06 | Exploitation | | 9000003 | Write Multiple Coils | FC 0x0F | Exploitation | | 9000004 | Write Multiple Registers | FC 0x10 | Exploitation | | 9000010 | Read Coils | FC 0x01 | Reconnaissance | | 9000011 | Read Input Registers | FC 0x04 | Reconnaissance | | 9000020 | Diagnostics Request | FC 0x08 | Fingerprinting | | 9000021 | Device Identification | FC 0x2B | Fingerprinting | ### Wazuh 关联规则(13 条规则) | 规则 ID | 级别 | 描述 | 链接自 | |---------|-------|-------------|-------------| | 100100 | 3 | 来自 OT 管道的 Suricata 基础告警 | 86601 | | 100101 | 7 | 检测到 Modbus 写入操作 | 100100 | | 100102 | 5 | Modbus 寄存器枚举 (侦查) | 100100 | | 100103 | 12 | Modbus 写入泛洪 (拒绝控制) | 100101 (频率) | | 100104 | 6 | 设备指纹识别尝试 | 100100 | | 100110 | 12 | 针对 OT 基础设施的 SSH 暴力破解 | 5712 | | 100111 | 10 | OT 系统上重复的 SSH 失败 | 5720 | | 100120 | 12 | 针对 OT HMI 的 SQL 注入 | 31104 | | 100121 | 10 | 针对 OT HMI/SCADA 的 XSS | 31105 | | 100122 | 14 | 成功的 Web 攻击 (200 OK 响应) | 31106 | | 100200 | 3 | 观察到 Modbus TCP 连接 (Zeek) | json decoder | 有关解码器链、误报分析和调优指导,请参阅 [docs/detection-engineering.md](docs/detection-engineering.md)。 ## SOAR 自动化 自动化事件响应内置于检测管道中: ``` Modbus Write Traffic → Suricata alert (SID 9000001-9000004) → Wazuh rule 100101 fires (level 7) → Active Response: firewall-drop on source IP (10 min) → Rule 651 logged (containment confirmed) ``` `firewall-drop` 命令通过 iptables 自动阻断攻击者的源 IP,持续 600 秒。有关 SOAR 架构和 OT 安全注意事项的详细信息,请参阅 [docs/active-response.md](docs/active-response.md)。 ## 标准对齐 | 标准 | 本实验室如何实施 | |----------|--------------------------| | **Purdue Model** | 3 个网络区域 (OT / DMZ / IT),具有受控通道 | | **NIST SP 800-82** | 边界保护、持续监控、自动化事件响应 | | **ISA/IEC 62443** | 区域隔离、协议感知监控、安全等级执行 | | **MITRE ATT&CK for ICS** | 跨完整 Kill Chain 检测 10+ 项技术 | 有关详细映射,请参阅 [docs/standards-mapping.md](docs/standards-mapping.md)。 ## 仓库结构 ``` ot-soc-in-a-box/ ├── compose/ │ └── docker-compose.yml # 8 services, 3 networks, healthchecks ├── config/ │ ├── suricata/rules/ │ │ └── ics-local.rules # 8 custom Modbus IDS signatures │ ├── wazuh/ │ │ ├── ossec.conf # Manager config + active response │ │ ├── rules/ot-soc_rules.xml # 13 custom correlation rules │ │ ├── decoders/ # OT telemetry decoders │ │ └── shared/ # Agent configs + CIS benchmarks │ ├── wazuh-dashboard/ │ │ └── wazuh.yml # Dashboard → Manager API config │ └── zeek/ │ └── local.zeek # JSON logging policy ├── dashboards/ │ └── ot-soc-dashboard.ndjson # Pre-built OT SOC dashboard ├── docs/ │ ├── architecture.md # Purdue Model zones + data flow │ ├── detection-engineering.md # Decoder chains + tuning guide │ ├── attack-methodology.md # Attacker perspective + real-world parallels │ ├── active-response.md # SOAR automation + OT safety │ ├── playbooks.md # 6 incident response playbooks │ ├── standards-mapping.md # NIST, IEC 62443, MITRE mapping │ └── validation.md # Lab validation procedures ├── scripts/ │ ├── start.sh # One-command launcher with healthchecks │ ├── preflight.sh # Pre-flight validation │ ├── attack_sim.sh # 7-phase ICS Cyber Kill Chain demo │ ├── test_lab.sh # Quick smoke test │ └── create_dashboard.sh # Dashboard import ├── .env # Credentials (git-ignored) ├── .gitignore └── LICENSE # MIT ``` ## 停止实验室 ``` docker compose -f compose/docker-compose.yml down # 同时删除存储数据: docker compose -f compose/docker-compose.yml down -v ``` ## 文档 | 文档 | 描述 | |----------|-------------| | [架构](docs/architecture.md) | Purdue Model 区域、数据流、网络分段 | | [检测工程](docs/detection-engineering.md) | 规则链、解码器分析、误报调优 | | [攻击方法论](docs/attack-methodology.md) | 攻击者视角、现实世界 ICS 事件类比 | | [主动响应](docs/active-response.md) | SOAR 自动化、隔离策略、OT 安全 | | [剧本](docs/playbooks.md) | 6 个带有 MITRE 映射的事件响应剧本 | | [标准映射](docs/standards-mapping.md) | NIST SP 800-82, ISA/IEC 62443, Purdue 对齐 | | [验证](docs/validation.md) | 实验室健康检查和测试程序 | ## 许可证 MIT License。详见 [LICENSE](LICENSE)。
标签:Cloudflare, Docker, Elasticsearch, HTTP/HTTPS抓包, ICS, impacket, Metaprompt, MITRE ATT&CK, NTLM Relay, OpenPLC, OT安全, PKINIT, Rootkit, SCADA, SOAR, Suricata, Zeek, 入侵检测系统, 关键基础设施, 勒索软件防御, 哈希传递, 安全数据湖, 安全运营中心, 安全防御评估, 容器化部署, 工业互联网, 工控安全, 应用安全, 态势感知, 攻击模拟, 数据展示, 普渡模型, 现代安全运营, 管理员页面发现, 红队, 网络安全, 网络攻击模拟, 网络映射, 自动化响应, 蜜罐, 证书利用, 请求拦截, 隐私保护, 驱动签名利用