Skip to main content

此版本的 GitHub Enterprise Server 已于以下日期停止服务 2026-06-02. 即使针对重大安全问题,也不会发布补丁。 为了获得更好的性能、更高的安全性和新功能,请升级到最新版本的 GitHub Enterprise。 如需升级帮助,请联系 GitHub Enterprise 支持

Enabling delegated bypass for push protection

Control who can push code containing secrets by requiring bypass approval from designated reviewers.

谁可以使用此功能?

具有管理员角色的存储库所有者、组织所有者、安全管理员和用户

Delegated bypass for push protection lets you define who can push commits containing secrets and adds an approval process for other contributors. See 推送保护授权绕过.

To enable delegated bypass, create the teams or roles that will manage bypass requests. Alternatively, use fine-grained permissions for more granular control. See Using fine-grained permissions to control who can review and manage bypass requests.

Enabling delegated bypass for a repository

注意

如果组织或企业所有者在组织或企业级别配置委派绕过,则会禁用存储库级设置。

  1. 在 GitHub 上,导航到存储库的主页面。

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

    存储库标头的屏幕截图,其中显示了选项卡。 “设置”选项卡以深橙色边框突出显示。

  3. 在边栏的“Security”部分中,单击“ Code security and analysis”****。

  1. 在“Code security and analysis”下,查找“GitHub Advanced Security”。

  2. 在“推送保护”右侧的“谁可以绕过推送保护 secret scanning”,选择下拉菜单,然后单击 “特定角色或团队”。

  3. 在“Bypass list”下,单击“Add role or team”****。

  4. 在对话框中,选择要添加到绕过列表的角色和团队,然后单击“添加选定项”。

    注意

    不能将机密团队添加到旁路列表。

Enabling delegated bypass for an organization

  1. 在 GitHub 上,导航到组织的主页面。

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

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

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

  4. 创建新的自定义安全配置,或编辑现有的配置。 请参阅“删除自定义安全配置”。

  5. 定义自定义安全配置时,在“Secret scanning”下,确保 ”警报“和”推送保护“的下拉菜单设置为 ”已启用”。

  6. 在“Push protection”下的“Bypass privileges”右侧,选择下拉菜单,然后单击“Specific actors”。****

  7. 选择 “选择执行组件”下拉菜单,然后选择要添加到旁路列表的执行组件。

    注意

  8. Click Save configuration.

  9. Apply the security configuration to repositories in your organization. See 删除自定义安全配置.

Using fine-grained permissions to control who can review and manage bypass requests

You can grant specific individuals or teams in your organization the ability to review and manage bypass requests using fine-grained permissions.

  1. Ensure that delegated bypass is enabled for the organization. For more information, follow steps 1-3 in Enabling delegated bypass for your organization and ensure you have saved and applied the security configuration to your selected repositories.
  2. Create (or edit) a custom organization role. For information on creating and editing custom roles, see 管理自定义组织角色.
  3. When choosing which permissions to add to the custom role, select the "Review and manage secret scanning bypass requests" permission.
  4. Assign the custom role to individual members or teams in your organization. For more information on assigning custom roles, see 使用组织角色.