opensoar-hq/opensoar-core
GitHub: opensoar-hq/opensoar-core
开源的 Python 原生 SOAR 平台,用纯 Python 编写自动化剧本,解决安全告警编排与响应的自动化需求。
Stars: 0 | Forks: 0
OpenSOAR
开源、Python 原生的安全编排、自动化与响应 (SOAR) 平台。
OpenSOAR 是现代 SOC 的编排与自动化层。它位于您的 SIEM(Elastic、Wazuh、Splunk)与响应工具之间,让您能够使用原生 Python 编写自动化逻辑 —— 无沙箱、无按操作计费、无供应商锁定。 为 IR 分析师和 MSSP 构建。深色主题、快速、且观点鲜明。 ## 功能特性 **告警管理** - Webhook 采集与自动规范化(Elastic、Wazuh、通用 JSON) - 告警生命周期:`new` → `in_progress` → `resolved` - 判定追踪(恶意、可疑、良性) - IOC 提取(IP、域名、哈希、URL) - 去重与严重性推断 - 面向 MSSP 多租户的合作伙伴/租户字段 **Playbook 引擎** - Python 原生 —— Playbook 是异步 Python 函数,而非 YAML 或拖拽式 - `@playbook` 和 `@action` 装饰器,支持自动追踪 - 通过 `asyncio.gather()` 并行执行,通过 `await` 顺序执行 - 单个操作的超时、重试和退避策略 - 触发器引擎(基于严重性、来源、字段匹配) - 基于 Celery 的异步执行,支持水平扩展 **集成** - Elastic Security(告警、轮询) - VirusTotal(哈希/IP/域名/URL 查询) - AbuseIPDB(IP 信誉) - Slack(通知) - Email(SMTP) - 可通过 Python SDK 扩展 **仪表盘与 UI** - React 19 + TypeScript + Tailwind CSS v4 - 面向 IR 分析师的仪表盘(优先队列、MTTR、未分配告警) - 用于 MSSP 计费的每个合作伙伴统计数据 - 告警详情包含分类、IOC、时间线、Playbook 运行记录 - 包含评论和编辑历史的时间线 - 针对 SOC 环境优化的深色主题 **认证与 API** - JWT 认证与分析师管理 - 用于集成的 API 密钥认证 - 完整的 REST API(OpenAPI 自动生成) ## 快速开始 ``` # Clone and start git clone https://github.com/opensoar-hq/opensoar.git cd opensoar docker compose up -d # 发送测试告警 curl -X POST http://localhost:8000/api/v1/webhooks/alerts \ -H "Content-Type: application/json" \ -d '{ "rule_name": "Brute Force Detected", "severity": "high", "source_ip": "203.0.113.42", "hostname": "web-prod-01", "tags": ["authentication", "brute-force"] }' # 打开 UI open http://localhost:3000 ``` ## 架构 ``` Elastic / Wazuh / Webhooks │ ▼ ┌──────────────┐ │ Ingestion │ Normalize → Extract IOCs → Deduplicate └──────┬───────┘ │ ▼ ┌──────────────┐ │ Trigger │ Match alert to playbook conditions │ Engine │ └──────┬───────┘ │ ▼ ┌──────────────┐ │ Celery │ Async playbook execution │ Worker │ @action tracking, retries, timeouts └──────┬───────┘ │ ▼ ┌──────────────┐ │ Actions │ Enrich (VT, AbuseIPDB) → Respond (isolate, block) │ │ → Notify (Slack, email) → Update (tickets, cases) └──────────────┘ ``` **技术栈**:Python 3.12, FastAPI, SQLAlchemy (async), PostgreSQL, Redis, Celery, React 19, Vite ## Playbook 示例 ``` from opensoar import playbook, action, Alert import asyncio @playbook(trigger="webhook", conditions={"severity": ["high", "critical"]}) async def triage_high_severity(alert: Alert): # Enrich in parallel vt_result, abuse_result = await asyncio.gather( lookup_virustotal(alert.iocs), lookup_abuseipdb(alert.source_ip), ) if abuse_result.confidence_score > 80: await isolate_host(alert.hostname) await notify_slack( channel="#soc-critical", message=f"🚨 {alert.title} — host isolated, VT: {vt_result.positives}/{vt_result.total}" ) else: await alert.update(determination="benign", status="resolved") ``` 无 DSL。无 YAML。只有 Python。 ## 项目结构 ``` opensoar/ ├── src/opensoar/ │ ├── api/ # FastAPI endpoints (alerts, playbooks, runs, dashboard) │ ├── auth/ # JWT + API key authentication │ ├── core/ # Playbook engine, triggers, executor, registry │ ├── ingestion/ # Alert normalization, webhook processing │ ├── integrations/ # Elastic, VirusTotal, AbuseIPDB, Slack, Email │ ├── models/ # SQLAlchemy models │ ├── schemas/ # Pydantic v2 request/response schemas │ └── worker/ # Celery tasks ├── ui/ # React frontend ├── migrations/ # Alembic database migrations ├── playbooks/ # Example playbooks ├── docker-compose.yml # Full stack: API + worker + PostgreSQL + Redis └── Dockerfile ``` ## 文档 - [架构](docs/architecture.md) — 系统设计、组件拆解、部署模型 - [设计决策](docs/design-decisions.md) — UX 和架构原理 - [商业模式](docs/business-model.md) — 开源核心策略、定价、市场进入策略 - [仓库结构](docs/repository-structure.md) — 多仓库计划(SDK、集成、企业版、AI) - [路线图](docs/roadmap.md) — 已完成的功能与后续计划 - [市场研究](docs/market-research.md) — 市场规模、需求信号、目标用户 - [竞争格局](docs/competitive-landscape.md) — 我们的对比优势 ## 路线图 | 阶段 | 状态 | 重点 | |-------|--------|-------| | Core Platform | ✅ 完成 | 告警管理、Playbook 引擎、API、UI | | SDK + Integrations | 🔜 下一步 | Python SDK、集成清单、社区资源包 | | Case Management | 计划中 | 事件、关联分析、协作 | | AI Features | 计划中 | 自动分类、自然语言 Playbook、告警关联 | | Enterprise | 计划中 | RBAC、SSO、审计、多租户 | | Cloud | 计划中 | 位于 opensoar.app 的 SaaS 服务 | ## 贡献 OpenSOAR 目前处于早期开发阶段。如果您有兴趣做出贡献 —— 无论是集成、Playbook、前端还是文档 —— 请提交 issue 或联系我们。 ## 许可证 Apache 2.0 —— 可商用、可分叉、可嵌入。无限制。标签:AbuseIPDB, Ask搜索, Celery, HTTP/HTTPS抓包, IOC提取, IR, JWT认证, LIDS, MSSP, Playbook, Python, React, Slack通知, SOAR, Syscalls, Tailwind CSS, TypeScript, VirusTotal, Wazuh, 告警管理, 多云租户, 威胁情报, 安全工具集成, 安全插件, 安全运营中心, 开发者工具, 开源, 异步执行, 态势感知, 搜索引擎查询, 无后门, 测试用例, 网络安全, 网络映射, 自动化剧本, 自动化攻击, 误报处理, 请求拦截, 隐私保护