soham7998/MITRE_Incident_Mapper
GitHub: soham7998/MITRE_Incident_Mapper
将安全日志自动映射为 MITRE ATT&CK 事件时间线的交互式工具,帮助 SOC 分析师和事件响应人员快速完成攻击行为归类与可视化分析。
Stars: 0 | Forks: 0
# MITRE Incident Mapper
上传安全日志或连接您的 SIEM,即可在几秒钟内获得完整的 MITRE ATT&CK 映射事件时间线。专为需要快速响应的 SOC 分析师和事件响应人员打造。
**在线演示:** https://mitre-incident-mapper.vercel.app
**集成:** https://mitre-incident-mapper.vercel.app/integrations
**API 文档:** https://mitre-incident-mapper.vercel.app/docs
## 我们构建了什么
| 功能 | 位置 | 详情 |
|---------|-------|---------|
| **文件上传** | 主页 | 上传 `.csv`、`.json`、`.txt`、`.log` 文件 — 最大支持 15 MB |
| **粘贴日志事件** | 主页 | 直接粘贴原始 syslog、CEF 或纯文本 — 无需文件 |
| **CloudTrail 自动检测** | 主页 | 上传 CloudTrail `.json` 文件 — 自动解析 `Records[]` 格式 |
| **Splunk 连接器** | /integrations | 使用 Bearer token + SPL 查询您的 Splunk search head,即时分析结果 |
| **Elasticsearch 连接器** | /integrations | 通过 API key 或 basic auth 搜索任何 ES/OpenSearch 索引 |
| **AWS CloudTrail 连接器** | /integrations | 粘贴或上传 CloudTrail JSON,解析事件名称、用户身份、源 IP |
| **原始日志粘贴** | /integrations | 粘贴 syslog、ArcSight CEF 或自由格式文本 — 自动检测 CEF |
| **ATT&CK 热力图** | 结果视图 | 跨越所有 12 个 MITRE 战术的自动生成杀伤链覆盖网格,包含技术 ID 和事件计数 |
| **事件时间线** | 结果视图 | 每个日志事件及其 MITRE 映射和置信度分数 (0–100) |
| **技术列表** | 结果视图 | 按战术分类的去重技术 |
| **PDF 导出** | 结果视图 | 合规就绪的事件报告 |
| **JSON / CSV 导出** | 结果视图 | 用于自动化或 Excel 的机器可读输出 |
| **API** | /docs | 完整的 REST API — 所有端点均附带 curl 示例进行文档说明 |
## 技术栈
**前端** — 部署在 Vercel
Next.js 14 (App Router)、TypeScript、Tailwind CSS、Lucide React
**后端** — 部署在 Railway
Python 3.11、Flask、Flask-CORS、Gunicorn、ReportLab (PDF)、Requests
## 项目结构
```
MITRE_Incident_Mapper/
├── backend/
│ ├── app.py # Flask API — all routes + integration connectors
│ ├── src/
│ │ ├── mitre_mapper.py # 120+ pattern MITRE ATT&CK mapping engine
│ │ └── timeline_builder.py # Timeline ordering + PDF generation
│ ├── data/sample_logs/ # Sample CSV for testing
│ ├── requirements.txt
│ ├── Procfile
│ └── railway.json
│
└── frontend/
├── src/app/
│ ├── page.tsx # Main upload / paste / results UI
│ ├── integrations/ # Splunk, Elastic, CloudTrail, raw paste connectors
│ └── docs/ # API reference
├── package.json
└── vercel.json
```
## 本地运行
**后端**
```
cd backend
python -m venv venv && source venv/bin/activate
pip install -r requirements.txt
python app.py
# http://localhost:5000
```
**前端**
```
cd frontend
npm install
cp .env.example .env.local
# set NEXT_PUBLIC_API_URL=http://localhost:5000
npm run dev
# http://localhost:3000
```
使用 `backend/data/sample_logs/incident_1.csv` 进行测试。
## API
完整参考文档请访问 https://mitre-incident-mapper.vercel.app/docs
```
POST /api/analyze upload log file → incident analysis
POST /api/integrations/splunk query Splunk REST API
POST /api/integrations/elastic query Elasticsearch / OpenSearch
POST /api/integrations/cloudtrail analyze CloudTrail Records[] JSON
POST /api/integrations/raw analyze pasted syslog / CEF / text
GET /api/incident/:id fetch a stored result
GET /api/download/:id/:format export as pdf | json | csv
GET /api/health liveness check
```
## 部署您自己的实例
**后端 → Railway**
1. 新建项目 → 从 GitHub 部署,根目录设为 `backend/`
2. 在 Settings → Networking 下生成一个公共域
**前端 → Vercel**
1. 导入代码库,根目录设为 `frontend/`
2. 添加环境变量:`NEXT_PUBLIC_API_URL=https://your-railway-url.up.railway.app`
由 **Happy Incident** 的 **Soham Shah** 构建
[LinkedIn](https://linkedin.com/in/shahsoham2003) · [GitHub](https://github.com/soham7998/MITRE_Incident_Mapper)
标签:Cloudflare, CloudTrail解析, CTF与红蓝对抗, Elasticsearch集成, MITRE ATT&CK, OISF, PDF报告生成, REST API, SIEM集成, SOC分析工具, Splunk集成, Tailwind CSS, TypeScript, Vercel部署, 事件时间线, 可视化热力图, 安全事件响应, 安全合规, 安全插件, 日志管理, 网络代理, 网络安全, 网络测绘, 自动化分类, 自动化攻击, 逆向工具, 隐私保护