Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/support/gateway-rotate-key-copy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 27 additions & 1 deletion support/rotate-credentials.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -229,14 +229,40 @@ Create the new credential at the destination, update the Portkey configuration,

For [hybrid deployments](/self-hosting/hybrid-deployments/architecture), rotate every secret in your deployment configuration:

- **`PORTKEY_CLIENT_AUTH`**: the credential your gateway uses to sync with the Portkey control plane. Contact [Portkey support](/support/contact-us) to have it reissued, then update your deployment and restart the gateway.
- **`PORTKEY_CLIENT_AUTH`**: the credential your gateway uses to sync with the Portkey control plane. See [Rotate the gateway client auth key](#rotate-the-gateway-client-auth-key).
- **Log store credentials:** for example `LOG_STORE_ACCESS_KEY` and `LOG_STORE_SECRET_KEY` (S3, GCS HMAC, or Azure storage).
- **Cache and database credentials:** Redis, and any database your deployment uses.
- **Provider keys and other values in your environment files, Helm values, or Kubernetes secrets.**
- **Test keys:** replace the `PORTKEY_API_KEY` and `OPENAI_API_KEY` values from any smoke-test scripts.

Redeploy the gateway after updating secrets and confirm it registers and serves requests.

### Rotate the gateway client auth key

<Steps>
<Step title="Open the gateway deployment">
Go to **Admin Settings > Gateway Registration** and open the deployment.
<Frame>
<img src="/images/support/gateway-registration-rotate-key.png" alt="Gateway Registration deployment page with the Rotate Key button under Gateway Authentication" />
</Frame>
</Step>
<Step title="Rotate the key">
Under **Gateway Authentication**, click **Rotate Key**. Optionally, set a **Grace period (hours)** from 0 to 24. This is how long the previous key keeps working. Leave it empty to use the default. Click **Confirm Rotation**.
<Frame>
<img src="/images/support/gateway-rotate-key-grace-period.png" alt="Rotate Key dialog with the Grace period (hours) field" />
</Frame>
</Step>
<Step title="Copy the new key">
Copy the new key and click **Done**. The key is shown only once.
<Frame>
<img src="/images/support/gateway-rotate-key-copy.png" alt="New gateway auth key shown once with a copy button" />
</Frame>
</Step>
<Step title="Update every deployed gateway and Data Service">
Update `PORTKEY_CLIENT_AUTH` to the new key for every gateway and optional Data Service instance that uses this deployment. If your deployment references a secret store, update the underlying credential while preserving secret references and any other fields in the secret. Restart all consuming services so they load the new key before the grace period ends. Services still using the old key lose control-plane authentication once it expires.
</Step>
</Steps>

## After rotating

1. **Confirm the old credentials fail.** Wait at least a few minutes for gateway sync and caches to refresh, then send a request with each old Portkey API key through every gateway, including self-hosted ones. Expect a `401`.
Expand Down
Loading