Skip to main content

Enforcing policies for security settings in your enterprise

You can enforce policies to manage security settings in your enterprise's organizations, or allow policies to be set in each organization.

谁可以使用此功能?

Enterprise owners can enforce policies for security settings in an enterprise.

About policies for security settings in your enterprise

You can enforce policies to control the security settings for organizations owned by your enterprise on GitHub Enterprise Server. By default, organization owners can manage security settings.

Requiring two-factor authentication for organizations in your enterprise

If 你的 GitHub Enterprise Server 实例 uses LDAP or built-in authentication, enterprise owners can require that organization members, billing managers, and outside collaborators in all organizations owned by an enterprise use two-factor authentication to secure their user accounts.

Before you can require 2FA for all organizations owned by your enterprise, you must enable two-factor authentication for your own account. For more information, see "使用双重身份验证 (2FA) 保护您的帐户."

Before you require use of two-factor authentication, we recommend notifying organization members, outside collaborators, and billing managers and asking them to set up 2FA for their accounts. Organization owners can see if members and outside collaborators already use 2FA on each organization's People page. For more information, see "查看组织中的用户是否已启用 2FA."

双因素身份验证代码的验证需要客户端设备和服务器上的准确时间。 站点管理员应确保时间同步已配置且准确无误。 有关详细信息,请参阅“Configuring time synchronization”。

Warnings:

  • When you require two-factor authentication for your enterprise, members, outside collaborators, and billing managers (including bot accounts) in all organizations owned by your enterprise who do not use 2FA will be removed from the organization and lose access to its repositories. They will also lose access to their forks of the organization's private repositories. You can reinstate their access privileges and settings if they enable two-factor authentication for their account within three months of their removal from your organization. For more information, see "Reinstating a former member of your organization(恢复组织前成员的身份)."
  • Any organization owner, member, billing manager, or outside collaborator in any of the organizations owned by your enterprise who disables 2FA for their account after you've enabled required two-factor authentication will automatically be removed from the organization.
  • If you're the sole owner of an enterprise that requires two-factor authentication, you won't be able to disable 2FA for your user account without disabling required two-factor authentication for the enterprise.
  1. 在 GitHub Enterprise Server 的右上角,单击你的个人资料照片,然后单击“企业设置”****。

    单击 GitHub Enterprise Server 上的个人资料照片时显示的下拉菜单的屏幕截图。 “企业设置”选项以深橙色边框突出显示。

  2. 在企业帐户边栏中,单击“设置”。

  3. 在“ 设置”下,单击“身份验证安全性” 。

  4. Under "Two-factor authentication", review the information about changing the setting. (可选)若要在更改设置之前查看企业帐户中所有组织的当前配置,请单击“ 查看组织的当前配置”。

    企业设置中某策略的屏幕截图。 用橙色边框突出显示了标记为“查看组织的当前配置”的链接。

  5. Under "Two-factor authentication", select Require two-factor authentication for all organizations in your business, then click Save.

  6. If prompted, read the information about members and outside collaborators who will be removed from the organizations owned by your enterprise. To confirm the change, type your enterprise's name, then click Remove members & require two-factor authentication.

  7. Optionally, if any members or outside collaborators are removed from the organizations owned by your enterprise, we recommend sending them an invitation to reinstate their former privileges and access to your organization. Each person must enable two-factor authentication before they can accept your invitation.

Managing SSH certificate authorities for your enterprise

You can use a SSH certificate authority (CA) to allow members of any organization owned by your enterprise to access that organization's repositories using SSH certificates you provide. 您可以要求成员使用 SSH 证书访问组织资源,除非 SSH 已在仓库中禁用。 For more information, see "关于 SSH 认证中心."

在颁发每个客户端证书时,必须包含扩展,以指定证书用于哪个 GitHub Enterprise Server 用户。 有关详细信息,请参阅“关于 SSH 认证中心”。

Adding an SSH certificate authority

If you require SSH certificates for your enterprise, enterprise members should use a special URL for Git operations over SSH. For more information, see "关于 SSH 认证中心."

每个证书颁发机构只能上传到 GitHub Enterprise Server 上的一个帐户。 如果 SSH 证书颁发机构已添加到某个组织或企业帐户,则不能将该证书颁发机构添加到 GitHub Enterprise Server 上的其他组织或企业帐户。

如果将一个证书颁发机构添加到企业中,并将另一个证书颁发机构添加到企业组织中,则任一证书颁发机构都可用于访问组织的存储库。

  1. 在 GitHub Enterprise Server 的右上角,单击你的个人资料照片,然后单击“企业设置”****。

    单击 GitHub Enterprise Server 上的个人资料照片时显示的下拉菜单的屏幕截图。 “企业设置”选项以深橙色边框突出显示。

  2. 在企业帐户边栏中,单击“设置”。

  3. 在“ 设置”下,单击“身份验证安全性” 。

  4. 在“SSH 证书颁发机构”右侧,单击“新建 CA”。

  5. 在“Key(密钥)”下,粘贴您的公共 SSH 密钥。

  6. 单击“添加 CA”。

  7. (可选)若要要求成员使用 SSH 证书,请选择“需要 SSH 证书”,然后单击“保存” 。

    注意:当需要 SSH 证书时,用户将无法通过 HTTPS 或通过无符号的 SSH 密钥 .****

    需要 SSH 证书时,该要求不适用于获得授权的 OAuth apps 和 GitHub Apps (包括用户到服务器的令牌)、部署密钥或 GitHub 功能,例如 GitHub Actions,它们是 GitHub 生态系统中的受信任环境。

Deleting an SSH certificate authority

Deleting a CA cannot be undone. If you want to use the same CA in the future, you'll need to upload the CA again.

  1. 在 GitHub Enterprise Server 的右上角,单击你的个人资料照片,然后单击“企业设置”****。

    单击 GitHub Enterprise Server 上的个人资料照片时显示的下拉菜单的屏幕截图。 “企业设置”选项以深橙色边框突出显示。

  2. 在企业帐户边栏中,单击“设置”。

  3. 在“ 设置”下,单击“身份验证安全性” 。

  4. 在“SSH 证书颁发机构”下,在要删除的 CA 右侧,单击“删除”。

  5. 阅读警告,然后单击“我了解,请删除此 CA”。

Upgrading an SSH certificate authority

CAs uploaded to your enterprise before GitHub Enterprise Server version 3.13 allow the use of non-expiring certificates. To learn more about why expirations are now required for new CAs, see "关于 SSH 认证中心." You can upgrade an existing CA to prevent it from issuing non-expiring certificates. For best security, we strongly recommend upgrading all your CAs once you validate you're not reliant on non-expiring certificates.

  1. 在 GitHub Enterprise Server 的右上角,单击你的个人资料照片,然后单击“企业设置”****。

    单击 GitHub Enterprise Server 上的个人资料照片时显示的下拉菜单的屏幕截图。 “企业设置”选项以深橙色边框突出显示。

  2. 在企业帐户边栏中,单击“设置”。

  3. 在“ 设置”下,单击“身份验证安全性” 。

  4. Under "SSH Certificate Authorities", to the right of the CA you want to upgrade, click Upgrade.

  5. Read the warning, then click Upgrade.

After upgrading the CA, non-expiring certificates signed by that CA will be rejected.

Further reading