ryoshu404/gorelate
GitHub: ryoshu404/gorelate
一个用 Go 编写的威胁情报管道,实现 IOC 自动采集、跨源关联评分、YARA 规则生成和 LLM 驱动的威胁摘要。
Stars: 0 | Forks: 0
# gorelate
一个用 Go 编写的威胁情报管道。Gorelate 获取公开的 IOC 源,对指标进行标准化和去重,跨来源关联以进行置信度评分,根据高置信度 IOC 生成 YARA 检测存根,并利用 LLM 驱动的新兴威胁模式分类摘要。
~~上线地址 **[iocs.ryoshu404.com](https://iocs.ryoshu404.com)**~~ 待完成后上线
## 功能
- 每小时定时从 AlienVault OTX、URLHaus 和 abuse.ch 获取 IOC 源
- 将指标标准化为通用模式,并根据指标值进行去重
- 基于来源关联进行置信度评分:1 个来源 → 低,2 个 → 中,3 个 → 高
- 使用 VirusTotal 数据(免费层级)丰富高置信度 IOC
- 为高置信度指标生成 YARA 检测存根
- 通过 Anthropic API 按每 8 小时和每天的 schedule 生成 LLM 驱动的分析师摘要
- 暴露完全只读的 REST API,无需认证即可公开访问
## 架构
```
Schedule trigger (Go ticker — hourly)
→ Run all fetchers (OTX, URLHaus, abuse.ch)
→ Normalize and dedup
→ Correlate and score
→ VT enrichment if HIGH confidence
→ Check if 8-hour or daily summary is due
→ Yes: generate cycle summary, cache to DB
→ No: skip, continue
→ Check if HIGH confidence IOCs crossed stub threshold
→ Yes: generate YARA stubs
→ Sleep until next cycle
API layer (independent, read-only from DB)
```
## API
只读。无需认证。无写入端点。
```
GET /ioc/{indicator} → clean summary response
GET /ioc/{indicator}/full → complete record including raw feed data
GET /ioc/{indicator}/sources → sources array and per-source metadata
GET /ioc/{indicator}/confidence → confidence tier
GET /iocs?q=&type=&confidence=&tag= → filtered bulk query
GET /summaries → paginated list of cycle summaries
GET /summaries/latest → most recent per type (emerging, daily)
GET /summaries/{id} → specific summary by ID
GET /health → service health check
```
**示例响应 (`GET /ioc/{indicator}`):**
```
{
"indicator": "evil.com",
"type": "domain",
"confidence": "high",
"sources": ["otx", "abuse.ch", "urlhaus"],
"tags": ["phishing", "c2"],
"threat_category": "phishing",
"first_seen": "2026-03-01T00:00:00Z",
"last_seen": "2026-03-28T08:00:00Z",
"vt_enriched": true,
"detection_stubs": true,
"llm_summary_available": false
}
```
## 项目结构
```
gorelate/
├── cmd/gorelate/ # entrypoint
├── internal/
│ ├── fetchers/ # one fetcher per feed (OTX, URLHaus, abuse.ch)
│ ├── pipeline/ # orchestrator — wires fetchers through the full cycle
│ ├── correlator/ # dedup and source merge across feeds
│ ├── scorer/ # confidence tier assignment
│ ├── enrichment/ # VirusTotal enrichment (HIGH confidence only)
│ ├── scheduler/ # ticker + wall clock summary triggers
│ ├── store/ # PostgreSQL — models, interface, schema
│ ├── api/ # read-only HTTP API
│ ├── stubs/ # YARA stub generation
│ └── summarizer/ # LLM triage summary via Anthropic API
├── frontend/ # single-file HTML/CSS/JS dashboard
├── deploy/ # Cloudflare Tunnel config example
├── scripts/ # retention cleanup
├── Dockerfile
├── docker-compose.yml
└── .env.example
```
## 数据来源
| 源 | 作用 |
|---|---|
| AlienVault OTX | 核心 — 置信度评分 |
| URLHaus | 核心 — 置信度评分 |
| abuse.ch | 核心 — 置信度评分 |
| VirusTotal | 仅丰富 — 高置信度 IOC |
URLHaus 和 abuse.ch 共享一个运营者,有时会报告相同的指标 —— 这验证了关联性而非虚增。
## 置信度评分
| 报告来源数 | 置信度 |
|---|---|
| 1 | 低 |
| 2 | 中 |
| 3 | 高 |
VirusTotal 在高置信度下丰富记录,但不影响层级。高是上限。
## 调度器
```
Ingestion cycle → every 1 hour
8-hour summary → 06:00, 14:00, 22:00 UTC
Daily summary → 12:00 UTC
```
如果每日摘要在过去一小时内已触发,则跳过 8 小时调用。如果窗口内不存在高置信度 IOC,则跳过 LLM 调用并记录周期。
## 本地运行
```
cp .env.example .env
# 填写 API keys
docker compose up --build
```
API 地址:`http://localhost:8080`。
## 部署
Docker 化,运行在家用服务器上,通过 Cloudflare Tunnel 暴露。请参阅 `deploy/cloudflare-tunnel.yml.example` 获取隧道配置参考。
## 许可证
Commons Clause + Apache 2.0。可免费使用和修改。禁止商业转售。
## 相关项目
- [statica](https://github.com/ryoshu404/statica) — 静态分析管道
- [macollect](https://github.com/ryoshu404/macollect) — macOS DFIR 取证工件收集器
标签:AMSI绕过, Anthropic API, Ask搜索, DNS 反向解析, EVTX分析, Golang, HTTP/HTTPS抓包, IOC 关联, IP 地址批量处理, LLM 安全, PE 加载器, REST API, SIEM 辅助, URLHaus, VirusTotal, YARA 规则, 威胁情报, 威胁检测, 安全编程, 开发者工具, 态势感知, 情报管道, 指标提取, 日志审计, 测试用例, 网络安全, 置信度评分, 请求拦截, 隐私保护