AI觉醒星球
Awakening is here
Knowledge File / AI技能杠杆
2026-08-05 0 浏览 会员

规模化自定义代码扫描默认设置

GitHub 新增 github-codeql-config-file 仓库属性,让你无需为每个仓库维护 Workflow,即可通过配置文件在组织范围内自定义代码扫描默认设置,平衡灵活性与低维护。

SOURCE / AI技能杠杆 MIN / 9 ACCESS / 会员 POST / 2026-08-05 03:15:23

原贴

查看原文
作者:Allison 来源站点:github.blog 原贴时间:

原文

You can now apply your own configuration file to code scanning default setup, using the new github-codeql-config-file repository property. This gives you control over how CodeQL scans your code for security vulnerabilities, whether that’s on one repository or across your whole organization. We recommend using this way to customize your security analysis at scale. You get the granular control of advanced setup without writing or maintaining a GitHub Actions workflow file in every repository. Set the github-codeql-config-file repository property to the path of a CodeQL configuration file, and code scanning now merges your settings with its built-in defaults. You can add queries, exclude paths, or set threat models, and still keep default setup’s low-maintenance benefits. Any threat models and CodeQL model packs you picked in the default setup user interface are kept in the merged configuration. Repository properties support organization-wide default values, and organization owners decide whether individual repositories are allowed to override it. So you can keep one configuration file in a central repository and have every repository automatically pick it up, enforce it everywhere, or let teams tailor it where they need to. You can also try a value out on one repository before rolling it out. For more information, see customizing default setup with a configuration file . There’s a new, more flexible syntax for pointing at a configuration file that lives in another repository. Only the repository name is required. If you leave out the ref and the file path, the reference falls back to a default configuration file path on the main branch of a repository in the same organization as the one being analyzed. For more information, see how to reference a configuration file in another repository . If that repository is private, you can now grant default setup access to it by configuring a Git Source private registry for your organization, instead of managing a token in a workflow. For more information, see giving your organization access to private registries . This is now generally available on github.com and will ship with GitHub Enterprise Server 3.23. To get started, see repository properties for code scanning .

中文翻译

您现在可以使用新的 github-codeql-config-file 仓库属性,将您自己的配置文件应用于代码扫描默认设置。这使您能够控制 CodeQL 扫描代码以查找安全漏洞的方式,无论是在单个仓库还是整个组织中。我们建议使用这种方式大规模自定义您的安全分析。您可以获得高级设置的细粒度控制,而无需在每个仓库中编写或维护 GitHub Actions 工作流文件。将 github-codeql-config-file 仓库属性设置为 CodeQL 配置文件的路径后,代码扫描会将您的设置与其内置默认值合并。您可以添加查询、排除路径或设置威胁模型,同时仍然保留默认设置的低维护优势。您在默认设置用户界面中选择的任何威胁模型和 CodeQL 模型包都会保留在合并后的配置中。仓库属性支持组织范围的默认值,组织所有者决定是否允许个别仓库覆盖它。因此,您可以将一个配置文件保存在中央仓库中,并让每个仓库自动采用它,在各地强制执行,或者让团队在需要的地方进行定制。您还可以在一个仓库上尝试一个值,然后再推广。更多信息,请参阅使用配置文件自定义默认设置。有一种新的、更灵活的语法用于指向位于另一个仓库中的配置文件。只需要仓库名称。如果您省略 ref 和文件路径,引用将回退到与被分析仓库同一组织中某个仓库的主分支上的默认配置文件路径。更多信息,请参阅如何引用另一个仓库中的配置文件。如果该仓库是私有的,您现在可以通过为您的组织配置 Git Source 私有注册表来授予默认设置访问权限,而不是在工作流中管理令牌。更多信息,请参阅为您的组织提供对私有注册表的访问权限。此功能现已普遍在 github.com 上提供,并将随 GitHub Enterprise Server 3.23 一起发布。要开始使用,请参阅代码扫描的仓库属性。

核心信息

GitHub 新增 github-codeql-config-file 仓库属性,让你无需为每个仓库维护 Workflow,即可通过配置文件在组织范围内自定义代码扫描默认设置,平衡灵活性与低维护。

  • GitHub 新增 github-codeql-config-file 仓库属性,让你无需为每个仓库维护 Workflow,即可通过配置文件在组织范围内自定义代码扫描默认设置,平衡灵活性与低维护。
  • 原贴提到:You can now apply your own configuration file to code scanning default s
  • 来源:github.blog
试看内容

成为会员查看完整内容

你已经看到了这篇内容的前置整理,剩余深度部分仅对会员开放。

详细解读 信息差价值 参考来源
成为会员查看完整内容
上一篇 英国就业市场分裂加速:AI需求激增,知识工作招聘骤降 下一篇 从零开始,教你用Codex搓出属于你自己的第一个硬件