Transport Layer Security (TLS)
Server TLS Configuration
Configure TLS for each service group:TLS Options
Server Configuration:certFile- Server certificate (PEM format)keyFile- Private key (PEM format)certData- Base64 encoded certificate (alternative to file)keyData- Base64 encoded key (alternative to file)clientCAFiles- CA certificates for client verificationclientCAData- Base64 encoded CA certificatesrequireClientAuth- Enable mutual TLS (mTLS)
serverName- Expected server name in certificate (for SNI)rootCAFiles- CA certificates to verify serverrootCAData- Base64 encoded CA certificatesdisableHostVerification- Skip hostname verification (not recommended)forceTLS- Use TLS even without client certificates
Per-Host TLS Overrides
Different TLS settings for different hostnames:System Worker TLS
Configure TLS for system workers:Remote Cluster TLS
For cross-cluster replication:Certificate Expiration Monitoring
certificates_expired- Number of expired certificatescertificates_expiring- Certificates expiring within warning window
Authentication
JWT Authentication
Temporal supports JWT (JSON Web Token) authentication:Custom Claim Mapper
Implement theClaimMapper interface to extract claims from auth tokens:
DefaultJWTClaimMapper) extracts:
sub- Subject identifieraud- Audience validationexp- Token expirationiat- Issued at time- System and namespace roles from custom claims
Authorization Headers
Configure custom header names:Authorization
Role-Based Access Control
Temporal implements role-based authorization with three permission levels: System-Level Roles:Admin- Full system access, all operationsWriter- Non-admin write operationsReader- Read-only operations
Admin- Full namespace accessWriter- Non-admin operations in namespaceReader- Read-only operations in namespace
Authorization Configuration
Default Authorization Rules
TheDefaultAuthorizer implements these rules:
- Health check APIs - Always allowed (no auth required)
- System Admin - Access all APIs, all namespaces
- System Writer - Non-admin APIs, all namespaces
- System Reader - Read-only APIs, all namespaces
- Namespace Admin - All APIs in their namespaces
- Namespace Writer - Non-admin APIs in their namespaces
- Namespace Reader - Read-only APIs in their namespaces
API Access Levels
Cluster-Scoped APIs:- Require system-level roles
- Examples: namespace management, cluster operations
- Require namespace-level or system-level roles
- Examples: workflow operations, visibility queries
Claims Structure
Custom Authorizer
Implement theAuthorizer interface for custom logic:
Cross-Namespace Authorization
For workflows that interact across namespaces:SignalExternalWorkflowExecutionto different namespaceStartChildWorkflowExecutionin different namespaceRequestCancelExternalWorkflowExecutionfor different namespace
Authorization Metrics
Monitor authorization:Expose Authorization Errors
false, returns generic “Request unauthorized” message. When true, includes specific authorization failure details.
Database Encryption
At-Rest Encryption
Configure encryption at the database level:- Cassandra
- PostgreSQL
- MySQL
Payload Encryption
Implement application-level encryption using data converters in SDK clients. Temporal Server stores payloads as opaque bytes.Security Best Practices
1. Enable mTLS Everywhere
2. Rotate Certificates Regularly
- Set
refreshIntervalto reload certificates - Monitor expiration metrics
- Automate certificate renewal (e.g., cert-manager)
3. Use Strong JWT Algorithms
Supported algorithms:- RS256, RS384, RS512 (RSA signatures)
- ES256, ES384, ES512 (ECDSA signatures)
- PS256, PS384, PS512 (RSA-PSS signatures)
- HS256 (symmetric, shared secrets)
- None algorithm
4. Implement Least Privilege
- Grant minimum required roles
- Use namespace-scoped roles over system roles
- Separate admin operations to dedicated accounts
5. Network Segmentation
- Isolate internode traffic on private network
- Expose frontend only through load balancer
- Use firewall rules to restrict access
6. Audit Logging
Enable structured logging to capture:- Authorization decisions
- Failed authentication attempts
- Admin operations
7. Rate Limiting
Configure via dynamic config:8. Secure Database Access
- Use dedicated database credentials per Temporal service
- Enable database audit logging
- Restrict database network access
- Use encrypted connections
- Regularly rotate database passwords
9. Secrets Management
Store secrets externally:- Kubernetes Secrets
- HashiCorp Vault
- AWS Secrets Manager
- Azure Key Vault
Troubleshooting
TLS Handshake Failures
Symptoms:x509: certificate signed by unknown authorityx509: certificate is valid for X, not Ytls: bad certificate
- Verify CA certificate chain
- Check
serverNamematches certificate CN/SAN - Ensure
requireClientAuthmatches client configuration - Validate certificate expiration dates
Authorization Denied
Symptoms:Request unauthorizedservice_errors_unauthorizedmetrics increasing
- Check JWT signature and expiration
- Verify audience claim matches expected value
- Review role mappings in claims
- Enable
exposeAuthorizerErrorsfor debugging (development only) - Check authorization metrics with namespace tags
Certificate Rotation
Temporal reloads certificates based onrefreshInterval. To force reload, restart the service.
See Also
- Monitoring - Authorization metrics
- Configuration Reference - Full config options
- SDK Security - Client-side security