arahman-dulz0/Cyber-Command-Center

GitHub: arahman-dulz0/Cyber-Command-Center

一个自托管、AI 驱动的网络安全运营平台,通过自动化威胁情报融合、多智能体报告生成和本地大模型分析,为个人和团队提供 7×24 小时的智能安全监控与响应闭环。

Stars: 0 | Forks: 0

# 🛡️ Cyber Command Center 一个自托管、全自动的**网络安全情报平台**,在家用服务器上 7×24 小时运行。 它监控互联网上的威胁、CVE、新闻和 CTF 活动,然后将所有内容以智能、 AI 总结的信息流推送到个人 Discord 服务器中——这是一个永不休眠的个人安全运营中心。 ## 架构 ``` MSI GF63 laptop (i5 8th gen, 12GB) — Proxmox VE 9.2.4 └── Ubuntu Server 24.04 LTS VM (192.168.8.185) ├── Docker │ ├── n8n → :5678 │ ├── PostgreSQL → :5432 (db: cyberdb) │ ├── Redis → :6379 │ └── discord-bot → this repo (Phase 1) └── Ollama → :11434 (qwen3:4b) ``` Discord bot 使用完全异步的 Python(`discord.py` 2.x, `asyncpg`, `aiohttp`, `redis.asyncio`)编写,并与本地的 AI、PostgreSQL、Redis 以及 NVD / RSS API 进行通信。 ## 功能(Phase 1) - **`/ask`** — 查询本地 `qwen3:4b` 模型 - **`/cve`** — NVD CVE 查询,包含按严重程度着色的 embeds、受影响的产品、 AI 生成通俗易懂的摘要,以及 PostgreSQL 缓存 - **`/news`** — 来自 The Hacker News、BleepingComputer 和 CISA 的最新新闻 - **`/status`** — 对 PostgreSQL、Redis 和 Ollama 的实时健康检查 - **`/brief`** — 按需获取每日安全简报(也会在每天 07:30 自动发布) - **`/help`**, **`/reload`**, **`/sync`** 所有的 AI 调用都是异步执行的,具有 30 秒超时和 3 次指数退避重试。 每个命令都会被记录;每个错误都会连同完整的 traceback 上报到 `#bot-logs`, 而用户只会看到友好的提示信息。 ## 仓库结构 ``` cyber-command-center/ ├── services/discord-bot/ # the bot (bot.py, cogs/, utils/, Dockerfile) ├── docker/ # infrastructure.yml (existing) + bot.yml ├── scripts/deploy.sh # one-command deploy ├── docs/ # phase1.md, schema.sql ├── .env # secrets (gitignored) └── README.md ``` ## 快速开始 ### 一条命令体验仪表板(无需配置) 启动预装了**真实 CVE 演示数据集**的 Postgres 和 SOC 仪表板 —— 无需 `.env`,无需 API 密钥,无需下载模型: ``` git clone https://github.com/arahman-dulz0/Cyber-Command-Center.git cd Cyber-Command-Center docker compose up -d # 打开 http://localhost:8080 → 一个内容丰富的 dashboard ``` 演示数据来源于**真实的、公开记录的 CVE**(Log4Shell、 Spring4Shell、MOVEit、Citrix Bleed 等)—— 参见 `docker/demo/initdb/`。 ### 运行完整平台(Discord bot + AI) 加入 Discord bot、Redis 和本地 Ollama。请参阅 **[入门指南](docs/getting-started.md)** 获取完整的操作说明 (创建 Discord bot、intents 配置、邀请加入)。简短版本如下: ``` cp .env.example .env # set DISCORD_TOKEN + DISCORD_GUILD_ID docker compose --profile full up -d docker compose exec ollama ollama pull qwen2.5:3b docker compose exec ollama ollama pull nomic-embed-text ``` ### 生产环境部署(对接现有基础设施) 如果服务器已经在 `docker_cyber-net` 上运行了 Postgres/Redis/Ollama,请 使用分离的 compose 文件和部署脚本: ``` cp services/discord-bot/.env.example .env # then fill in DISCORD_TOKEN etc. ./scripts/deploy.sh ``` 请参阅 **[docs/phase1.md](docs/phase1.md)** 获取完整的设置、部署和 故障排除说明。 ## 技术栈 Python 3.11 · discord.py 2.4 · asyncpg · aiohttp · feedparser · Redis · PostgreSQL · Ollama (qwen3:4b) · Docker · Proxmox · Ubuntu Server ## 自动化监控(Phase 2) 在 bot 进程内运行(无需 cron,无需额外容器): - **CVE 监控** — 每小时扫描 NVD 中新发布的 CVSS ≥ 7 的 CVE → AI 摘要 → `#cve-alerts`(带有 *View on NVD* 按钮)。 - **新闻监控** — 每 2 小时获取来自 The Hacker News、BleepingComputer、CISA、 Krebs on Security、Schneier on Security 的新闻 → AI 摘要 → `#cyber-news`。 - **`/status`** — 完整的系统仪表板(CPU/RAM/磁盘 + 服务 + DB 计数 + 上次运行时间)。**`/stats`** — 使用情况和情报统计。 **`/monitor`** — 按需运行监控(管理员)。 请参阅 **[docs/phase2.md](docs/phase2.md)** 了解架构、配置, 以及如何添加新的监控源(GitHub、YouTube、HTB、ExploitDB、KEV 等)。 ## 威胁情报融合(Phase 3) 每个 CVE 在发布前都会在多个免费情报源中进行关联、评分和 风险分析 —— `CVE → EPSS → CISA KEV → ExploitDB → GitHub PoCs → 厂商补丁 → AI 风险 → CCC 优先级 → Discord`: - **EPSS** 利用概率 · **CISA KEV** 主动利用 + 勒索软件情况 - **ExploitDB** 和 **GitHub PoC** 漏洞利用可用性 · 源自 NVD 的**补丁**状态 - **CCC 优先级**(0–100)决定颜色和排序;本地 AI 负责撰写风险分析 可插拔的 `enrichment/` 层 —— 增加一个新数据源只需添加一个 client 和在融合引擎中加入一行代码。请参阅 **[docs/phase3.md](docs/phase3.md)**。 ## 路线图 - **Phase 1** — Discord bot 基础 ✅ - **Phase 2** — 自动化 CVE + 新闻威胁情报 ✅ - **Phase 3** — 威胁情报融合引擎(EPSS/KEV/ExploitDB/PoC/priority) ✅ - **Phase 4** — 个性化学习情报(HTB 导入 + `/practiced` 日记 + AI `/recommend`) ✅ - **Phase 5** — RAG 知识库:`/ask` 结合你自己的笔记/writeups/PDFs 并提供引用 ✅ - **Phase 6** — 自托管 SOC Web 仪表板(FastAPI + Chart.js,仅限局域网,对 Postgres 只读) ✅ - **Phase 7** — 多智能体情报团队(Planner→Researcher→Analyst→Coach→Writer → `/report`) ✅ - **Phase 8** — 自动化与行动:实验室资产匹配 → 自动创建工单 + AI 修复清单 → `#announcements` 预警(+ 可选邮件通知) ✅ **全部 8 个阶段已完成** —— 这是一个自托管、AI 驱动的网络安全运营平台:包含自动化威胁情报收集与融合、个人 RAG 大脑、多智能体报告团队、SOC 仪表板和闭环行动。 ## 文档 | 指南 | 内容说明 | |---|---| | **[getting-started.md](docs/getting-started.md)** | 克隆 → Discord bot → 完整平台,分步指南。 | | **[api.md](docs/api.md)** | 全部 22 个斜杠命令 + 仪表板 HTTP API。 | | **[developer-guide.md](docs/developer-guide.md)** | 仓库结构,repository 模式,本地开发,部署。 | | **[plugins.md](docs/plugins.md)** | 添加监控器、情报源或分析工具。 | | **[operations.md](docs/operations.md)** | 健康检查,备份,监控,cron,安全更新。 | | **[security.md](docs/security.md)** | 认证,速率限制,Headers,安全加固,公开访问。 | | **[troubleshooting.md](docs/troubleshooting.md)** | 症状 → 原因 → 修复。 | | **[faq.md](docs/faq.md)** | 常见问题。 | | **各阶段指南** | [1](docs/phase1.md) · [2](docs/phase2.md) · [3](docs/phase3.md) · [4](docs/phase4.md) · [5](docs/phase5.md) · [6](docs/phase6.md) · [7](docs/phase7.md) · [8](docs/phase8.md) — 针对各阶段的深入解析。 |
标签:AI风险缓解, Discord机器人, Docker, 威胁情报, 安全运营, 安全防御评估, 开发者工具, 扫描框架, 搜索引擎查询, 本地大模型, 测试用例, 网络调试, 自动化, 请求拦截, 逆向工具