Rotate the JWT Signing Keys
OpenMetadata signs the JWT tokens it issues with one RSA key pair, set injwtTokenConfiguration. These tokens include user sessions, personal access tokens, and bot tokens such as the one the ingestion-bot uses. Rotate the key pair when you replace the default keys shipped for testing, when the private key may have leaked, or when your security policy requires it.
Rotation is a hard cut. You stop every server, start them all with the new key pair, regenerate the bot tokens, and redeploy the ingestion pipelines. Tokens signed by the old key stop working.
Before You Start
Check the following before you rotate the keys:- You have picked a time when bot downtime is acceptable.
- You have shell access to a host, container, or pod that can run
./bootstrap/openmetadata-ops.sh. It needs the same configuration as the servers and network access to the server API. A server container or pod meets both conditions. pipelineServiceClientConfiguration.metadataApiEndpoint(SERVER_HOST_API_URL) is set in that configuration. Thedeploy-pipelinescommand redeploys pipelines through this endpoint.- To regenerate the bot tokens with a command, you need OpenMetadata 2.0.10 or later. On earlier 2.0 releases, you regenerate them in the UI.
Step 1: Create a New Key Pair
OpenMetadata reads the private key as DER PKCS#8 and the public key as DER X.509. Use keys of 2048 bits or more:JWT_KEY_ID, so that services that cache the JWKS fetch the new key. The Enable JWT Tokens page asks you to keep the key ID unchanged across upgrades. A key rotation is the exception.
Keep private_key.der secret. Make it readable only by the user that runs the OpenMetadata server.
Step 2: Restart Every Server with the New Keys
Stop every OpenMetadata server before you start any server with the new keys. Do not use a rolling restart. During a rolling restart, a restarted server can fetch the old public key from a server that has not restarted yet. This happens whenauthenticationConfiguration.publicKeyUrls (AUTHENTICATION_PUBLIC_KEYS) points to an OpenMetadata URL behind a load balancer. The server caches that key for up to 24 hours and keeps accepting old user sessions and personal access tokens. The default localhost JWKS URL avoids this problem.
Set the following values in the configuration of every server and of the host that runs openmetadata-ops.sh. All of them must hold the same values.
Follow the steps for your deployment:
- Bare Metal
- Docker
- Kubernetes
- Stop every OpenMetadata server.
- Copy
private_key.derandpublic_key.derto the OpenMetadataconfdirectory of each server, or to the paths set inRSA_PRIVATE_KEY_FILE_PATHandRSA_PUBLIC_KEY_FILE_PATH. - Set
JWT_KEY_ID, orjwtTokenConfiguration.keyIdinconf/openmetadata.yaml, to the new key ID. - Start every server.
- Users get
401 Unauthorizedon their old sessions and must sign in again. - Holders of personal access tokens must create new tokens.
- Bots stay rejected until you complete step 3.
Step 3: Regenerate the Bot Tokens
Give every bot a new token signed by the new key. The method depends on your OpenMetadata version.- OpenMetadata 2.0.10 and Later
- Earlier 2.0 Releases
Run The command gives every bot that uses JWT authentication a new token, signed by the key in its configuration. Use
regenerate-bot-tokens from the OpenMetadata server directory, with the same configuration the servers use:--expiry to set the expiry of the new tokens: OneHour, One, Seven, Thirty, Sixty, Ninety, or Unlimited. The default is Unlimited.The command prints one row per bot with one of these outcomes:SUCCESS: The bot has a new token.SKIPPED: The bot has no bot user or doesn’t use JWT authentication.FAILED: The token wasn’t replaced. The details column gives the reason.
0 when no bot failed and 1 otherwise.Step 4: Redeploy the Ingestion Pipelines
Deployed pipelines still carry the oldingestion-bot token. Redeploy them so that they use the new one:
regenerate-bot-tokens command, for example with docker exec or kubectl exec. The command deploys every pipeline registered in OpenMetadata.
For pipelines managed outside OpenMetadata, replace the bot token in their configuration and redeploy them through their own scheduler.
Step 5: Check the Result
Confirm the following:/api/v1/system/config/jwkson each server lists only the new key ID.- Every bot has a new token. With the command, every bot shows as
SUCCESS, orSKIPPEDif it doesn’t use JWT authentication. - Ingestion pipelines run again, on schedule or when you trigger them manually.
Update Tokens Stored Outside OpenMetadata
The new keys invalidate copies of old tokens that other systems hold. Update the following:- Personal access tokens: Rotation doesn’t re-sign or delete personal access tokens. The old tokens can still appear as unexpired in the UI, but requests that use them return
401 Unauthorized. Ask their owners to revoke the old tokens, create new ones, and update their clients. - Copied bot tokens: Copy the new token from Settings > Bots to every system that holds the old one, such as CI jobs and external pipelines.
- Airflow lineage backend: Replace
jwt_tokenin the[lineage]section ofairflow.cfg, ormetadata_config.securityConfig.jwtTokenin the JSON file set inOPENMETADATA_LINEAGE_CONFIG. Pipeline redeployment doesn’t update these values. - Airflow
OpenMetadataHook: Replace the password of the Airflow connection that the hook uses,openmetadata_defaultby default. Pipeline redeployment doesn’t update this connection. - Services that verify OpenMetadata tokens through the JWKS: Make sure they reload the JWKS and accept the new key ID. Remove any cached or pinned copy of the old public key, so that they reject tokens signed by it.