Skills

Cicd Pipeline Attack

CI/CD 流水线与供应链攻击方法论。当发现目标使用 GitHub Actions/Jenkins/GitLab CI/CircleCI/Terraform...

Install

npx skills add wgpsec/AboutSecurity --skill cicd-pipeline-attack -g -a claude-code -y
Repository
wgpsec/AboutSecurity1.8k
Category
DevOps
Updated
11d ago
License
See repository
Context cost
Mediumabout 2,302 tokens
Runs scripts
No, instructions only

What it does

CI/CD 流水线与供应链攻击方法论。当发现目标使用 GitHub Actions/Jenkins/GitLab CI/CircleCI/Terraform Cloud/Atlantis 等 CI/CD 系统、需要测试流水线安全性、或发现 .github/workflows/Jenkinsfile/.gitlab-ci.yml 等配置文件时使用。覆盖 PPE(Poisoned Pipeline Execution)三种攻击模式(D-PPE/I-PPE/3PE)、VCS 代码仓库攻击面(代码泄露/Webhook 滥用/分支保护绕过)、Pipeline Secrets 窃取与横向移动、以及从 CI/CD 到云环境的穿越路径

CI/CD 流水线与供应链攻击方法论

CI/CD 系统是现代软件工程的核心基础设施, , 它们拥有代码仓库的读写权限、持有云平台的部署凭据、能够直接修改生产环境。一旦攻陷流水线,攻击者可以同时获得代码控制权、Secrets 访问权和云环境穿透能力,其影响范围远超单台服务器的沦陷。

本技能以决策树形式组织 CI/CD 攻击方法论。各平台的详细技术手法请参阅对应的参考文档。

深入参考

识别到具体平台后,加载对应参考文档获取完整攻击技术细节:

Phase 0: CI/CD 系统识别

在目标代码仓库或基础设施中发现以下标识文件时,可确定对应的 CI/CD 平台:

标识文件/特征CI/CD 平台下一步
.github/workflows/*.ymlGitHub Actions→ Phase 2 PPE + 参考 github-actions-abuse.md
Jenkinsfile 或 /script 控制台Jenkins→ Phase 4 Jenkins 专项 + 参考 platform-specific.md
.gitlab-ci.ymlGitLab CI→ Phase 2 PPE + 参考 platform-specific.md
.circleci/config.ymlCircleCI→ Phase 2 PPE + 参考 platform-specific.md
azure-pipelines.ymlAzure DevOps→ Phase 2 PPE + 服务连接 Secret 提取
.drone.ymlDrone CI→ Phase 2 PPE + Self-hosted Runner 检查
.buildkite/*.ymlBuildkite→ Phase 2 PPE + Agent 云/K8s 权限检查
atlantis.yaml + WebhookAtlantis→ Phase 4 Atlantis 专项
*.tf + Terraform CloudTerraform Cloud→ Phase 4 Terraform 专项
serverless.ymlServerless Framework→ 参考 platform-specific.md
docker-compose.yml + CI 触发Docker Build→ 检查构建上下文泄露
Airflow DAGs / Concourse pipelineAirflow / Concourse→ 参考 platform-specific.md

快速识别技巧:

  • 克隆仓库后搜索配置文件:查找 Jenkinsfile、.github/workflows、.gitlab-ci.yml、.circleci、atlantis.yaml
  • 检查 Webhook 配置:Webhook URL 暴露 CI/CD 服务类型和内网地址
  • 枚举 CI/CD 服务端口:Jenkins 默认 8080,Atlantis 默认 4141;GitLab Runner 为主动轮询,默认不监听入站端口(仅开启 metrics 时监听 9252)

Phase 1: VCS 攻击面

在进入流水线攻击之前,VCS(版本控制系统)本身就是重要的攻击面。

1.1 代码泄露

Read the whole SKILL.md on GitHub

More in DevOps