gerardvincelillo/guard-intent
GitHub: gerardvincelillo/guard-intent
面向 SOC 工作流的 CLI 安全自动化工具,提供日志分诊、IOC 匹配、威胁检测和结构化事件报告生成能力。
Stars: 0 | Forks: 0
# GuardIntent
GuardIntent 是一个用于 SOC 风格工作流的 CLI 安全自动化和分诊框架。它能够摄取日志、关联 IOC 情报、运行规则检测、对事件进行评分、丰富调查结果并导出事件报告。
## 已实现功能
- 日志解析与标准化
- 输入:JSONL, JSON, CSV
- 统一的身份验证/网络/进程/DNS 事件 schema
- IOC 引擎
- 输入:TXT, JSON
- IOC 类型:IP, domain, URL, SHA-256
- 验证与去重
- 包含 MITRE ATT&CK 映射的检测规则
- `ioc_match`
- `brute_force`
- `privileged_abnormal`
- `rare_process`
- `lateral_movement`
- 插件规则系统
- 使用 `--plugin path/to/plugin.py` 加载自定义规则
- 示例插件:`plugins/sample_custom_rule.py`
- 评分与分诊
- 严重等级:low, medium, high, critical
- 基于图的事件分组,支持时间窗口关联
- 报告生成
- Markdown, JSON, HTML 仪表板
- 报告漂移分析
- 对比基线/当前 JSON 报告并标记回归
- 可选的富化/导出集成
- VirusTotal 富化(`--enrich-vt`,需要 API key)
- Webhook 导出(`--webhook-url`)
- Jira issue 创建(`--jira-*`)
- 针对外部集成的重试/退避和速率限制处理
- 交付工具
- Dockerfile
- GitHub Actions CI workflow
## 项目结构
```
GuardIntent/
|-- guard_intent/
| |-- cli.py
| |-- config.py
| |-- models.py
| |-- scoring.py
| |-- normalize/
| |-- iocs/
| |-- rules/
| |-- plugins/
| |-- enrichment/
| |-- integrations/
| `-- reporting/
|-- plugins/
| `-- sample_custom_rule.py
|-- data/
|-- reports/
|-- tests/
|-- .github/workflows/ci.yml
|-- Dockerfile
|-- config.yaml
|-- plan.md
`-- pyproject.toml
```
## 安装
```
python -m venv .venv
# Windows
.venv\Scripts\activate
# Linux/macOS
source .venv/bin/activate
python -m pip install -U pip
python -m pip install -e .
python -m pip install pytest
```
## CLI 用法
### 完整扫描
```
guardintent scan \
--logs data/sample_logs.jsonl \
--iocs data/sample_iocs.txt \
--out reports \
--format md,json,html \
--min-severity medium \
--config config.yaml \
--verbose
```
### 使用插件规则扫描
```
guardintent scan \
--logs data/sample_logs.jsonl \
--iocs data/sample_iocs.txt \
--plugin plugins/sample_custom_rule.py \
--format json,html \
--out reports
```
### 使用富化/导出集成扫描
```
guardintent scan \
--logs data/sample_logs.jsonl \
--iocs data/sample_iocs.txt \
--enrich-vt \
--vt-api-key \
--webhook-url https://example.com/hook \
--jira-url https://your-org.atlassian.net \
--jira-user you@example.com \
--jira-token \
--jira-project-key SEC
```
### 其他命令
```
guardintent parse --logs data/sample_logs.jsonl --out data/normalized_logs.jsonl
guardintent iocs --iocs data/sample_iocs.txt
guardintent rules --list
guardintent rules --show brute_force
guardintent compare --baseline reports/old.json --current reports/new.json --out reports/diff.json
```
## 规则插件接口
插件模块必须暴露一个 `RULES` 变量,其中包含继承自 `BaseRule` 的规则类。
```
RULES = [MyCustomRule]
```
## 严重等级映射
- `0-24`: low
- `25-49`: medium
- `50-74`: high
- `75+`: critical
## 测试
```
python -m pytest -q
```
## Docker
```
docker build -t guardintent:latest .
docker run --rm guardintent:latest --help
```
## CI
位于 `.github/workflows/ci.yml` 的 GitHub Actions workflow 会在 Python 3.10、3.11 和 3.12 上运行测试。
## 当前缺口 / 下一步改进
- 添加针对外部 ATT&CK 数据集的 ATT&CK tactic-to-technique 验证。
- 为反复出现的集成故障增加熔断器(circuit-breaker)行为。
- 通过特定来源的图权重和置信度分数提高分组精度。
- 为完整的 Markdown/HTML 报告渲染添加快照测试。
- 针对大型日志文件和高基数 IOC 集添加基准测试。
## 文档
- `docs/README.md`:仓库文档索引
- `docs/implementation_checklist.md`
- `docs/project_vision.md`
- `docs/stack_inventory.md`
标签:AMSI绕过, Ask搜索, Cloudflare, Cython安全, DAST, DevSecOps, Docker容器, EDR辅助, FTP漏洞扫描, IOC匹配, IR工具, Jira集成, JSONL解析, MITRE ATT&CK, PE 加载器, PoC, Python, SOC工具, VirusTotal, Webhook集成, 上游代理, 事件关联, 云计算, 入侵指标, 基线漂移, 威胁情报, 威胁检测, 安全报告, 安全编排, 富化分析, 开发者工具, 开源框架, 异常检测, 恶意软件分析, 持续集成, 插件系统, 攻击面发现, 无后门, 日志分类, 时序数据库, 暴力破解, 权限提升检测, 横向移动, 漏洞发现, 编程规范, 规则引擎, 请求拦截, 逆向工具, 风险评分