-
Notifications
You must be signed in to change notification settings - Fork 54
docs(iam): add Manage API keys page for org-scoped keys and creation controls #3060
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
mdlinville
wants to merge
3
commits into
main
Choose a base branch
from
DOCS-3071-org-scoped-api-keys
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,171 @@ | ||
| --- | ||
| title: Manage API keys | ||
| description: "Find, create, and delete W&B API keys, and restrict how members of your organization create and use them." | ||
| keywords: ["organization-scoped API key", "revoke API key", "API Keys tab", "disable API key creation", "key rotation"] | ||
| --- | ||
|
|
||
| import ApiKeySecurity from "/snippets/_includes/api-key-security.mdx"; | ||
| import ApiKeyViewOnceWarning from "/snippets/_includes/api-key-view-once-warning.mdx"; | ||
|
|
||
| An API key authenticates a person or a service account to W&B. This page describes the kinds of API keys W&B issues, where to find and manage them, and the organization settings that restrict how members create and use them. It's intended for organization admins and team admins who govern credentials, and for members who manage their own keys. | ||
|
|
||
| To store keys safely once you have them, see [Store and handle API keys securely](#store-and-handle-api-keys-securely). | ||
|
|
||
| ## Types of API keys | ||
|
|
||
| W&B issues API keys to both people and service accounts. | ||
|
|
||
| | Key type | Belongs to | Scope | | ||
| | --- | --- | --- | | ||
| | Personal API key | A user | Every organization the user belongs to | | ||
| | Organization-scoped API key | A user, within one organization | Only that organization's resources | | ||
| | [Team service account](/platform/hosting/iam/service-accounts#team-scoped-service-accounts) key | A service account | One team | | ||
| | [Organization service account](/platform/hosting/iam/service-accounts#organization-scoped-service-accounts) key | A service account | All teams in the organization | | ||
|
|
||
| <Note> | ||
| An **organization-scoped API key** and an **organization-scoped service account** are different things. An organization-scoped API key belongs to a person and authenticates that person, limited to a single organization. An organization-scoped service account is a non-human identity used for automation, and it has its own API keys. A user can hold an organization-scoped API key without any service account being involved. | ||
| </Note> | ||
|
|
||
| Organization-scoped API keys limit the damage a leaked key can do. A personal API key works in every organization its owner belongs to, so a key exposed in a public repository can reach resources in an unrelated organization. An organization-scoped key only works in the organization it was created for. | ||
|
|
||
| Organization-scoped API keys are available in Multi-tenant Cloud for Enterprise organizations, and W&B enables them per organization. If you don't see the options described in the following sections, contact your W&B account team. | ||
|
|
||
| ## Find and manage API keys | ||
|
|
||
| Organization admins, team admins, and members manage keys from the **API Keys** tab. | ||
|
|
||
| <Tabs> | ||
| <Tab title="Multi-tenant Cloud"> | ||
| 1. Click your profile icon in the upper right, then select your organization. | ||
| 2. Go to your organization's account settings. | ||
| 3. Click the **API Keys** tab. | ||
| </Tab> | ||
| <Tab title="Dedicated Cloud and Self-Managed"> | ||
| - Go to `/org/api-keys` on your W&B host. | ||
| </Tab> | ||
| </Tabs> | ||
|
|
||
| To find only your own personal API keys, click your profile icon, then click **User Settings** and scroll to **API Keys**. See [User settings](/platform/app/settings-page/user-settings#api-keys). | ||
|
|
||
| <Note> | ||
| Users whose only role is billing admin can't see the **API Keys** tab. | ||
|
mdlinville marked this conversation as resolved.
Outdated
|
||
| </Note> | ||
|
|
||
| ### Key visibility by role | ||
|
|
||
| The keys listed in the **API Keys** tab depend on your role: | ||
|
|
||
| | Role | Can see | | ||
| | --- | --- | | ||
| | Member | Their own organization-scoped keys | | ||
| | Team admin | Their own organization-scoped keys, and keys for service accounts in teams they administer | | ||
| | Organization admin | All organization-scoped keys in the organization, including organization service account keys | | ||
|
mdlinville marked this conversation as resolved.
Outdated
|
||
|
|
||
| ### Read the API keys table | ||
|
|
||
| The table lists each key with the following columns: | ||
|
|
||
| - **Key name**: The descriptive name given to the key when it was created. | ||
| - **Key ID**: The first part of the key, used for identification. | ||
| - **Owner**: The user or service account that owns the key. | ||
| - **Last used**: When the key most recently authenticated a request. | ||
| - **Created on**: When the key was created. | ||
|
|
||
| <Note> | ||
| For security, the table shows only the key ID. W&B displays the full secret key once, when you create it. If you no longer have the full secret for a key, create a new key instead. | ||
|
mdlinville marked this conversation as resolved.
Outdated
|
||
| </Note> | ||
|
|
||
| To narrow the list, type in the search field to match a key name, key ID, or owner, or click **Filters** to filter by attributes such as key type. | ||
|
|
||
| ### Create an API key | ||
|
|
||
| 1. Go to the **API Keys** tab. | ||
| 2. Click **New key**. | ||
| 3. Give the key a descriptive name. | ||
| 4. Click **Create**. | ||
| 5. Copy the key immediately and store it securely. | ||
|
|
||
| <ApiKeyViewOnceWarning/> | ||
|
|
||
| In Multi-tenant Cloud, keys you create from this tab are scoped to the organization you're viewing. Create a separate key for each organization you work in. | ||
|
|
||
| ### Delete API keys | ||
|
mdlinville marked this conversation as resolved.
|
||
|
|
||
| Delete a key when you no longer need it, or immediately if it may have been exposed. | ||
|
|
||
| To delete a single key, find it in the table, open the actions menu at the end of its row, then select the delete action and confirm. | ||
|
|
||
| To delete several keys at once: | ||
|
|
||
| 1. Select the checkbox next to each key you want to delete. | ||
| 2. Click **Delete**. The button shows the number of keys you selected. | ||
| 3. Confirm the deletion. | ||
|
|
||
| <Warning> | ||
| Deleting a key immediately revokes access for any script or service that uses it. Update your systems to use a replacement key before you delete the old one. | ||
| </Warning> | ||
|
|
||
| ## Restrict how members use API keys | ||
|
|
||
| Organization admins can restrict key creation and use. The available restrictions differ by deployment type, and each is set through the `updateOrganizationPrivacySettings` GraphQL mutation rather than through the W&B App. | ||
|
|
||
| ### Require organization-scoped API keys | ||
|
|
||
| Available in **Multi-tenant Cloud** for Enterprise organizations. | ||
|
|
||
| When enabled, only organization-scoped API keys can access the organization's resources. Personal API keys that a member uses across several organizations no longer work against this organization, which prevents a key leaked from elsewhere from reaching your data. | ||
|
|
||
| Replace `[ORGANIZATION-ID]` with the ID of your organization. | ||
|
|
||
| ```graphql | ||
| mutation RequireOrgScopedAPIKeys { | ||
| updateOrganizationPrivacySettings( | ||
| input: {organizationId: "[ORGANIZATION-ID]", requireOrgScopedAPIKeys: true} | ||
| ) { | ||
| success | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| This setting requires that organization-scoped API keys are already enabled for your organization. Contact your W&B account team to confirm. | ||
|
|
||
| ### Disable API key creation | ||
|
|
||
| Available in **Dedicated Cloud** and **Self-Managed** v0.84.0 and above. | ||
|
|
||
| When enabled, members of the organization can't create new API keys. Existing keys keep working, so turning this on doesn't interrupt running jobs. Use it when your organization issues keys through a controlled process and you want to prevent members from creating their own. | ||
|
|
||
| Replace `[ORGANIZATION-ID]` with the ID of your organization. | ||
|
|
||
| ```graphql | ||
| mutation DisableAPIKeyCreation { | ||
| updateOrganizationPrivacySettings( | ||
| input: {organizationId: "[ORGANIZATION-ID]", disableApiKeyCreation: true} | ||
| ) { | ||
| success | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| A member who tries to create a key after you enable this setting receives the following error: | ||
|
|
||
| ```text | ||
| API key creation has been disabled by your organization administrator | ||
| ``` | ||
|
|
||
| To restrict service account creation as well, see [`GORILLA_DISABLE_TEAM_SERVICE_ACCOUNT_CREATION`](/platform/hosting/iam/advanced_env_vars), which prevents the creation of new team-scoped service accounts in Dedicated Cloud and Self-Managed v0.83.0 and above. | ||
|
|
||
| ## Availability | ||
|
|
||
| API key capabilities differ by deployment type and, in Multi-tenant Cloud, by subscription. The following table summarizes where each capability is available. | ||
|
|
||
| | Capability | Multi-tenant Cloud | Dedicated Cloud | Self-Managed | | ||
| | --- | --- | --- | --- | | ||
| | Search and filter the API keys table | Yes | v0.84.0+ | v0.84.0+ | | ||
| | Create a key from the **API Keys** tab | Enterprise organizations | v0.84.0+ | v0.84.0+ | | ||
| | Delete several keys at once | Enterprise organizations | v0.84.0+ | v0.84.0+ | | ||
| | Organization-scoped API keys | Enterprise organizations | Not available | Not available | | ||
| | Require organization-scoped API keys | Enterprise organizations | Not available | Not available | | ||
| | Disable API key creation | Not available | v0.84.0+ | v0.84.0+ | | ||
|
|
||
| <ApiKeySecurity/> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.