Skip to main content

配置大规模代码扫描的默认设置

可以使用默认设置为整个组织的存储库快速配置 code scanning。

谁可以使用此功能?

具有管理员角色的组织所有者、安全管理员和组织成员

Code scanning 可用于以下存储库类型:

  • GitHub.com 上的公共存储库
  • GitHub Team、GitHub Enterprise Cloud 或 GitHub Enterprise Server 上的组织拥有的存储库,已启用 GitHub Advanced Security

With default setup for code scanning, you can quickly secure code in repositories across your organization. For more information, see About setup types for code scanning.

For repositories that are not suitable for default setup, you can configure advanced setup at the repository level, or at the organization level using a script.

Prerequisites

A repository must meet all the following criteria to be eligible for default setup:

  • Advanced setup for code scanning is not already enabled.
  • GitHub Actions is enabled.
  • GitHub Advanced Security is enabled.

Configuring default setup for all eligible repositories in an organization

You can enable default setup for all eligible repositories in your organization. For more information, see About enabling security features at scale.

Extending CodeQL coverage in default setup

Through your organization's security settings page, you can extend coverage in default setup using model packs for all eligible repositories in your organization. For more information, see Editing your configuration of default setup.

Configuring default setup for a subset of repositories in an organization

You can filter for specific repositories you would like to configure default setup for. For more information, see Applying a custom security configuration.

Configuring merge protection for all repositories in an organization

You can use rulesets to prevent pull requests from being merged when one of the following conditions is met:

  • A required tool finds a code scanning alert of a severity that is defined in the ruleset.
  • A required tool's analysis is still in progress.
  • A required tool is not configured for the repository.

For more information, see Set code scanning merge protection. For more general information about rulesets, see About rulesets.