Skip to main content

Configuring secret scanning for your appliance

You can enable, configure, and disable secret scanning for 你的 GitHub Enterprise Server 实例. Secret scanning allows users to scan code for accidentally committed secrets.

谁可以使用此功能?

Secret scanning is available for organization-owned repositories, and in beta for user-owned repositories in GitHub Enterprise Server if your enterprise has a license for GitHub Advanced Security. For more information, see "About secret scanning" and "About GitHub Advanced Security."

About secret scanning

If someone checks a secret with a known pattern into a repository, secret scanning catches the secret as it's checked in, and helps you mitigate the impact of the leak. Repository administrators are notified about any commit that contains a secret, and they can quickly view all detected secrets in the Security tab for the repository. For more information, see "关于机密扫描."

Checking whether your license includes GitHub Advanced Security

可通过查看企业设置来识别企业是否具有 GitHub Advanced Security 许可证。 有关详细信息,请参阅“Enabling GitHub Advanced Security for your enterprise”。

Prerequisites for secret scanning

Checking support for the SSSE3 flag on your vCPUs

The SSSE3 set of instructions is required because secret scanning leverages hardware accelerated pattern matching to find potential credentials committed to your GitHub repositories. SSSE3 is enabled for most modern CPUs. You can check whether SSSE3 is enabled for the vCPUs available to your GitHub Enterprise Server instance.

  1. Connect to the administrative shell for your GitHub Enterprise Server instance. For more information, see "访问管理 shell (SSH)."

  2. Enter the following command:

    grep -iE '^flags.*ssse3' /proc/cpuinfo >/dev/null | echo $?
    

    If this returns the value 0, it means that the SSSE3 flag is available and enabled. You can now enable secret scanning for 你的 GitHub Enterprise Server 实例. For more information, see "Enabling secret scanning" below.

    If this doesn't return 0, SSSE3 is not enabled on your VM/KVM. You need to refer to the documentation of the hardware/hypervisor on how to enable the flag, or make it available to guest VMs.

Enabling secret scanning

警告:更改此设置将导致 GitHub Enterprise Server 上面向用户的服务重新启动。 你应仔细安排此更改的时间,以最大程度地减少用户的停机时间。

  1. 在 GitHub Enterprise Server 上的管理帐户中,在任一页面的右上角,单击

  2. 如果你尚未在“站点管理员”页上,请在左上角单击“站点管理员”。

  3. 在“ 站点管理”边栏中,单击“管理控制台”。

  4. 在“设置”边栏中,单击“安全”。

  5. Under "Security," select Secret scanning.

  6. 在“设置”边栏下,单击“保存设置”。

    注意:保存 管理控制台 中的设置会重启系统服务,这可能会导致用户可察觉的停机时间。

  7. 等待配置运行完毕。

Disabling secret scanning

警告:更改此设置将导致 GitHub Enterprise Server 上面向用户的服务重新启动。 你应仔细安排此更改的时间,以最大程度地减少用户的停机时间。

  1. 在 GitHub Enterprise Server 上的管理帐户中,在任一页面的右上角,单击

  2. 如果你尚未在“站点管理员”页上,请在左上角单击“站点管理员”。

  3. 在“ 站点管理”边栏中,单击“管理控制台”。

  4. 在“设置”边栏中,单击“安全”。

  5. Under "Security," deselect Secret scanning.

  6. 在“设置”边栏下,单击“保存设置”。

    注意:保存 管理控制台 中的设置会重启系统服务,这可能会导致用户可察觉的停机时间。

  7. 等待配置运行完毕。