Skip to content

Commit af26518

Browse files
sophiethekingCopilotlecoursensunbrye
authored
Enterprise-level credential visibility - List/Export inventory of all token types (#63294)
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Co-authored-by: Laura Coursen <lecoursen@github.com> Co-authored-by: Sunbrye Ly <56200261+sunbrye@users.noreply.github.com>
1 parent 5fc24f9 commit af26518

6 files changed

Lines changed: 144 additions & 16 deletions

File tree

‎content/admin/managing-iam/respond-to-incidents/index.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ intro: Take bulk action when facing a major security incident.
44
versions:
55
feature: revoke-enterprise-tokens
66
children:
7+
- /reviewing-credentials-in-your-enterprise
78
- /revoke-authorizations-or-tokens
89
- /lock-down-sso
910
shortTitle: Respond to incidents
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
---
2+
title: Reviewing credentials in your enterprise
3+
intro: Review and export an enterprise-wide credential inventory to investigate access, respond to security incidents, and support compliance audits.
4+
permissions: Enterprise owners and users with the "View enterprise credentials" fine-grained permission
5+
product: '{% data variables.product.prodname_ghe_cloud %}'
6+
versions:
7+
feature: enterprise-token-inventory
8+
shortTitle: Review credentials
9+
contentType: how-tos
10+
category:
11+
- Configure authentication
12+
---
13+
14+
The credential inventory gives you enterprise-wide visibility into credentials that can access your enterprise. The inventory is read-only. Depending on the credential type, remediation happens at the enterprise, organization, application, or user level.
15+
16+
## About the credentials overview
17+
18+
On the "Authentication security" page, the "Credentials" section shows overview counts for these credential types:
19+
20+
* {% data variables.product.pat_v2_caps_plural %}
21+
* {% data variables.product.pat_v1_caps_plural %}
22+
* {% data variables.product.prodname_oauth_app %} access tokens
23+
* {% data variables.product.prodname_github_app %} user access tokens
24+
* {% data variables.product.prodname_github_app %} installation access tokens
25+
* User SSH keys
26+
27+
The counts include active credentials, meaning credentials that have not expired, been revoked, or been deleted. {% data variables.product.prodname_github_app %} installation access is represented by the app installation that can issue tokens, rather than by each short-lived installation access token.
28+
29+
Use the counts to understand the relative scale of each credential type. The overview displays `10k+` when a credential-type count reaches 10,000, rather than displaying an exact total.
30+
31+
For credential-level investigation, export the inventory. The export also includes federated credentials that can access the enterprise.
32+
33+
## Viewing the credentials overview
34+
35+
{% data reusables.enterprise-accounts.access-enterprise %}
36+
{% data reusables.enterprise-accounts.settings-tab %}
37+
{% data reusables.enterprise-accounts.security-tab %}
38+
1. Under "Credentials," review the "Overview" section.
39+
40+
## Exporting the credential inventory
41+
42+
The CSV export contains the full credential inventory. You cannot filter the inventory before exporting it. After downloading the file, you can filter its columns by credential type, access state, owner, organization, or application.
43+
44+
{% data reusables.enterprise-accounts.access-enterprise %}
45+
{% data reusables.enterprise-accounts.settings-tab %}
46+
{% data reusables.enterprise-accounts.security-tab %}
47+
1. Next to "Overview," click **{% octicon "download" aria-hidden="true" aria-label="download" %} Export CSV**.
48+
1. Wait for the export to finish. The CSV downloads automatically, and {% data variables.product.github %} sends a download link to your notification email address.
49+
50+
## Interpreting the CSV export
51+
52+
The CSV contains one row for each combination of a credential and an authorizing organization. If a credential is authorized for multiple organizations, its credential data is repeated in multiple rows. A credential without an organization authorization appears once with empty `organization_id` and `organization` fields.
53+
54+
The following table describes the fields in the export.
55+
56+
| Field | Description |
57+
| --- | --- |
58+
| `credential_id` | Identifier for the credential in its source system. The identifier is unique only when combined with `credential_type`, and is empty for SSH keys, {% data variables.product.prodname_github_app %} installations, and federated credentials. |
59+
| `hashed_token` | Base64-encoded SHA-256 hash that can be matched to the `hashed_token` field in audit log events. This field is empty for {% data variables.product.pat_v2_plural %}. The export never includes the token value. |
60+
| `fingerprint` | SHA-256 fingerprint for an SSH key. Empty for other credential types. |
61+
| `item_type` | A `credential` represents an individual credential. A `token_issuer_principal` represents a {% data variables.product.prodname_github_app %} installation that can issue access tokens, rather than an individual installation access token. |
62+
| `credential_type` | Credential type, such as `classic_pat`, `fine_grained_pat`, `oauth_app_user_token`, `github_app_user_token`, `ssh_key`, `github_app_installation`, or `federated_jti`. |
63+
| `display_name` | Display name for the credential, when available. |
64+
| `owner_id` | Identifier for the credential owner. Use with `owner_type` to interpret the identifier. |
65+
| `owner` | Login or name of the credential owner. |
66+
| `owner_type` | Owner type: `user`, `oauth_application`, or `github_app`. |
67+
| `application_id` | Identifier for the associated application, when applicable. |
68+
| `application` | Name of the associated application, when applicable. |
69+
| `credential_state` | Credential state, such as `active`, `expired`, `revoked`, or `deleted`. |
70+
| `created_at` | Date and time the credential was created, when available. |
71+
| `last_used_at` | Date and time the credential was last used, when available. |
72+
| `expires_at` | Date and time the credential expires, when available. |
73+
| `expiry_status` | Whether the credential `expires`, `never` expires, or has an `unknown` expiration. |
74+
| `enterprise_authorized` | Whether the credential is authorized directly at the enterprise level. |
75+
| `authorization_count` | Total number of organization authorizations, plus one if `enterprise_authorized` is `true`. |
76+
| `age_days` | Age of the credential in whole days when the inventory was generated. |
77+
| `past_expiration_policy` | Whether the credential exceeds an enforced lifetime limit or advisory age baseline, when evaluated. |
78+
| `past_expiration_policy_basis` | Whether `past_expiration_policy` is based on an `enforced_limit` or `proposed_baseline`. |
79+
| `scopes` | OAuth scopes for the token, separated by semicolons. |
80+
| `permissions` | Permissions for a {% data variables.product.pat_v2 %} or {% data variables.product.prodname_github_app %} installation, formatted as semicolon-separated `resource:action` pairs. |
81+
| `repository_selection` | Whether the credential can access `all`, a `subset`, or `none` of the repositories available to it. |
82+
| `organization_id` | Identifier for an organization that authorizes the credential. |
83+
| `organization` | Login for an organization that authorizes the credential. |
84+
85+
Empty cells mean that a value is unavailable or does not apply. Timestamps use ISO 8601 format in UTC.
86+
87+
## Correlating credentials with audit log activity
88+
89+
Use the export to compare credentials with authentication metadata in your enterprise audit log. For tokens, compare `credential_id` with `token_id`, or copy a `hashed_token` value and search for `hashed_token:"VALUE"`. For SSH keys, compare the `fingerprint` values. You do not need the original token value.
90+
91+
For more information, see [AUTOTITLE](/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/identifying-audit-log-events-performed-by-an-access-token).
92+
93+
## Next steps
94+
95+
After you identify credentials that require action, you can revoke SSO authorizations or, for an enterprise with managed users, delete user keys and tokens. These actions can disrupt users and automation across the enterprise. Before proceeding, see [AUTOTITLE](/admin/managing-iam/respond-to-incidents/revoke-authorizations-or-tokens).

‎content/admin/managing-iam/respond-to-incidents/revoke-authorizations-or-tokens.md‎

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
---
2-
title: Revoking SSO authorizations or deleting credentials in your enterprise
3-
intro: Respond to a security incident by taking action on credentials with access to your enterprise.
2+
title: Revoking authorizations or deleting credentials in your enterprise
3+
intro: Contain a security incident by removing credential access across your enterprise or by taking targeted action against specific users or credential types.
44
permissions: Enterprise owners and users with the "Manage enterprise credentials" fine-grained permission
55
product: Enterprises with managed users, or enterprises that have enabled SAML SSO for the enterprise or its organizations
66
versions:
77
feature: revoke-enterprise-tokens
8-
shortTitle: Revoke authorizations or tokens
8+
shortTitle: Revoke or delete credentials
9+
allowTitleToDifferFromFilename: true
910
contentType: how-tos
1011
category:
1112
- Configure authentication
@@ -20,19 +21,19 @@ Available actions:
2021

2122
{% ifversion single_user_cred_revocation %}
2223

23-
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 take action against credentials:
24+
In the "Authentication security" section of your enterprise settings, you can take action against credentials:
2425

2526
* **For individual members**: Revoke SSO authorizations or delete credentials for a specific user when responding to a targeted incident or performing routine access cleanup.
2627
* **For a specific credential type**: Revoke SSO authorizations or delete credentials of a selected type, such as only {% data variables.product.pat_v1_plural %}, across your entire enterprise.
2728
* **For all members (bulk action)**: Take bulk action to revoke SSO authorizations or delete credentials across all members and every supported credential type, such as when responding to a major security incident.
2829

2930
You can also take any of these actions using the [AUTOTITLE](/rest/enterprise-admin/credential-authorizations).
3031

31-
> [!NOTE] Organization owners can take the same actions at the organization level, using the {% data variables.product.github %} UI or the [AUTOTITLE](/rest/orgs/orgs#revoke-a-single-credential-type-for-an-organization). For more information, see [AUTOTITLE](/organizations/granting-access-to-your-organization-with-saml-single-sign-on/viewing-and-managing-a-members-saml-access-to-your-organization).
32+
> [!NOTE] Organization owners can take the same actions at the organization level, using the {% data variables.product.github %} UI or the [AUTOTITLE](/rest/orgs/orgs#revoke-a-single-credential-type-for-an-organization).
3233
3334
{% else %}
3435

35-
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 bulk actions in the "Danger zone" to revoke SSO authorizations or delete credentials.
36+
In the "Authentication security" section of your enterprise settings, you can use bulk actions in the "Danger zone" to revoke SSO authorizations or delete credentials.
3637

3738
{% endif %}
3839

@@ -44,16 +45,32 @@ In the "Authentication security" section of your enterprise settings, you can re
4445

4546
## Reviewing credentials
4647

47-
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).
48+
Before taking action, use the "Credentials" overview and CSV export to assess which credentials can access your enterprise. The overview provides enterprise-wide visibility, but the available response depends on the credential type and where it is managed.
4849

49-
The counts include:
50+
For information about the overview, export fields, and audit log correlation, see [AUTOTITLE](/admin/managing-iam/respond-to-incidents/reviewing-credentials-in-your-enterprise).
5051

51-
* {% data variables.product.pat_v2_caps_plural %}
52-
* {% data variables.product.pat_v1_caps_plural %}
53-
* User SSH keys
54-
* {% data variables.product.prodname_github_app %} and {% data variables.product.prodname_oauth_app %} user access tokens
52+
## Choosing where to take action
53+
54+
Use the following table to determine the narrowest appropriate response. Enterprise-level actions can affect credentials across every organization in the enterprise. Organization- and user-level actions reduce disruption when you can identify the affected credential or application.
5555

56-
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.
56+
| Credential type | Where it is managed | Who can take action | Scope and available action |
57+
| --- | --- | --- | --- |
58+
| {% data variables.product.pat_v2_caps %} | Organization settings or the token owner's personal settings | Organization owner or token owner | At the organization level, revoke the token's access to organization resources. At the user level, delete the token. |
59+
| {% data variables.product.pat_v1_caps %} | SSO credential authorization settings or the token owner's personal settings | Enterprise owner, organization owner, or token owner | At the enterprise or organization level, revoke SSO authorization. At the user level, delete the token. |
60+
| {% data variables.product.prodname_oauth_app %} access token | Organization OAuth app policy or the user's authorized OAuth apps | Organization owner or user | At the organization level, deny the app access. At the user level, revoke the app authorization and its associated tokens. |
61+
| {% data variables.product.prodname_github_app %} user access token or installation | Installed app settings or the user's authorized {% data variables.product.prodname_github_apps %} | Enterprise owner, organization owner, or user | At the enterprise or organization level, suspend or uninstall the app to prevent access. At the user level, revoke the user's authorization. |
62+
| User SSH key | SSO credential authorization settings or the key owner's personal settings | Enterprise owner, organization owner, or key owner | At the enterprise or organization level, revoke SSO authorization. At the user level, delete the key. |
63+
64+
For a targeted response, use the procedure for the credential and action:
65+
66+
* **{% data variables.product.pat_v2_caps_plural %}**: [AUTOTITLE](/organizations/managing-programmatic-access-to-your-organization/reviewing-and-revoking-personal-access-tokens-in-your-organization)
67+
* **User-owned {% data variables.product.pat_generic_plural %}**: [AUTOTITLE](/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#deleting-a-personal-access-token)
68+
* **SSO-authorized {% data variables.product.pat_v1_plural %} and user SSH keys**: [AUTOTITLE](/organizations/granting-access-to-your-organization-with-saml-single-sign-on/viewing-and-managing-a-members-saml-access-to-your-organization)
69+
* **{% data variables.product.prodname_oauth_app %} access tokens**: [AUTOTITLE](/organizations/managing-oauth-access-to-your-organizations-data/denying-access-to-a-previously-approved-oauth-app-for-your-organization) or [AUTOTITLE](/apps/oauth-apps/using-oauth-apps/reviewing-your-authorized-oauth-apps)
70+
* **{% data variables.product.prodname_github_app %} user access tokens or installations**: [AUTOTITLE](/apps/using-github-apps/reviewing-and-modifying-installed-github-apps) or [AUTOTITLE](/apps/using-github-apps/reviewing-and-revoking-authorization-of-github-apps)
71+
* **User-owned SSH keys**: [AUTOTITLE](/authentication/keeping-your-account-and-data-secure/reviewing-your-ssh-keys)
72+
73+
For an enterprise-wide response, see [Taking bulk action against all members](#taking-bulk-action-against-all-members). These actions affect user credentials, not {% data variables.product.prodname_github_app %} installation access tokens.
5774

5875
## Understanding the available actions
5976

@@ -95,12 +112,11 @@ Both actions include the following credential types:
95112
* {% data variables.product.pat_v1_caps_plural %}
96113
* {% data variables.product.pat_v2_caps_plural %}
97114

98-
Note that the "revoke authorizations" action works differently for {% data variables.product.pat_v2_plural %}, as explained above.
115+
The "revoke authorizations" action works differently for {% data variables.product.pat_v2_plural %}. For details, see [Revoke SSO authorizations](#revoke-sso-authorizations).
99116

100-
The following credential types are **not** affected:
117+
The following credential types are **not** affected by either action:
101118

102119
* {% data variables.product.prodname_github_app %} installation tokens (`ghs_`)
103-
* {% data variables.product.pat_v2_caps_plural %}
104120
* Deploy keys
105121
* {% data variables.product.prodname_actions %} `GITHUB_TOKEN` access
106122

‎content/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/identifying-audit-log-events-performed-by-an-access-token.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@ Your enterprise's audit log contains an event for each action that a user or int
2727

2828
### Generating a SHA-256 hash value for a token
2929

30+
{% ifversion enterprise-token-inventory %}
31+
32+
If you do not have the token value, export your enterprise credential inventory. You can copy the `hashed_token` value from the CSV and use it in the same audit log search. The export also provides `credential_id` and SSH key `fingerprint` values that you can compare with authentication metadata in audit log events.
33+
34+
For more information, see [AUTOTITLE](/admin/managing-iam/respond-to-incidents/reviewing-credentials-in-your-enterprise).
35+
36+
{% endif %}
37+
3038
{% data reusables.audit_log.generating-hash-for-a-token %}
3139

3240
### Searching on {% data variables.product.prodname_dotcom %}

‎content/organizations/managing-programmatic-access-to-your-organization/github-credential-types.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,10 @@ On {% data variables.product.prodname_ghe_cloud %}, during a security incident,
152152

153153
During a security incident, enterprise owners{% ifversion single_user_cred_revocation %} and organization owners{% endif %} can respond quickly with bulk actions. {% ifversion single_user_cred_revocation %}You can take action against individual members, a specific credential type, or against all members in bulk.{% endif %} These actions affect user SSH keys, {% data variables.product.prodname_oauth_app %} user access tokens, {% data variables.product.prodname_github_app %} user access tokens, {% data variables.product.pat_v1_plural %}, and {% data variables.product.pat_v2_plural %}. They do **not** affect {% data variables.product.prodname_github_app %} installation access tokens, deploy keys, or `GITHUB_TOKEN`.
154154

155+
{% ifversion enterprise-token-inventory %}
156+
Before taking action, review your enterprise credential inventory to identify affected credentials and choose the narrowest appropriate response. See [AUTOTITLE](/admin/managing-iam/respond-to-incidents/reviewing-credentials-in-your-enterprise).
157+
{% endif %}
158+
155159
> [!WARNING] {% ifversion single_user_cred_revocation %}Bulk actions are{% else %}These are{% endif %} 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.
156160
157161
{% ifversion single_user_cred_revocation %}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Enterprise credential inventory and CSV export, available on GitHub Enterprise Cloud.
2+
3+
versions:
4+
ghec: '*'

0 commit comments

Comments
 (0)