SuperANUP07/cryptrion-threats
GitHub: SuperANUP07/cryptrion-threats
自动化威胁情报管道,每日从多个公开数据源采集CVE、安全公告和安全新闻,生成结构化报告并自动发布到在线博客。
Stars: 1 | Forks: 0
# 🛡️ Cryptrion Threats — 自动化威胁情报博客
**在线站点:** [cryptrion-threats.vercel.app](https://cryptrion-threats.vercel.app)
**主站:** [cryptrion-cyber.vercel.app](https://cryptrion-cyber.vercel.app)
## 🔍 功能介绍
每天 **08:00 UTC**,GitHub Actions 工作流会自动执行以下操作:
1. **收集** 来自 5 个来源的公开威胁数据
2. **解析** 并将数据结构化为格式化的报告
3. **保存** 报告到本地,格式为 JSON + Markdown 文件
4. **发布** 通过安全的 REST API 将其发布到在线博客
无需任何手动操作——整个 pipeline 完全自动运行。
## 📡 数据来源
| 来源 | 类型 | 数据 |
|--------|------|------|
| [CISA Known Exploited Vulnerabilities](https://www.cisa.gov/known-exploited-vulnerabilities-catalog) | JSON API | 最新被积极利用的 CVE |
| [NIST National Vulnerability Database](https://nvd.nist.gov/) | JSON API | 带有 CVSS 评分的最新 CVE |
| [US-CERT / CISA Advisories](https://www.cisa.gov/cybersecurity-advisories) | RSS | 官方安全公告 |
| [Bleeping Computer](https://www.bleepingcomputer.com/) | RSS | 安全新闻与违规报告 |
| [The Hacker News](https://thehackernews.com/) | RSS | 网络安全新闻与研究 |
所有来源均为**公开可用**——无需 API 密钥或身份验证即可进行收集。
## 🏗️ 项目结构
```
cryptrion-threats/
├── .github/
│ └── workflows/
│ └── threat-collect.yml # GitHub Actions — runs daily at 08:00 UTC
├── threat-intel/
│ ├── collector/
│ │ ├── threat_collector.py # Main collection + report + publish script
│ │ ├── scheduler.py # Optional: run on a local schedule
│ │ └── requirements.txt # Python dependencies
│ └── vercel-site/
│ ├── api/
│ │ ├── posts.js # GET all posts / POST new report
│ │ └── post/
│ │ └── [slug].js # GET single post by slug
│ ├── public/
│ │ └── index.html # Blog frontend (dark cyber theme)
│ ├── package.json
│ └── vercel.json
├── .gitignore
└── README.md
```
## ⚙️ 技术栈
| 层级 | 技术 |
|-------|-----------|
| 自动化 | GitHub Actions (免费套餐) |
| 收集器 | Python 3.11 (`requests`, `feedparser`) |
| 后端 API | Vercel Edge Functions (无服务器) |
| 数据库 | Upstash Redis (免费套餐) |
| 前端 | 原生 HTML/CSS/JS — 无框架 |
| 托管 | Vercel (免费套餐) |
**总成本:$0/月** — 一切均在免费套餐内运行。
## 🚀 设置指南
### 前置条件
- GitHub 账户
- Vercel 账户 (免费)
- Upstash 账户 (免费) — [upstash.com](https://upstash.com)
### 1. Fork / 克隆仓库
```
git clone https://github.com/SuperANUP07/cryptrion-threats.git
cd cryptrion-threats
```
### 2. 部署到 Vercel
1. 前往 [vercel.com/new](https://vercel.com/new) → 导入此仓库
2. 将 **Root Directory** 设置为 `threat-intel/vercel-site`
3. 将 **Output Directory** 设置为 `public`
4. 点击 **Deploy**
### 3. 设置 Upstash Redis (免费数据库)
1. 前往 [upstash.com](https://upstash.com) → 创建账户
2. 创建一个新的 **Redis** 数据库 (免费计划,区域:ap-south-1 适用于印度)
3. 从 REST API 部分复制 `UPSTASH_REDIS_REST_URL` 和 `UPSTASH_REDIS_REST_TOKEN`
### 4. 添加环境变量到 Vercel
在 Vercel → Settings → General → Environment Variables 中,添加:
| 变量 | 值 |
|----------|-------|
| `UPSTASH_REDIS_REST_URL` | 来自 Upstash 仪表板 |
| `UPSTASH_REDIS_REST_TOKEN` | 来自 Upstash 仪表板 |
| `VERCEL_API_SECRET` | 你选择的任意强密码 |
保存后重新部署。
### 5. 添加 GitHub Actions secrets
在 GitHub → Settings → Secrets → Actions 中,添加:
| Secret | 值 |
|--------|-------|
| `VERCEL_API_URL` | `https://cryptrion-threats.vercel.app/api/posts` |
| `VERCEL_API_SECRET` | 与在 Vercel 中设置的相同密码 |
### 6. 触发你的第一次收集
前往 GitHub → **Actions** → **Collect Threat Intelligence** → **Run workflow**
访问 `https://cryptrion-threats.vercel.app` 查看你的第一份报告! 🎉
## 🔁 自动化计划
收集器通过 GitHub Actions 自动运行:
```
schedule:
- cron: '0 8 * * *' # Every day at 08:00 UTC
```
你也可以随时从 **Actions** 标签页手动触发它。
## 🛠️ 本地运行 (可选)
```
cd threat-intel/collector
pip install -r requirements.txt
# 创建 .env 文件
echo "VERCEL_API_URL=https://cryptrion-threats.vercel.app/api/posts" > .env
echo "VERCEL_API_SECRET=your-secret-here" >> .env
# 运行一次
python threat_collector.py
# 按计划运行(每 12 小时)
python scheduler.py --interval 12
```
## 🔒 安全性
- `VERCEL_API_SECRET` 通过 `x-api-secret` 请求头验证所有 POST 请求
- 公众只能**读取**报告——只有 Python 脚本可以发布
- 仓库中不存储任何凭证——所有 secrets 均使用 GitHub Secrets 和 Vercel 环境变量
- 所有数据来源均为只读的公开数据源
## 📊 API 参考
### `GET /api/posts`
返回所有已发布的报告,按日期排序 (最新优先)。
```
[
{
"slug": "threat-report-2026-05-13",
"title": "Threat Intelligence Report — May 13, 2026",
"date": "2026-05-13T08:00:00Z",
"summary": "...",
"total_items": 44,
"severity_counts": { "HIGH": 10, "CRITICAL": 3 }
}
]
```
### `POST /api/posts`
发布新报告。需要 `x-api-secret` 请求头。
### `GET /api/post/:slug`
返回包含完整 Markdown 内容的单个报告。
## 📄 许可证
MIT — 可免费使用、修改和部署。
*构建为 [Cryptrion Cyber](https://cryptrion-cyber.vercel.app) 的一部分 — 一个网络安全作品集项目。*
标签:API集成, CISA通报, CVE漏洞, GitHub Actions, GPT, meg, NVD国家漏洞数据库, OSV, Python, RSS聚合, TCP/IP协议栈, Vercel, 信息安全, 可观测性, 后端开发, 威胁情报, 安全资讯聚合, 实时处理, 密码管理, 开发者工具, 数据可视化, 数据收集与发布, 无后门, 每日安全日报, 漏洞管理, 网络安全平台, 网络安全新闻, 自动化博客, 自动化流水线, 自动笔记, 调试辅助, 逆向工具