Skip to main content

Enterprise Server 3.15 目前作为候选发布提供。

Creating a custom security configuration

Build a custom security configuration to meet the specific security needs of repositories in your organization.

谁可以使用此功能?

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

About custom security configurations

With custom security configurations, you can create collections of enablement settings for GitHub's security products to meet the specific security needs of your organization. For example, you can create a different custom security configuration for each group of repositories to reflect their different levels of visibility, risk tolerance, and impact.

When creating a security configuration, keep in mind that:

  • Only features installed by a site administrator on your GitHub Enterprise Server instance will appear in the UI.
  • GitHub Advanced Security features will only be visible if your organization or GitHub Enterprise Server instance holds a GitHub Advanced Security license.
  • Certain features, like Dependabot security updates and code scanning default setup, also require that GitHub Actions is installed on the GitHub Enterprise Server instance.

Creating a custom security configuration

Note

The enablement status of some security features is dependent on other, higher-level security features. For example, disabling 机密扫描警报 will also disable non-provider patterns and push protection.

  1. 在 GitHub 的右上角,选择个人资料照片,然后单击“你的组织”。

  2. 在组织名称下,单击 “设置”****。 如果看不到“设置”选项卡,请选择“”下拉菜单,然后单击“设置”********。

    组织配置文件中选项卡的屏幕截图。 “设置”选项卡以深橙色标出。

  3. 在边栏的“安全性”部分中,选择“代码安全”下拉菜单,然后单击“配置”。

  4. In the "Code security configurations" section, click New configuration.

  5. To help identify your custom security configuration and clarify its purpose on the "Code security configurations" page, name your configuration and create a description.

  6. In the "GitHub Advanced Security features" row, choose whether to include or exclude GitHub Advanced Security (GHAS) features. If you plan to apply a custom security configuration with GHAS features to private repositories, you must have available GHAS licenses for each active unique committer to those repositories, or the features will not be enabled. See "关于 GitHub 高级安全的计费."

  7. In the "Dependency graph and Dependabot" section of the security settings table, choose whether you want to enable, disable, or keep the existing settings for the following security features:

    Note

    You cannot manually change the enablement setting for the dependency graph. This setting is installed and managed by a site administrator at the instance level.

  8. In the "Code scanning" section of the security settings table, choose whether you want to enable, disable, or keep the existing settings for code scanning default setup. To learn about default setup, see "配置代码扫描的默认设置."

  9. In the "Secret scanning" section of the security settings table, choose whether you want to enable, disable, or keep the existing settings for the following security features:

  10. Optionally, in the "Policy" section, you can choose to automatically apply the security configuration to newly created repositories depending on their visibility. Select the None dropdown menu, then click Public, or Private and internal, or All repositories.

    注意: 组织的默认 security configuration 仅自动应用到组织内新创建的存储库。 如果将存储库传输到组织,则仍需将适当的 security configuration 手动应用到存储库。

  11. Optionally, in the "Policy" section, you can enforce the configuration and block repository owners from changing features that are enabled or disabled by the configuration (features that are not set aren't enforced). Next to "Enforce configuration", select Enforce from the dropdown menu.

    Note

    如果组织中的用户尝试使用 REST API 更改强制配置中某个功能的启用状态,则 API 调用将显示为成功,但不会更改任何启用状态。

    在某些情况下,可能会中断存储库的 security configurations 强制实施。 例如,在以下情况下,code scanning 的启用将不适用于存储库:

    • GitHub Actions 最初在存储库上启用,但在存储库中禁用。
    • code scanning 配置所需的 GitHub Actions 在存储库中不可用。
    • 具有标签 code-scanning 的自承载运行器不可用。
    • 不应使用 code scanning 默认设置分析语言的定义已更改。
  12. To finish creating your custom security configuration, click Save configuration.

Next steps

To apply your custom security configuration to repositories in your organization, see "删除自定义安全配置."

若要了解如何编辑 custom security configuration,请参阅“编辑自定义安全配置”。