跳到正文
Skillpedia
智能体35k · #7878

detecting-supply-chain-attacks-in-ci-cd

它能做什么

这个工具可以检查你的代码自动化系统(CI/CD)中的安全漏洞,这些漏洞可能被用来攻击你的软件供应链。它会查找不安全的操作、代码注入以及敏感信息泄露等问题。

适用场景

  • ✓当你在调查可能的供应链攻击时。
  • ✓当你在搭建或加强自动化流程的安全性时。
  • ✓当你想确认安全监控工具是否覆盖了已知风险时。

技能链接

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/detecting-supply-chain-attacks-in-ci-cd/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/detecting-supply-chain-attacks-in-ci-cd/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“扫描我的GitHub Actions工作流,查找供应链安全风险。”

每周 5 个新技能,1 分钟读完。

工作原理

工具会分析你自动化系统的配置文件,查找有风险的写法,比如使用未锁定版本的代码,或者可能被注入恶意命令的地方。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Detecting Supply Chain Attacks in CI/CD

When to Use

  • When investigating security incidents that require detecting supply chain attacks in ci cd
  • When building detection rules or threat hunting queries for this domain
  • When SOC analysts need structured procedures for this analysis type
  • When validating security monitoring coverage for related attack techniques

Prerequisites

  • Familiarity with security operations concepts and tools
  • Access to a test or lab environment for safe execution
  • Python 3.8+ with required dependencies installed
  • Appropriate authorization for any testing activities

Instructions

Scan CI/CD workflow files for supply chain risks by parsing GitHub Actions YAML, checking for unpinned dependencies, script injection vectors, and secrets exposure.

import yaml
from pathlib import Path

for wf in Path(".github/workflows").glob("*.yml"):
    with open(wf) as f:
        workflow = yaml.safe_load(f)
    for job_name, job in workflow.get("jobs", {}).items():
        for step in job.get("steps", []):
            uses = step.get("uses", "")
            if uses and "@" in uses and not uses.split("@")[1].startswith("sha"):
                print(f"Unpinned action: {uses} in {wf.name}")

Key supply chain risks:

  1. Unpinned GitHub Actions (using @main instead of SHA)
  2. Script injection via ${{ github.event }} expressions
  3. Overly permissive GITHUB_TOKEN permissions
  4. Third-party actions with write access to repo
  5. Dependency confusion via public/private package name collision

Examples

# Check for script injection in run steps
for step in job.get("steps", []):
    run_cmd = step.get("run", "")
    if "${{" in run_cmd and "github.event" in run_cmd:
        print(f"Script injection risk: {run_cmd[:80]}")
常见问题

什么是软件供应链攻击?

这是一种攻击方式:攻击者先入侵你在开发中使用的某个正规组件(比如某个工具或代码库),再借此感染你的软件或系统。

'unpinned actions'是什么意思?

意思是在使用某个操作(一段小型自动化脚本)时,没有指定确切的版本号。这样做有风险,因为该操作可能在你不知情的情况下被更新,夹带恶意代码。

什么是'依赖混淆'(dependency confusion)?

这是一种攻击技巧:攻击者会创建一个与公司内部软件包同名的恶意包,并把它发布到公共仓库中。如果配置不当,你的系统可能会下载这个恶意版本,而不是正确的内部包。

详情

作者的原始描述

Scans GitHub Actions workflows and CI/CD pipeline configurations for supply chain attack vectors including unpinned actions, script injection via expressions, dependency confusion, and secrets exposure. Uses PyGithub and YAML parsing for automated audit. Use when hardening CI/CD pipelines or investigating compromised build systems. '

repo: mukul975/Anthropic-Cybersecurity-Skills

热度

GitHub 星标
35k
排名
#7878
许可证
Apache-2.0
更新时间
2026/8/31

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能