Skip to content

pale-knight/redteam-skill / skills/cicd

CI/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.

references/dependency-supply-chain.md

View on GitHub
# Dependency / Package Supply Chain

> 目标:证明目标构建/开发环境会解析并执行攻击者控制的依赖。优先使用 benign marker/OOB,避免一开始就做 destructive package。

---

## 1. 先画 Resolver

```text
manifest / lockfile
↓
private registry / proxy / public registry
↓
name + version + scope/namespace
↓
install/build hook
```

搜索:

```bash
find . -maxdepth 4 -type f \( -name 'package.json' -o -name 'requirements*.txt' -o -name 'pyproject.toml' -o -name 'Gemfile' -o -name '*.csproj' -o -name 'NuGet.config' -o -name 'Cargo.toml' -o -name 'go.mod' -o -name '.npmrc' -o -name 'pip.conf' \) -print
```

---

## 2. Dependency Confusion

覆盖:

```text
npm
PyPI
RubyGems
NuGet
crates.io
```

确认三件事:

```text
内部包名在公共源是否可注册?
resolver是否会同时访问公共源?
version/source priority是否会选攻击者版本?
```

### 安全验证包

发布测试包只做 OOB/marker,例如安装时请求唯一 DNS/HTTP 标识,不执行 shell。

**成功判断:** OOB 请求来自目标 CI/build 环境,并能映射到目标 project/job;开发者自己安装测试包不算目标 pipeline compromise。

---

## 3. Go 不套用简单“公共registry同名高版本”模型

Go module 更应检查:

```text
module path / vanity import path
GOPROXY / GOPRIVATE / GONOSUMDB
直接VCS dependency
repo rename/delete / namespace takeover
replace directive
unversioned branch/ref
```

如果攻击点来自 Git/VCS/repository ownership,它更接近 repo-jacking/module-path trust,不要套 npm/PyPI 同名包结论。

---

## 4. Typosquatting / Namespace Confusion

重点不是“名字像”,而是**目标构建是否真的引用**:

```text
misspelling
scope omission
case/normalization difference
registry namespace mapping
internal mirror fallback
```

先通过 lockfile/build log/registry request 证明 resolver 行为。

---

## 5. Package Install Hooks

高价值 hook:

```text
npm preinstall/install/postinstall
Python build backend/setup/build hooks
Ruby gem extensions
NuGet/MSBuild targets
Rust build.rs
```

只有在目标 pipeline 会执行 hook 时才构成代码执行;纯下载但不执行只算供应链控制能力。

---

## 6. Package/Registry Credential

查:

```text
.npmrc / NODE_AUTH_TOKEN
.pypirc / TWINE_*
NuGet.Config
Cargo credentials
GitLab Deploy Token
GitHub Packages token
Artifactory/Nexus/JFrog credential
```

获得 publish 权限后继续验证**目标消费者是否自动拉取该包/版本**,不能把“能发布”直接等于“能RCE”。
writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deploymentStars: 322kUpdated Claude CodeCodexVerifiedInstall
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: 198kUpdated Claude CodeCodexVerifiedInstall
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: 119kUpdated Claude CodeCodexVerifiedInstall
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: 118kUpdated Claude CodeCodexVerifiedInstall