关于启用 GitHub Advanced Security
GitHub Advanced Security 帮助开发者改进和维护代码的安全性和质量。
为企业启用 GitHub Advanced Security 后,所有组织的仓库管理员都可以启用这些功能。
启用 GitHub Advanced Security 的前提条件
- Upgrade your license for GitHub Enterprise Server to include GitHub Advanced Security.
- Download the new license file. For more information, see "Downloading your license for GitHub Enterprise."
- Upload the new license file to 您的 GitHub Enterprise Server 实例. For more information, see "Uploading a new license to GitHub Enterprise Server."
- Dependabot, see "Enabling alerts for vulnerable dependencies on GitHub Enterprise Server."
检查您的许可是否包含 GitHub Advanced Security
- 从 GitHub Enterprise Server 上的管理帐户,点击任何页面右上角的 。
- 在左侧边栏中,单击 管理控制台。
- 如果您的许可包括 GitHub Advanced Security,则左侧边栏中有一个 Advanced Security 条目。
If you can't see Advanced Security in the sidebar, it means that your license doesn't include support for Advanced Security features, including 代码扫描 and 秘密扫描. Advanced Security 的许可使您和您的用户能够访问那些有助于提高仓库和代码安全性的功能。
启用和禁用 GitHub Advanced Security 功能
警告:更改此设置将导致 GitHub Enterprise Server 上面向用户的服务重新启动。 您应谨慎安排更改时间,以尽量减少用户的停机时间。
- 从 GitHub Enterprise Server 上的管理帐户,点击任何页面右上角的 。
- 在左侧边栏中,单击 管理控制台。
- In the left sidebar, click Advanced Security.
- 在“Advanced Security”下,单击 代码扫描。 用于启用 Public Pages 的复选框
- 在左侧边栏下,单击 Save settings(保存设置)。
- 等待配置运行完毕。
当 GitHub Enterprise Server 完成重启后,您可以设置新启用功能所需的任何额外资源。 更多信息请参阅“为设备配置 代码扫描”。
Enabling or disabling GitHub Advanced Security features via the administrative shell (SSH)
您可以通过编程方式在 您的 GitHub Enterprise Server 实例 上启用或禁用功能。 有关 GitHub Enterprise Server 的管理 shell 和命令行实用程序的更多信息,请参阅“访问管理 shell (SSH)”和“命令行实用程序”。
For example, you can enable any GitHub Advanced Security feature with your infrastructure-as-code tooling when you deploy an instance for staging or disaster recovery.
-
SSH 连接到 您的 GitHub Enterprise Server 实例。
-
Enable features for GitHub Advanced Security.
- To enable 代码扫描, enter the following commands.
ghe-config app.minio.enabled true ghe-config app.code-scanning.enabled true
- To enable 秘密扫描, enter the following command.
ghe-config app.secret-scanning.enabled true
- To enable Dependabot, enter the following commands.
ghe-config app.github.dependency-graph-enabled true ghe-config app.github.vulnerability-alerting-and-settings-enabled true
- To enable 代码扫描, enter the following commands.
-
Optionally, disable features for GitHub Advanced Security.
- To disable 代码扫描, enter the following commands.
ghe-config app.minio.enabled false ghe-config app.code-scanning.enabled false
- To disable 秘密扫描, enter the following command.
ghe-config app.secret-scanning.enabled false
- To disable Dependabot, enter the following commands.
ghe-config app.github.dependency-graph-enabled false ghe-config app.github.vulnerability-alerting-and-settings-enabled false
- To disable 代码扫描, enter the following commands.
-
应用配置。
ghe-config-apply