觉
AI觉醒星球
Awakening is here
Knowledge File / AI技能杠杆
2026-08-05 4 浏览 免费阅读

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

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

详细解读

信号:GitHub 将代码扫描默认设置的配置能力提升到组织级规模,新增的仓库属性使配置文件可以像“策略模板”一样被集中管理和分发,这是一个从“单仓库自定义”到“组织级治理”的范式转变。

为什么重要:以往,自定义 CodeQL 扫描要么在默认设置中做有限调整,要么为每个仓库编写独立的 Actions workflow,这在大规模组织内既繁琐又难以统一。新功能让你在保留默认设置零维护优势的同时,通过配置文件注入查询、排除路径和威胁模型,且支持组织级默认值覆盖规则,这意味着安全团队可以一次配置、全局生效,同时保留单独调整的灵活性。

对谁有价值:对 GitHub 组织管理员和安全负责人最有价值,他们可以强制或默认应用统一的安全扫描策略;对开发团队则减少了重复性工作,避免在每个仓库中复制配置;对于使用多个仓库的企业,这是降低安全债务和运营成本的关键改进。

可以怎么行动:首先,在中心仓库创建 CodeQL 配置文件,利用新语法引用该文件;其次,在组织设置中配置 github-codeql-config-file 属性的默认值,并决定是否允许仓库覆盖;最后,小范围试点一个仓库,验证配置合并效果后再全组织推广。对于引用私有仓库配置文件的情况,需配置 Git Source 私有注册表,避免使用 token。

风险或限制:配置文件合并逻辑需仔细理解,内置默认值可能会覆盖部分配置;跨仓库引用依赖仓库名称,若仓库被重命名需同步更新;该功能在 GitHub Enterprise Server 3.23 中才可用,升级前需规划;此外,组织所有者设置的默认值可能被仓库覆盖,若未明确策略可能导致配置漂移。

信息差价值

这条内容的真正价值,不只是“有人发布了一个新功能”,而是它揭示了 github.blog 背后的产品方向、工作流变化或竞争信号。对 OPC 来说,这种信息可以转化成持续追踪的栏目选题。

如果把《规模化自定义代码扫描默认设置》放到你的内容系统里,它最大的价值在于帮助读者更快看懂“为什么值得关注”,而不是只看到一条碎片化动态。

参考来源

AI SUMMARY

这篇文章回答了什么

规模化自定义代码扫描默认设置主要讲什么?

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专题相关?

它适合放在Agent工作流、AI工具、AI超级个体专题里阅读。 关联原因:这篇内容命中「Agent、工作流」等主题信号。;这篇内容命中「自动化」等主题信号。;这篇内容命中「技能」等主题信号。

阅读这篇文章建议先理解哪些关键词?

建议先理解AI工具、工具、自动化、模型、Cursor这些关键词,再结合正文判断工具、机会或风险是否值得进入自己的工作流。

上一篇 英国就业市场分裂加速:AI需求激增,知识工作招聘骤降 下一篇 从零开始,教你用Codex搓出属于你自己的第一个硬件