{"schema_version":"1.0","service":"Publicasta","type":"article","id":347,"slug":"snowflake_github_actions_red_agent_cicd_secrets","title":"Snowflake 的 GitHub Actions 教训：公开 issue 何时会变成 CI/CD 输入","excerpt":"Wiz Red Agent 案例并不说明 Snowflake 客户遭到入侵。它提醒团队：公开仓库事件、YAML 自动化和长期内部令牌都应按生产级风险治理。","language":"zh","default_language":"en","canonical_url":"https://publicasta.com/cybersecurity/snowflake_github_actions_red_agent_cicd_secrets?lang=zh","image":{"url":"https://publicasta.com/storage/projects/9/pages/347/2026/08/2ecdf05a-81f4-48bc-a6c8-c253ba05059a.webp","alt":"中性示意图：公开 GitHub issue 进入 CI 工作流，并指向被锁定的内部 Jira 令牌"},"publisher":{"id":9,"slug":"cybersecurity","name":"Cybersecurity Without Panic","url":"https://publicasta.com/cybersecurity"},"author":{"name":"Anton R"},"published_at":"2026-08-18T07:10:49+00:00","updated_at":"2026-08-18T07:10:49+00:00","content_markdown":"Wiz 与 Snowflake 的这起案例，不应被理解为新的客户数据泄露，也不该被包装成“AI 编程工具必然危险”。真正有用的结论更具体：公开 GitHub issue 可以成为企业自动化的输入；如果这个输入被直接拼进 GitHub Actions 的 shell 命令，它就不再只是文本。Wiz Research 称，其自主安全工具 Red Agent 在公开仓库 `snowflakedb/snowflake-connector-net` 中发现 workflow injection，通过构造 issue 触发 runner 回连，并获得了 Jira API token。Snowflake 随后修复 workflow、轮换 token；公开材料显示，没有证据表明存在授权研究之外的未授权访问。\n\n ![中性示意图：公开 GitHub issue 进入 CI 工作流，并指向被锁定的内部 Jira 令牌](https://publicasta.com/storage/projects/9/pages/347/2026/08/2ecdf05a-81f4-48bc-a6c8-c253ba05059a.webp)\n\n ## 发生了什么\n\n 起点是很常见的自动化：公开仓库用 GitHub Actions 把 GitHub issues 同内部 Jira 流程连接起来。很多团队都会这样做，用于创建工单、同步状态、通知 Slack 或更新队列。风险在于 workflow 把外部用户可控的文本当成可信输入。issue 标题、正文、分支名、pull request 标题、评论，都可能来自不受信任的人。\n\n Wiz 表示，Red Agent 在 `.github/workflows/jira_issue.yml` 中发现脚本注入。该 workflow 由 `issues: opened` 触发，并把 issue title 直接插入 shell `run:` block。第一次尝试导致 bash 语法错误，之后 agent 调整方式，获得来自 GitHub Actions runner 的外部回连，其中包含编码后的凭据。Wiz 称，该 Jira token 以 `qa@snowflake.net` 身份访问 Snowflake 的 Atlassian tenant，可读取工程、安全合规和 bug bounty tracking 项目。\n\n 时间线很关键。相关变更在 2026 年 6 月 18 日通过 PR #1218 合并。Wiz 称 Red Agent 于 6 月 23 日发现、验证并报告问题；修复 PR #1402 当天合并，token 于 6 月 24 日轮换。Wiz 于 8 月 17 日公开文章，The Hacker News 于 8 月 18 日报道，并提醒读者注意范围：没有发现受影响的 Snowflake Connector for .NET 发布版本，没有公开 CVE 或 CISA KEV，也没有公开证据显示客户受损。\n\n ## 为什么现在重要\n\n 这件事同时触及两条趋势。AI code assistants 已进入日常开发，自动安全审查也越来越常见。与此同时，自主安全 agent 能读取公开仓库、识别已知漏洞类型、尝试路径、观察失败并调整。它不会让每个 agent 变成超级攻击者，但会缩短从错误合并到可验证利用的时间。\n\n 成熟的应对不是禁止 Copilot，也不是盲目信任自动审查。凡是触及 `.github/workflows`、部署脚本、云凭据、Jira token、release 签名和包发布的变更，都应视为安全敏感代码。bot 留下的“通过”评论不是完整的安全证明。\n\n ## workflow injection 的核心\n\n 外部数据只有在保持为数据时才安全。公开 issue title 存在 GitHub 中时只是文本；如果 workflow 把它直接展开到 shell 命令中，它就可能改变命令含义。安全做法是把不可信值放入环境变量，正确引用，把它们作为数据传给工具，并用 `jq --arg` 等结构化方式构造 JSON。GitHub 自己也提醒过，issue title、branch name 等 contexts 不应直接出现在 `run:` 中。\n\n 这不是 Snowflake 或 Jira 独有的问题。任何把公开元数据、shell 执行和 secrets 混在一起的 CI/CD YAML 都可能出现同类风险。文章不需要展示真实 payload；防御者只需记住：公开事件触发的 workflow，如果能访问 secrets，那么事件中的每个字段都应默认不可信。\n\n ## 公开仓库也是攻击面\n\n 公开仓库不仅是代码展示和社区入口，也可能是自动化入口。新 issue、评论、label、分支名都可能触发 workflow，而 workflow 可能持有 Jira、Slack、包仓库、云平台或发布系统的 token。`issues: opened` 因此不是普通通知，而是从互联网进入企业流程的输入路径。\n\n 即使是只读 token 也不应被轻视。Jira 中可能包含漏洞状态、triage 讨论、内部用户名、合规信息、产品路线和其他系统线索。对真正攻击者来说，这些读取权限可能成为后续钓鱼、横向移动或漏洞串联的地图。\n\n ## AI 在故事中的位置\n\n AI 角度是真实的，但必须准确。Wiz 最初强调该问题与 Copilot-assisted PR 以及 Red Agent 有关，之后补充说明：Copilot 是合并 PR 中的 co-author/checker，并将其标为通过，但公开证据不能证明脆弱代码行由 Copilot 编写。因此负责任的结论不是“Copilot 写出了漏洞”，而是“AI 辅助和自动审查没有阻止一个已知 CI/CD 漏洞类型”。\n\n Red Agent 则说明另一面：授权的自主安全工具可以快速发现并验证旧漏洞类型。防守方应假设公开自动化会被更快、更持续地检查。\n\n ## 不是客户泄露，但仍然严肃\n\n 公开资料没有显示 Snowflake 客户数据遭入侵。THN 称问题局限于仓库 CI/CD 自动化，未发现受影响的 connector release。Wiz 称 Snowflake 通过审计日志确认，在暴露窗口中 Wiz 是唯一行为方，token 也已轮换。\n\n 这限定了范围，却不削弱教训。CI/CD secret 暴露即使由授权研究人员发现、并且快速修复，也值得认真处理。内部 Jira 读取权限可能泄露工程和安全情报。\n\n ## 今天该做什么\n\n 盘点所有 workflow，特别是由 `issues`、`issue_comment`、`pull_request`、`pull_request_target`、`discussion` 或手动输入触发的 workflow。记录它们能访问哪些 secrets、调用哪些系统、在哪类 runner 上运行。搜索 `run:` 中是否直接展开 `${{ github.event.issue.title }}`、issue body、branch name、PR title 或 comment。\n\n 减少权限。显式设置 `permissions`。不要让公开事件触发的 workflow 获得生产相关 secrets。优先使用 OIDC、短期凭据和范围很小的服务账号。把高权限步骤放到 maintainer approval 或中间 broker 之后。对 `.github/workflows/**`、release scripts 和部署脚本要求 code-owner review，并保留足够日志用于关联 token 使用与 workflow run。\n\n 最终结论很冷静：AI 不会替代 AppSec 基础，而会加速攻防两侧。CI/CD YAML 是带 secrets 的生产代码。公开 issues 是用户输入。输入需要边界，secrets 需要范围，自动化需要明确 owner。","available_translations":[{"language":"ar","title":"درس Snowflake في GitHub Actions: عندما تصبح issue عامة مدخلاً إلى CI/CD","html_url":"https://publicasta.com/cybersecurity/snowflake_github_actions_red_agent_cicd_secrets?lang=ar","markdown_url":"https://publicasta.com/cybersecurity/snowflake_github_actions_red_agent_cicd_secrets.md?lang=ar","json_url":"https://publicasta.com/cybersecurity/snowflake_github_actions_red_agent_cicd_secrets.json?lang=ar","api_url":"https://publicasta.com/api/public/v1/channels/cybersecurity/articles/snowflake_github_actions_red_agent_cicd_secrets?lang=ar"},{"language":"de","title":"Snowflakes GitHub-Actions-Lektion: Wenn ein öffentliches Issue zu CI/CD-Eingabe wird","html_url":"https://publicasta.com/cybersecurity/snowflake_github_actions_red_agent_cicd_secrets?lang=de","markdown_url":"https://publicasta.com/cybersecurity/snowflake_github_actions_red_agent_cicd_secrets.md?lang=de","json_url":"https://publicasta.com/cybersecurity/snowflake_github_actions_red_agent_cicd_secrets.json?lang=de","api_url":"https://publicasta.com/api/public/v1/channels/cybersecurity/articles/snowflake_github_actions_red_agent_cicd_secrets?lang=de"},{"language":"en","title":"Snowflake’s GitHub Actions lesson: when a public issue becomes CI/CD input","html_url":"https://publicasta.com/cybersecurity/snowflake_github_actions_red_agent_cicd_secrets?lang=en","markdown_url":"https://publicasta.com/cybersecurity/snowflake_github_actions_red_agent_cicd_secrets.md?lang=en","json_url":"https://publicasta.com/cybersecurity/snowflake_github_actions_red_agent_cicd_secrets.json?lang=en","api_url":"https://publicasta.com/api/public/v1/channels/cybersecurity/articles/snowflake_github_actions_red_agent_cicd_secrets?lang=en"},{"language":"es","title":"La lección de Snowflake sobre GitHub Actions: cuando un issue público entra en CI/CD","html_url":"https://publicasta.com/cybersecurity/snowflake_github_actions_red_agent_cicd_secrets?lang=es","markdown_url":"https://publicasta.com/cybersecurity/snowflake_github_actions_red_agent_cicd_secrets.md?lang=es","json_url":"https://publicasta.com/cybersecurity/snowflake_github_actions_red_agent_cicd_secrets.json?lang=es","api_url":"https://publicasta.com/api/public/v1/channels/cybersecurity/articles/snowflake_github_actions_red_agent_cicd_secrets?lang=es"},{"language":"fr","title":"La leçon Snowflake sur GitHub Actions : quand une issue publique entre dans le CI/CD","html_url":"https://publicasta.com/cybersecurity/snowflake_github_actions_red_agent_cicd_secrets?lang=fr","markdown_url":"https://publicasta.com/cybersecurity/snowflake_github_actions_red_agent_cicd_secrets.md?lang=fr","json_url":"https://publicasta.com/cybersecurity/snowflake_github_actions_red_agent_cicd_secrets.json?lang=fr","api_url":"https://publicasta.com/api/public/v1/channels/cybersecurity/articles/snowflake_github_actions_red_agent_cicd_secrets?lang=fr"},{"language":"pl","title":"Lekcja Snowflake o GitHub Actions: gdy publiczne zgłoszenie staje się wejściem CI/CD","html_url":"https://publicasta.com/cybersecurity/snowflake_github_actions_red_agent_cicd_secrets?lang=pl","markdown_url":"https://publicasta.com/cybersecurity/snowflake_github_actions_red_agent_cicd_secrets.md?lang=pl","json_url":"https://publicasta.com/cybersecurity/snowflake_github_actions_red_agent_cicd_secrets.json?lang=pl","api_url":"https://publicasta.com/api/public/v1/channels/cybersecurity/articles/snowflake_github_actions_red_agent_cicd_secrets?lang=pl"},{"language":"ru","title":"Урок Snowflake о GitHub Actions: когда публичный issue становится входом в CI/CD","html_url":"https://publicasta.com/cybersecurity/snowflake_github_actions_red_agent_cicd_secrets?lang=ru","markdown_url":"https://publicasta.com/cybersecurity/snowflake_github_actions_red_agent_cicd_secrets.md?lang=ru","json_url":"https://publicasta.com/cybersecurity/snowflake_github_actions_red_agent_cicd_secrets.json?lang=ru","api_url":"https://publicasta.com/api/public/v1/channels/cybersecurity/articles/snowflake_github_actions_red_agent_cicd_secrets?lang=ru"},{"language":"zh","title":"Snowflake 的 GitHub Actions 教训：公开 issue 何时会变成 CI/CD 输入","html_url":"https://publicasta.com/cybersecurity/snowflake_github_actions_red_agent_cicd_secrets?lang=zh","markdown_url":"https://publicasta.com/cybersecurity/snowflake_github_actions_red_agent_cicd_secrets.md?lang=zh","json_url":"https://publicasta.com/cybersecurity/snowflake_github_actions_red_agent_cicd_secrets.json?lang=zh","api_url":"https://publicasta.com/api/public/v1/channels/cybersecurity/articles/snowflake_github_actions_red_agent_cicd_secrets?lang=zh"}],"_links":{"self":"https://publicasta.com/cybersecurity/snowflake_github_actions_red_agent_cicd_secrets.json?lang=zh","api":"https://publicasta.com/api/public/v1/channels/cybersecurity/articles/snowflake_github_actions_red_agent_cicd_secrets?lang=zh","html":"https://publicasta.com/cybersecurity/snowflake_github_actions_red_agent_cicd_secrets?lang=zh","canonical":"https://publicasta.com/cybersecurity/snowflake_github_actions_red_agent_cicd_secrets?lang=zh","markdown":"https://publicasta.com/cybersecurity/snowflake_github_actions_red_agent_cicd_secrets.md?lang=zh","json":"https://publicasta.com/cybersecurity/snowflake_github_actions_red_agent_cicd_secrets.json?lang=zh","channel":"https://publicasta.com/api/public/v1/channels/cybersecurity","channel_articles":"https://publicasta.com/api/public/v1/channels/cybersecurity/articles","search":"https://publicasta.com/api/public/v1/search","documentation":"https://publicasta.com/api-docs#reading-publicasta","openapi":"https://publicasta.com/api-docs/openapi.json","llms":"https://publicasta.com/llms.txt"}}