Manage certificates
Temporal Cloud requires security certificates for secure access and communication.
Temporal Cloud access is secured by the mutual Transport Layer Security (mTLS) protocol, which requires a CA certificate from the user.
A Worker Process requires a CA certificate and private key to connect to Temporal Cloud. Temporal Cloud does not require an exchange of secrets; only the certificates produced by private keys are used for verification.
An expired root CA certificate invalidates all downstream certificates.
An expired end-entity certificate prevents a Temporal Client from connecting to a Namespace or starting a Workflow Execution. If the client is on a Worker, any current Workflow Executions that are processed by that Worker either run indefinitely without making progress until the Worker resumes or fail because of timeouts.
To update certificates, see How to add, update, and remove certificates in a Temporal Cloud Namespace.
All certificates used by Temporal Cloud must meet the following requirements.
Requirements for CA certificates in Temporal Cloud
Certificates provided to Temporal for your Namespaces must meet the following requirements.
CA certificates
A CA certificate is a type of X.509v3 certificate used for secure communication and authentication. In Temporal Cloud, CA certificates are required for configuring mTLS.
CA certificates must meet the following criteria:
- The certificates must be X.509v3.
- Each certificate in the bundle must be either a root certificate or issued by another certificate in the bundle.
- Each certificate in the bundle must include
CA: true
. - A certificate cannot be a well-known CA (such as DigiCert or Let's Encrypt) unless the user also specifies certificate filters.
- The signing algorithm must be either RSA or ECDSA and must include SHA-256 or stronger message authentication. SHA-1 and MD5 cannot be used.
- The certificates cannot be generated with a passphrase.
A certificate bundle can contain up to 16 CA certificates. A certificate bundle can have a maximum payload size of 32 KB before base64 encoding.
End-entity certificates
An end-entity certificate is a type of X.509v3 certificate used by clients to authenticate themselves. Temporal Cloud lets you limit access to specific end-entity certificates by using certificate filters.
An end-entity (leaf) certificate must meet the following criteria:
- The certificate must be X.509v3.
- Basic constraints must include
CA: false
. - The key usage must include Digital Signature.
- The signing algorithm must be either RSA or ECDSA and must include SHA-256 or stronger message authentication. SHA-1 and MD5 cannot be used.
When a client presents an end-entity certificate, and the whole certificate chain is constructed, each certificate in the chain (from end-entity to the root) must have a unique Distinguished Name.
Distinguished Names are not case sensitive; that is, uppercase letters (such as ABC) and lowercase letters (such as abc) are equivalent.
How to issue root CA and end-entity certificates
Temporal Cloud authenticates a client connection by validating the client certificate against one or more CA certificates that are configured for the specified Namespace.
Choose one of the following options to generate and manage the certificates:
Option 1: You already have certificate management infrastructure
If you have existing certificate management infrastructure that supports issuing CA and end-entity certificates, export the CA and generate an end-entity certificates using your existing tools.
Ensure that the CA certificate is long-lived and that the end-entity certificate expires before the CA certificate.
Follow the instructions to upload the CA certificate and configure your client with the end-entity certificate.
Option 2: You don't have certificate management infrastructure
If you don't have an existing certificate management infrastructure, issue the CA and end-entity certificates using tcld or open source tools such as certstrap.
Use tcld to generate certificates
You can generate CA and end-entity certificates by using tcld.
Although Temporal Cloud supports long-lived CA certificates, a CA certificate generated by tcld has a maximum duration of 1 year (-d 1y
).
You must set an end-entity certificate to expire before its root CA certificate, so specify its duration appropriately.
To create a new CA certificate, use tcld gen ca
.
mkdir temporal-certs
cd temporal-certs
tcld gen ca --org temporal -d 1y --ca-cert ca.pem --ca-key ca.key
The contents of the generated ca.pem
should be pasted into the "CA Certificates" section of your Namespace settings page.
To create a new end-entity certificate, use tcld gen leaf
.
tcld gen leaf --org temporal -d 364d --ca-cert ca.pem --ca-key ca.key --cert client.pem --key client.key
You can now use the generated CA certificate (ca.pem
) with Temporal Cloud and configure your client with these certs (client.pem
, client.key
).
Upload the contents of the ca.pem
file to the CA Certificates section of your Namespace settings.
Follow the instructions to upload the CA certificate and configure your client with the end-entity certificate.
Use certstrap to generate certificates
Temporal Cloud requires client certificates for authentication and secure communication. Certstrap is a popular and easy-to-use tool for issuing certificates.
Before you begin, ensure you have installed Certstrap by following the instructions in the Certstrap README.
A Certificate Authority (CA) is a trusted entity that issues digital certificates. These certificates certify the ownership of a public key by the named subject of the certificate. End-entity certificates are issued and signed by a CA, and they are used by clients to authenticate themselves to Temporal Cloud.
Create a self-signed CA certificate and use it to issue an end-entity certificate for your Temporal Cloud namespace.
1. Create a Certificate Authority (CA)
Create a new Certificate Authority (CA) using Certstrap:
./certstrap init --common-name "CertAuth"
This command creates a self-signed CA certificate named CertAuth.crt
in the out
folder within the Certstrap directory.
This CA certificate will be used to sign and issue end-entity certificates.
2. Set the Namespace Name
Set the Namespace Name as the common name for the end-entity certificate:
- macOS
- Windows
For Linux or macOS:
export NAMESPACE_NAME=your-namespace
For Windows:
set NAMESPACE_NAME=your-namespace
Replace your-namespace
with the name of your Temporal Cloud namespace.
3. Request an End-Entity Certificate
Next, request a certificate with a common name equal to the Namespace Name:
./certstrap request-cert --common-name ${NAMESPACE_NAME}
This command creates a Certificate Signing Request (CSR) for an end-entity certificate, but not the actual certificate itself.
4. Sign the Certificate Request
Sign the certificate request and generate the end-entity certificate:
./certstrap sign ${NAMESPACE_NAME} --CA "CertAuth"
This command takes the CSR from the previous step and signs it with your CA (CertAuth
).
The result is an end-entity certificate (your-namespace.crt
) that is now a valid certificate signed by your CA.