Skip to main content

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”部分中,单击“ Advanced Security”****。

  4. 在“Secret Protection”下,确保为存储库启用推送保护。

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

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

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

    注意

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

  8. (可选)若要完全免除执行组件推送保护,请在执行组件的详细信息右侧选择 ,然后单击“ 豁免”。

    警告

    推送保护豁免旨在实现受信任的自动化,这些自动化需要以最少的摩擦推送许多提交。 豁免可能导致机密泄露,应谨慎给予。

Enabling delegated bypass for an organization

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

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

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

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

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

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

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

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

    注意

  8. (可选)若要完全免除执行组件推送保护,请在执行组件的详细信息右侧选择 ,然后单击“ 豁免”。

    警告

    推送保护豁免旨在实现受信任的自动化,这些自动化需要以最少的摩擦推送许多提交。 豁免可能导致机密泄露,应谨慎给予。

  9. Click Save configuration.

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

Enabling delegated bypass for an enterprise

  1. 在 GitHub Enterprise Server 的右上角,单击你的个人资料头像,然后单击“Enterprise settings”****。

  2. 在页面顶部,单击“ 设置”。

  3. 在左边栏,单击“ Advanced Security Code security”****。

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

  5. 创建新的自定义安全配置,或编辑现有的配置。 请参阅“为企业创建自定义安全配置”。

  6. 机密扫描 中,确保已启用 推送保护

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

    注意

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

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

  9. (可选)若要完全免除执行组件推送保护,请在执行组件的详细信息右侧选择 ,然后单击“ 豁免”。

    警告

    推送保护豁免旨在实现受信任的自动化,这些自动化需要以最少的摩擦推送许多提交。 豁免可能导致机密泄露,应谨慎给予。

  10. Click Save configuration.

  11. Apply the security configuration to organizations and repositories in your enterprise. 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 使用组织角色.