TwinSentry 是一个基于 Flask + SQLAlchemy 的安全告警分析处置平台。
902
TwinSentry 是一个基于 Flask + SQLAlchemy 的安全告警分析处置平台,支持 告警接入 → 分析智能体 → 处置智能体 → 审计追踪 的完整闭环,并提供可视化仪表盘、系统配置、技能包下载与 API 文档。
告警接入(Webhook)
/api/webhook/receiver 接收外部系统告警(SIEM / EDR / 自定义系统)text 为行级结构化内容双阶段 Agent 工作流
/analysis/fetch、/analysis/submit/disposition/fetch、/disposition/submitX-Agent-Key 鉴权SKIP LOCKED)避免并发抢同一任务告警管理
is_delete=1),默认列表隐藏已删除告警仪表盘分析
系统设置
审计监控
Skills Center
TWINSENTRY_BASE_URLANALYSIS_AGENT_KEYDISPOSITION_AGENT_KEY用户与认证
python -m venv .venv
source .venv/Scripts/activate
pip install -r requirements.txt
cp .env.example .env
至少确认以下配置:
DATABASE_URLSECRET_KEYJWT_SECRET_KEYpython run.py
默认监听:http://127.0.0.1:5000(或 0.0.0.0:5000)
docker compose up --build
应用首次启动会自动执行初始化:
默认管理员:
adminadmin@123建议上线前立即修改默认密码。
/login 登录页/ 仪表盘/alerts 告警管理/settings 系统设置/audit 审计监控/profile 个人中心/api-docs-page API 文档页/skills-page Skill 中心POST /api/auth/loginPOST /api/auth/logoutGET/PUT /api/auth/profilePOST /api/auth/avatarPOST /api/webhook/receiverGET /api/alertsDELETE /api/alerts/<alert_id>GET /analysis/fetchPOST /analysis/submitGET /disposition/fetchPOST /disposition/submitGET /api/stats/dashboardGET /api/audit/logsGET /api/audit/statsGET/PUT /api/settings/systemGET/PUT /api/settings/notificationsPOST /api/settings/notifications/testGET /api-docsGET /api/skills/configGET /api/skills/downloadGET /api/statusGET /api/healthAuthorization: Bearer <token>X-Agent-Key: <agent_key>{
"title": "[严重] 恶意进程执行告警",
"text": "主机名: WS-01\n进程名: mimikatz.exe\n用户: SYSTEM"
}
python -m flask --app run.py routes
python -m flask --app run.py shell
python -m pytest
TwinSentry/
├─ app/
│ ├─ routes/ # 业务路由(auth/main/agents/webhook/settings/audit/docs)
│ ├─ services/ # 工具与调度服务
│ ├─ templates/ # 页面模板
│ └─ static/ # 静态资源(css/js/images/uploads)
├─ skills/TwinSentry/ # Skills 包及脚本模板
├─ run.py # 应用入口
├─ config.py # 配置加载
└─ requirements.txt
date_trunc 与 skip_locked).envContent type
Image
Digest
sha256:5b0b716b3…
Size
69.6 MB
Last updated
6 months ago
docker pull hescc/twinsentry