Newshot

面向开发者和智能体的按需密钥扫描

AI summary

无论你是自己编写代码,还是与 AI 智能体协作,密钥扫描都应当跟上你构建软件的方式。Copilot 的安全审查专家现已运行 GitHub 密钥扫描,让开发者和智能体在代码变更合并前发现其中的密钥;该功能可在 Copilot CLI 和 Copilot 应用会话中、通过 Copilot SDK 集成以及在 Copilot 代码审查中以公开预览形式使用。启用后,它会在基于 LLM 的审查之外同时运行 GitHub 的密钥扫描检测器:可识别 GitHub 目录中 500 多种密钥类型(由 150 多家行业合作伙伴通过密钥扫描合作伙伴计划共同构建),并借助 GitHub 微调的密钥检测模型读取周边代码,识别格式不明显的凭据,包括密码和连接字符串中的凭据。

Translation(model translation, not the source's own text)

Secret scanning 应当跟上你构建软件的方式,无论你是自己编写代码,还是与 AI agent 协作。Copilot 的 security-review 专员现在会运行 GitHub secret scanning,因此开发者和 agent 可以在代码变更合并前发现其中的 secret。

你可以在 Copilot CLI 和 Copilot app 会话中使用该公开预览版,通过 Copilot SDK 集成使用,也可以在 Copilot code review 中使用。

新增内容

Copilot security review 已在其基于 LLM 的审查中查找暴露的 secret。选择启用后,它还会在分析的同时运行 GitHub 的 secret scanning 检测器。

  • Provider patterns:从 GitHub 不断扩充的目录中检测 500 多种 secret 类型,该目录由 150+ 行业合作伙伴通过 secret scanning partner program 共同构建。
  • GitHub 用于 secret 检测的微调模型:并非每种凭证都有可识别的格式。该模型会读取周边代码来识别可能的 secret,包括连接字符串中的密码和凭证。

该审查会检查你的变更中是否存在 secret。它不会搜索仓库历史。

工作流中的 secret scanning

  • 在工作过程中审查变更。在 Copilot CLI 和 Copilot app 中,让你的编码 agent 运行 security-review 专员。根据其发现进行修复并请求再次审查,或自行对你的变更或 agent 的工作运行 /security-review。
  • 将检查内置到你自己的 agent 中。借助 Copilot SDK,你的 agent 可以在返回变更前请求安全审查,而无需维护单独的 secret 检测器。
  • 在拉取请求审查期间捕获 secret。Copilot code review 可以标记新增行中的 secret,包括开发期间未检查的变更,以便作者和审查者在合并前处理它们。

启用 secret scanning

secret scanning 默认关闭。在你选择启用之前,security review 仅使用其现有的基于 LLM 的检测。

工具启用 secret scanning运行扫描
Copilot CLI在交互式会话中,运行 /settings aiSecretDetection on .通过 task 工具( agent_type: "security-review" )委托给 security-review,或手动运行 /security-review。
Copilot app在 Settings > Experimental 中,开启 AI secret detection 。通过 task 委托给 security-review,或手动运行 /security-review。
Copilot SDK 集成创建会话时,将 SECURITY_REVIEW_FINE_TUNED_MODEL 功能标志设为 true 。从会话 agent 委托,或使用 agentType: "security-review" 调用 session.rpc.tasks.startAgent 。
Copilot code review在仓库的 Settings > Copilot > Code review 中,在 Security 下开启 Secret scanning 。在拉取请求上请求 Copilot 审查,或设置自动审查。

可用性与计费

在上述工具中,如果你目前可以使用 Copilot security review 或 Copilot code review,你就可以使用 secret scanning。无需额外计划。扫描会消耗 Secret Protection AI Credit SKU 下的 AI credits。

了解更多并分享反馈

了解有关 secret

The translation is machine-generated and individual terms may be off. Nothing is rewritten or cut; the original is authoritative.

Published by GitHub Changelog
This site only summarises and aggregates; copyright stays with the original author. Headlines and summaries follow the source — where they differ, the original wins.
Read the original ↗