CI/CD 攻击 (CI/CD Attacks)
CI/CD 流水线 (Pipelines) 通常由不受信任的操作触发,例如公开 Git 仓库的分叉拉取请求 (forked PR) 和新提交的问题 (issues)。这些系统通常包含敏感密钥或在特权环境中运行。攻击者可以通过提交经过精心设计的 Payload 来触发流水线,从而在这些系统中获得远程代码执行 (RCE)。此类漏洞也被称为污染流水线执行 (Poisoned Pipeline Execution, PPE)。
目录 (Summary)
- 工具 (Tools)
- CI/CD 产品 (CI/CD Products)
- 硬编码密钥枚举 (Hardcoded Secrets Enumeration)
- 包管理器与构建文件 (Package Managers and Build Files)
- 参考资料 (References)
工具 (Tools)
- praetorian-inc/gato - GitHub 自托管运行器 (Self-Hosted Runner) 枚举与攻击工具。
- AdnaneKhan/Gato-X - Gato (Github Attack TOolkit) 的分支版本 —— 极致版。
- messypoutine/gravy-overflow - 一个 GitHub Actions 供应链 CTF / Goat 练习场。
- xforcered/SCMKit - 源码管理 (SCM) 攻击工具包。
- synacktiv/octoscan - Octoscan 是针对 GitHub Actions 工作流的静态漏洞扫描器。
- synacktiv/gh-hijack-runner - 一个用于创建虚假 GitHub 运行器并劫持流水线作业以泄露 CI/CD 密钥的 Python 脚本。
- synacktiv/nord-stream - 列出 CI/CD 环境中存储的密钥,并通过部署恶意流水线来提取它们。
- praetorian-inc/glato - GitLab 攻击工具包 (GitLab Attack TOolkit)。
参考资料 (References)
- Poisoned Pipeline Execution
- DEF CON 25 - Exploiting Continuous Integration (CI) and Automated Build systems - spaceB0x - 2 nov. 2017
- Controlling the Source: Abusing Source Code Management Systems - Brett Hawkins - August 9, 2022
- Fixing Typos and Breaching Microsoft’s Perimeter - John Stawinski IV - April 15, 2024