PKI Architecture
Talos implements a multi-tier PKI with separate Certificate Authorities (CAs) for different subsystems:Why Multiple CAs?
Using separate CAs provides security isolation:- Blast radius containment - Compromise of one CA doesn’t affect others
- Role separation - Different systems use different trust anchors
- Independent rotation - CAs can be rotated independently
- Compliance - Meets security standards requiring separation of duties
Certificate Authorities
Talos generates and manages five separate CAs:1. Talos OS CA
Purpose: Authenticates clients and nodes for Talos API access Generated in:pkg/machinery/config/generate/secrets/ca.go:54
Properties:
- Organization:
talos - Validity: 10 years (87,600 hours)
- Algorithm: RSA or ECDSA
- Used for: Client certificates, node server certificates
talosctlclient certificates with roles (os:admin,os:operator,os:reader)- Node server certificates for the apid service
- Admin certificates for cluster access
2. Kubernetes CA
Purpose: Authenticates Kubernetes control plane components Generated in:pkg/machinery/config/generate/secrets/ca.go:29
Properties:
- Organization:
kubernetes - Validity: 10 years
- Algorithm: ECDSA (default)
- Used for: kube-apiserver, kubelet, controller-manager, scheduler
- API server certificates
- Kubelet client and server certificates
- Controller manager and scheduler certificates
3. etcd CA
Purpose: Secures etcd cluster communication Generated in:pkg/machinery/config/generate/secrets/ca.go:17
Properties:
- Organization:
etcd - Validity: 10 years
- Algorithm: ECDSA (default)
- Used for: etcd peer and client communication
- etcd peer certificates (inter-node communication)
- etcd client certificates (control plane access to etcd)
4. Kubernetes Aggregator CA
Purpose: Secures Kubernetes API aggregation layer Generated in:pkg/machinery/config/generate/secrets/ca.go:41
Properties:
- Common Name:
front-proxy - Validity: 10 years
- Algorithm: ECDSA (default)
- Used for: Front-proxy client authentication
- Front-proxy client certificates for API aggregation
5. Kubernetes Service Account Key
Purpose: Signs Kubernetes service account tokens Generated in:pkg/machinery/config/generate/secrets/bundle.go:241
Properties:
- Type: RSA (legacy) or ECDSA key pair
- Not a CA (just a signing key)
- Used for: Signing and verifying service account JWT tokens
Certificate Types
Client Certificates
Used bytalosctl to authenticate to Talos nodes:
Structure:
pkg/machinery/config/generate/secrets/ca.go:65
The organization field determines the role:
os:admin- Full access to all APIsos:operator- Management operations without secret accessos:reader- Read-only access to non-sensitive APIsos:etcd:backup- Permission to create etcd backups
Client certificates are short-lived (365 days by default) to limit the impact of credential compromise. See
pkg/machinery/constants for TalosAPIDefaultCertificateValidityDuration.Server Certificates
Used by Talos nodes to secure the API endpoint: Structure:- All non-loopback IP addresses on the node
- Additional SANs specified in
machine.certSANsconfiguration
Node Certificates
Generated during bootstrap and renewed automatically:- Node requests a certificate from trustd
- trustd validates the bootstrap token
- trustd issues a short-lived certificate
- Node uses certificate for API operations
- Certificate is renewed before expiration
Secrets Bundle
The secrets bundle contains all PKI material for a cluster: Structure (frompkg/machinery/config/generate/secrets/secrets.go):
Certificate Management
Bootstrap Process
When a new node joins the cluster:-
Initial Trust: Node is configured with:
machine.token- Bootstrap token for authenticationmachine.ca- Talos OS CA certificate
- Certificate Request: Node sends CSR to trustd service
- Validation: trustd validates the bootstrap token
- Issuance: trustd signs the CSR and returns certificate
- Renewal: Node automatically renews before expiration
Certificate Rotation
Talos handles certificate rotation automatically: Node Certificates:- Automatically renewed before expiration
- No manual intervention required
- Rotation is transparent to workloads
- Must be regenerated manually
- Default validity: 365 days
- Generate new certificates with
talosctl config new
- Add New CA: Configure
machine.acceptedCAswith new CA - Wait for Propagation: Ensure all nodes trust new CA
- Issue New Certificates: Sign new certificates with new CA
- Replace Old CA: Update
machine.cato new CA - Remove Old CA: After all certificates are replaced
CA rotation is a multi-step process to maintain cluster availability. Use
machine.acceptedCAs to trust both old and new CAs during transition.Accepted CAs
Talos supports multiple trusted CAs for rotation: Configuration:- CA rotation without downtime
- Multi-datacenter deployments with separate CAs
- Gradual migration to new PKI
pkg/machinery/config/types/v1alpha1/v1alpha1_types.go:254 for the config structure.
Certificate Inspection
View Client Certificate
Inspect your talosconfig certificate:View Node Certificate
Inspect a node’s server certificate:Verify Certificate Chain
Validate a certificate against the CA:Troubleshooting
Certificate Expired
Symptoms:- Nodes automatically renew certificates
- If renewal fails, check trustd service logs:
talosctl logs trustd
Certificate Verification Failed
Symptoms:- Verify you’re using the correct talosconfig
- Check that
machine.camatches the signing CA - Ensure CA certificate is valid:
Missing Client Auth Extended Key Usage
Symptoms:internal/app/apid/main.go:265 for the enforcement of this check.
Best Practices
Certificate Validity
- Use short-lived certificates (365 days or less)
- Implement automated renewal processes
- Monitor certificate expiration dates
CA Protection
- Store CA private keys in secure, encrypted storage
- Limit access to CA keys to essential personnel
- Consider using HSM for CA key storage in production
- Implement audit logging for CA operations
Certificate Distribution
- Use secure channels to distribute certificates
- Rotate certificates if compromise is suspected
- Implement certificate revocation if needed
Monitoring
Monitor certificate health:Advanced Topics
Custom CA
You can use existing CAs instead of generating new ones:pkg/machinery/config/generate/secrets/bundle.go:60 for implementation details.
Certificate Renewal Configuration
Certificate renewal is automatic but can be observed:Offline Certificate Generation
Generate certificates for air-gapped environments:Related Resources
Authentication
Learn about mTLS authentication and talosconfig
Security Overview
Understand the overall security model