|
| 1 | +--- |
| 2 | +title: Revoking SSO authorizations or deleting credentials in your enterprise |
| 3 | +intro: 'Respond to a security incident by taking bulk action on credentials with access to your enterprise.' |
| 4 | +permissions: 'Enterprise owners and users with the "Manage enterprise credentials" fine-grained permission' |
| 5 | +product: 'Enterprises with managed users, or enterprises that have enabled SAML SSO for the enterprise or its organizations' |
| 6 | +versions: |
| 7 | + feature: revoke-enterprise-tokens |
| 8 | +type: how_to |
| 9 | +topics: |
| 10 | + - Accounts |
| 11 | + - Authentication |
| 12 | + - Enterprise |
| 13 | + - Identity |
| 14 | +shortTitle: Revoke authorizations or tokens |
| 15 | +--- |
| 16 | + |
| 17 | +When your enterprise is affected by a major security incident, you can respond by preventing programmatic access to your enterprise or its organizations. |
| 18 | + |
| 19 | +In the "Authentication security" section of your enterprise settings, you can review counts for user tokens and keys that are authorized for single sign-on (SSO). Then, if needed, you can use one of the following bulk actions in the "Danger zone": |
| 20 | + |
| 21 | +* **Revoke SSO authorizations** to remove access to SSO-protected organization resources for user credentials in your enterprise. |
| 22 | +* **Delete keys and tokens** to remove user tokens and SSH keys in your enterprise, even if they don't have an SSO authorization ({% data variables.product.prodname_emus %} only). |
| 23 | + |
| 24 | +>[!WARNING] These are high-impact actions that should be reserved for major security incidents. They are likely to break automations, and it could take months of work to restore your original state. For alternative options for responding to individual compromised tokens on a smaller scale, see the [Resources for smaller-scale responses](#resources-for-smaller-scale-responses) section. |
| 25 | +
|
| 26 | +## Accessing the authentication security page |
| 27 | + |
| 28 | +{% data reusables.enterprise-accounts.access-enterprise %} |
| 29 | +{% data reusables.enterprise-accounts.settings-tab %} |
| 30 | +1. In the left sidebar, click **Authentication security**. |
| 31 | + |
| 32 | +## Reviewing credentials |
| 33 | + |
| 34 | +In the "Credentials" section, you can view how many credentials of each type have **at least one SSO authorization** for an organization in your enterprise. For more information, see [AUTOTITLE](/authentication/authenticating-with-single-sign-on/about-authentication-with-single-sign-on). |
| 35 | + |
| 36 | +The counts include: |
| 37 | + |
| 38 | +* {% data variables.product.pat_v2_caps_plural %} |
| 39 | +* {% data variables.product.pat_v1_caps_plural %} |
| 40 | +* User SSH keys |
| 41 | +* {% data variables.product.prodname_github_app %} and {% data variables.product.prodname_oauth_app %} user access tokens |
| 42 | + |
| 43 | +An exact count is displayed if there are 10,000 or fewer of a token type. Above that figure, the description `10k+ tokens` is displayed. |
| 44 | + |
| 45 | +## Taking bulk action (danger zone) |
| 46 | + |
| 47 | +Use the **Danger zone** bulk action buttons to respond to a security incident as needed. The following sections describe each action, which SSO authorizations or credentials are impacted, and related audit log events. |
| 48 | + |
| 49 | +>[!NOTE] If your enterprise does **not** use {% data variables.product.prodname_emus %} and has **not** enabled SAML SSO, neither of these actions is available. As an alternative, if you need users to replace {% data variables.product.pat_generic_plural %} as part of your incident response, you can configure an enterprise policy to expire all {% data variables.product.pat_generic_plural %}. See [AUTOTITLE](/admin/enforcing-policies/enforcing-policies-for-your-enterprise/enforcing-policies-for-personal-access-tokens-in-your-enterprise). |
| 50 | +
|
| 51 | +### Revoke SSO authorizations |
| 52 | + |
| 53 | +This action is available for {% data variables.product.prodname_emus %} or enterprises that use SAML SSO. |
| 54 | + |
| 55 | +Revoking authorizations removes SSO authorizations for user tokens and SSH keys across all organizations in your enterprise. |
| 56 | + |
| 57 | +* Credentials that have had SSO authorizations revoked **cannot be re-authorized** for the affected organizations. To restore access, users must create new credentials and authorize them. |
| 58 | +* The credentials themselves are not deleted, and their permissions for the user and enterprise scopes, and for non-SSO-protected organizations, **remain active**. |
| 59 | +* Credentials that have not been authorized for SSO are **not affected**. |
| 60 | + |
| 61 | +Authorization for **{% data variables.product.pat_v2_plural %}** works differently, so this action has a different effect on this token type. For fine-grained PATs where an organization is the "resource owner," the resource owner is removed, removing access to organization resources. Users can change the resource owner back to the organization account, which may require approval (see [AUTOTITLE](/admin/enforcing-policies/enforcing-policies-for-your-enterprise/enforcing-policies-for-personal-access-tokens-in-your-enterprise#enforcing-an-approval-policy-for-fine-grained-personal-access-tokens)). |
| 62 | + |
| 63 | +### Delete keys and tokens |
| 64 | + |
| 65 | +This action is available for {% data variables.product.prodname_emus %} only. |
| 66 | + |
| 67 | +Deleting keys and tokens removes credentials that have access to your enterprise, regardless of whether they are authorized for SSO. The credentials stop working and are no longer visible in the UI. |
| 68 | + |
| 69 | +To restore programmatic access, users must create new credentials, authorize them with organizations if required, and update affected processes to use the new credentials. |
| 70 | + |
| 71 | +### Included credentials |
| 72 | + |
| 73 | +Both actions include the following credential types: |
| 74 | + |
| 75 | +* User SSH keys |
| 76 | +* {% data variables.product.prodname_oauth_apps %} user access tokens (`ghu_`) |
| 77 | +* {% data variables.product.prodname_github_app %} user access tokens |
| 78 | +* {% data variables.product.pat_v1_caps_plural %} |
| 79 | +* {% data variables.product.pat_v2_caps_plural %} |
| 80 | + |
| 81 | +Note that the "revoke authorizations" action works differently for {% data variables.product.pat_v2_plural %}, as explained above. |
| 82 | + |
| 83 | +The following credential types are **not** affected: |
| 84 | + |
| 85 | +* {% data variables.product.prodname_github_app %} installation tokens (`ghs_`) |
| 86 | +* {% data variables.product.pat_v2_caps_plural %} |
| 87 | +* Deploy keys |
| 88 | +* {% data variables.product.prodname_actions %} `GITHUB_TOKEN` access |
| 89 | + |
| 90 | +### Audit and security log events |
| 91 | + |
| 92 | +The "revoke authorizations" action generates the following events: |
| 93 | + |
| 94 | +* `org_credential_authorization.deauthorize` |
| 95 | +* `org_credential_authorization.revoke` |
| 96 | +* `personal_access_token.access_revoked` |
| 97 | + |
| 98 | +The "delete tokens" action also generates those events, and additionally generates the following events: |
| 99 | + |
| 100 | +* `oauth_access.destroy` |
| 101 | +* `personal_access_token.destroy` |
| 102 | + |
| 103 | +## Resources for smaller-scale responses |
| 104 | + |
| 105 | +The following articles describe alternative actions for managing incidents that are smaller in scope, where you can identify specific compromised tokens or user accounts. |
| 106 | + |
| 107 | +* [AUTOTITLE](/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/identifying-audit-log-events-performed-by-an-access-token) |
| 108 | +* [AUTOTITLE](/code-security/tutorials/remediate-leaked-secrets/remediating-a-leaked-secret) |
| 109 | +* [AUTOTITLE](/rest/credentials/revoke) in the REST API documentation |
0 commit comments