hai2daril/Threat-intelligence-

GitHub: hai2daril/Threat-intelligence-

一个基于GitHub Actions的自动化威胁情报报告生成与邮件推送管道,聚合37个安全情报源并利用AI生成摘要报告。

Stars: 0 | Forks: 0

# CTI 自动化报告 Pipeline 汇集 30 多个来源生成深色主题的 HTML 威胁情报报告, 并通过 GitHub Actions 每 3 小时将其发送到您的邮箱。 ## 文件 ``` ├── generate_report.py # Main pipeline script ├── requirements.txt # Python dependencies ├── .github/ │ └── workflows/ │ └── cti_report.yml # GitHub Actions schedule └── README.md ``` ## 逐步设置指南 ### 步骤 1 — 创建 GitHub Repository 1. 前往 https://github.com/new 2. 将其命名为类似 `cti-report-pipeline` 的名称 3. 将其设置为 **Private**(您的 API key 将作为 secret 存储在此处) 4. 点击 **Create repository** ### 步骤 2 — 上传文件 选项 A — GitHub Web UI(最简单): 1. 在您的新 repo 中,点击 **Add file → Upload files** 2. 上传 `generate_report.py` 和 `requirements.txt` 3. 创建文件夹 `.github/workflows/`,并将 `cti_report.yml` 上传到其中 选项 B — Git CLI: ``` git clone https://github.com/YOUR_USERNAME/cti-report-pipeline.git cd cti-report-pipeline # 将这三个文件复制到此文件夹中,然后: mkdir -p .github/workflows # (将 cti_report.yml 移动到 .github/workflows/) git add . git commit -m "Initial CTI pipeline setup" git push origin main ``` ### 步骤 3 — 获取您的 API Key **A) Anthropic API Key** 1. 前往 https://console.anthropic.com/settings/keys 2. 点击 **Create Key** 3. 复制该 key — 以 `sk-ant-...` 开头 4. 如果您还没有添加账单额度,请前往添加 (https://console.anthropic.com/settings/billing) - 每份报告大约消耗价值 $0.05–$0.15 的 API 额度 - 每天 8 份报告 × 平均 $0.10 = 约 $0.80/天 **B) Gmail App Password**(不是您的常规 Gmail 密码) 1. 前往您的 Google Account → https://myaccount.google.com/security 2. 如果尚未开启,请启用 **2-Step Verification** 3. 前往 https://myaccount.google.com/apppasswords 4. App name: `CTI Pipeline`,Device: `Other` 5. 点击 **Generate** — 复制 16 个字符的密码(例如 `abcd efgh ijkl mnop`) 6. 存储时请去除空格:`abcdefghijklmnop` ### 步骤 4 — 添加 GitHub Secrets 1. 在您的 GitHub repo 中,前往 **Settings → Secrets and variables → Actions** 2. 为以下每一项点击 **New repository secret**: | Secret 名称 | 值 | |-------------------|------------------------------------| | `ANTHROPIC_API_KEY` | `sk-ant-api03-...` (您的 key) | | `GMAIL_USER` | `youraddress@gmail.com` | | `GMAIL_APP_PASS` | `abcdefghijklmnop` (App password) | | `RECIPIENT_EMAIL` | `hai2daril@gmail.com` | ### 步骤 5 — 启用 GitHub Actions 1. 在您的 repo 中,点击 **Actions** 标签 2. 如果出现提示,请点击 **I understand my workflows, go ahead and enable them** 3. 您应该会在左侧边栏中看到 **CTI Daily Report — Every 3 Hours** ### 步骤 6 — 手动测试 在等待 3 小时之前,现在先运行一次: 1. 前往 **Actions → CTI Daily Report — Every 3 Hours** 2. 点击 **Run workflow → Run workflow**(绿色按钮) 3. 实时查看运行情况 — 大约需要 3–5 分钟 4. 检查您的 hai2daril@gmail.com 收件箱 ### 步骤 7 — 验证时间表 cron `0 */3 * * *` 每天在以下 UTC 时间触发: - 00:00, 03:00, 06:00, 09:00, 12:00, 15:00, 18:00, 21:00 GitHub Actions 在高峰负载期间可能会延迟最多 15 分钟 — 这是正常现象。 ## 抓取的情报来源 ### RSS Feeds(30 个来源) - The Hacker News, Krebs on Security, Dark Reading, Bleeping Computer - Recorded Future, Kaspersky Securelist, SANS Internet Storm Center - Talos Intelligence, Unit42 (Palo Alto), Microsoft MSRC - CISA Advisories + US-CERT NCAS - IBM X-Force Exchange, Mandiant Threat Intel, Google Project Zero - Check Point Research, Symantec Threat Intel, Malwarebytes Labs - CrowdStrike, SentinelOne, ESET WeLiveSecurity, SOCRadar - Security Week, CyberScoop, Help Net Security, Threat Post - Rapid7, Tenable, Qualys ### 抓取页面(7 个来源) - Ransomware.live(受害者追踪器) - BreachSense(泄露数据库) - Dark Web Informer - BleepingComputer Ransomware 标签 - Flashpoint Intel Blog - Intel471 Blog - Digital Shadows / ReliaQuest Blog ## 成本估算 (GitHub Actions) GitHub Actions 免费额度:**每月 2,000 分钟** 每次运行大约需要 3–5 分钟。 每天 8 次运行 × 30 天 = 240 次运行 × 平均 4 分钟 = **每月 960 分钟** 对于 private repo,您将完全在免费额度范围内。 ## 故障排除 **没有收到电子邮件?** - 检查 Gmail 垃圾邮件文件夹 - 确认 App Password 没有包含空格 - 确认您的 Google 账号已启用 2FA **在 API 调用时运行失败?** - 检查 ANTHROPIC_API_KEY secret 设置是否正确 - 在 console.anthropic.com 验证账单状态是否处于活跃状态 **某些 feed 返回空值?** - 正常现象 — 某些网站会间歇性地阻止自动化请求 - 该 pipeline 具有弹性,将使用可用的来源继续运行 **想要添加来源?** - 在 `generate_report.py` 中向 `RSS_FEEDS` 字典添加一个 RSS URL - 或者向 `SCRAPE_URLS` 添加一个 clearnet URL - 提交并 push — 下次运行时会自动获取
标签:DLL 劫持, GitHub Actions, Python, 大语言模型, 威胁情报, 开发者工具, 无后门, 自动化报告, 自动笔记, 逆向工具