dsh-ci-guard
安全与治理 活跃维护

dsh-ci-guard

feely0208/dsh-ci-guard

扫 GitHub Actions 工作流,找出可被利用的配置 —— 供应链攻击的主要入口

0
Stars 标星
0
Forks 分支
0
Watchers 关注
0
Open Issues
Shell
主要语言
MIT
开源协议
640 KB
仓库大小
1 个月前
最后推送
一键安装扩展 / 插件指令
dsh plugin --profile web add github:feely0208/dsh-ci-guard
git clone https://github.com/feely0208/dsh-ci-guard.git
git clone git@github.com:feely0208/dsh-ci-guard.git
README.md main

@deepwhale-cn/dsh-ci-guard

dshfind 收录

Listed on dsh-plugin.org

CI 安全:GitHub Actions 工作流是供应链攻击的主要入口 —— 这里查可被利用的配置(脚本注入、权限过宽、未锁的 action)。

关键词:CI 安全 · GitHub Actions 安全 · 工作流安全 · 脚本注入 · 权限过宽 · 供应链风险 · 流水线安全
Keywords: CI security · GitHub Actions security · script injection · workflow security · pull_request_target
CI 工作流安全 —— 扫 GitHub Actions,找出可被外部利用的配置。

不装它会怎样

你的 workflow 里写着 uses: some-action@main。

某天那个 action 的作者账号被盗,攻击者推了一行代码 ——
下一次 CI 运行就是在他的控制下执行的,而你有 secrets。

锁成完整 commit SHA 就能防住这一类。这个检查跑一次几秒钟。

它查什么

级别 内容
🔴 高 Action 未锁版本 · permissions: write-all · echo secrets · 脚本注入
🟡 中 pull_request_target(需人工判断)
🟢 低 未声明 permissions

安装

dsh plugin --profile web add @deepwhale-cn/dsh-ci-guard
# 或纯 CLI
npx @deepwhale-cn/dsh-ci-guard

用法

dsh-ci-guard                 # 扫当前目录
dsh-ci-guard --demo          # 看检出效果
dsh-ci-guard --list-rules    # 列出规则和依据
dsh-ci-guard --html r.html   # HTML 报告

dsh-ci-guard 检查报告示例

dsh-ci-guard 演示模式输出

dsh-ci-guard 规则与依据

判据来源

每条规则都指向具体文档:
GitHub Docs《Security hardening for GitHub Actions》· GitHub Security Lab
《Preventing pwn requests》《Script injections in GitHub Actions》。

边界

  • 正则匹配 YAML,不是真解析 —— 写法奇特(锚点、多文档)可能漏。
  • 只覆盖 GitHub Actions;GitLab CI / Jenkins 不在范围内。
  • pull_request_target 单独出现不一定危险,需要人工判断。

本插件是一个工具。使用者必须遵守所在地区法律法规,对使用本项目造成的任何后果自行承担责任。


深鲸网安守护系列(共 38 个)

一个插件做一件事。安全问题是链式的 —— 配套用才完整。

国内合规(12)| 等保对照 · 日志留存 · 备案公示 · 用户同意 · 个人信息权利 · 未成年人保护 · 影响评估 · 数据分类分级 · 算法备案 · 数据出境 · 国密合规 · AI 内容标识

AI 与 Agent 治理(6)| AI 输出信任 · 外部内容信任 · MCP 安全 · Agent 权限 · 策略核对 · 可疑指令

数据与凭据(5)| 敏感数据 · 密钥轮换 · 数据留存 · 配置审计 · 密钥扫描

供应链与构建(5)| 开源许可 · 依赖投毒 · CI 安全 · 工具审查 · 物料清单

权限与应急(3)| 最小权限 · 告警外发 · 应急证据包

行业专项(4)| 医疗行业专项 · 教育行业专项 · 金融行业专项 · 地方数据条例

编排与交付(3)| 一键体检 · 改前改后复核 · 合规可交付文档

都在 DSH 插件市场(dsh-plugin.org)、npm 和 deepwhale.org.cn/guard.html 上。


powered by dwh