Skip to content

Commit b56ddae

Browse files
committed
added statement about certificate ownership/support
1 parent 7ad934a commit b56ddae

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

articles/aks/certificate-rotation.md

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ title: Certificate Rotation in Azure Kubernetes Service (AKS)
33
description: Learn certificate rotation in an Azure Kubernetes Service (AKS) cluster.
44
services: container-service
55
ms.topic: article
6-
ms.date: 5/10/2022
6+
ms.date: 09/12/2022
77
---
88

99
# Certificate rotation in Azure Kubernetes Service (AKS)
1010

11-
Azure Kubernetes Service (AKS) uses certificates for authentication with many of its components. If you have a RBAC-enabled cluster built after March 2022 it is enabled with certificate auto-rotation. Periodically, you may need to rotate those certificates for security or policy reasons. For example, you may have a policy to rotate all your certificates every 90 days.
11+
Azure Kubernetes Service (AKS) uses certificates for authentication with many of its components. If you have a RBAC-enabled cluster built after March 2022, it's enabled with certificate auto-rotation. Periodically, you may need to rotate those certificates for security or policy reasons. For example, you may have a policy to rotate all your certificates every 90 days.
1212

1313
> [!NOTE]
14-
> Certificate auto-rotation will *only* be enabled by default for RBAC enabled AKS clusters.
14+
> Certificate auto-rotation will *only* be enabled by default for RBAC enabled AKS clusters.
1515
1616
This article shows you how certificate rotation works in your AKS cluster.
1717

@@ -30,36 +30,41 @@ AKS generates and uses the following certificates, Certificate Authorities, and
3030
* Each node uses a Service Account (SA) token, which is signed by the Cluster CA.
3131
* The `kubectl` client has a certificate for communicating with the AKS cluster.
3232

33+
Certificates mentioned above are maintained by Microsoft, except the cluster certificate, which you have to maintain.
34+
3335
> [!NOTE]
3436
> AKS clusters created prior to May 2019 have certificates that expire after two years. Any cluster created after May 2019 or any cluster that has its certificates rotated have Cluster CA certificates that expire after 30 years. All other AKS certificates, which use the Cluster CA for signing, will expire after two years and are automatically rotated during an AKS version upgrade which happened after 8/1/2021. To verify when your cluster was created, use `kubectl get nodes` to see the *Age* of your node pools.
35-
>
36-
> Additionally, you can check the expiration date of your cluster's certificate. For example, the following bash command displays the client certificate details for the *myAKSCluster* cluster in resource group *rg*
37+
>
38+
> Additionally, you can check the expiration date of your cluster's certificate. For example, the following bash command displays the client certificate details for the *myAKSCluster* cluster in resource group *rg*:
3739
> ```console
3840
> kubectl config view --raw -o jsonpath="{.users[?(@.name == 'clusterUser_rg_myAKSCluster')].user.client-certificate-data}" | base64 -d | openssl x509 -text | grep -A2 Validity
3941
> ```
4042
4143
* Check expiration date of apiserver certificate
44+
4245
```console
4346
curl https://{apiserver-fqdn} -k -v 2>&1 |grep expire
4447
```
4548
4649
* Check expiration date of certificate on VMAS agent node
50+
4751
```azurecli
4852
az vm run-command invoke -g MC_rg_myAKSCluster_region -n vm-name --command-id RunShellScript --query 'value[0].message' -otsv --scripts "openssl x509 -in /etc/kubernetes/certs/apiserver.crt -noout -enddate"
4953
```
5054

5155
* Check expiration date of certificate on one virtual machine scale set agent node
56+
5257
```azurecli
5358
az vmss run-command invoke -g MC_rg_myAKSCluster_region -n vmss-name --instance-id 0 --command-id RunShellScript --query 'value[0].message' -otsv --scripts "openssl x509 -in /etc/kubernetes/certs/apiserver.crt -noout -enddate"
5459
```
5560

5661
## Certificate Auto Rotation
5762

58-
For AKS to automatically rotate non-CA certificates, the cluster must have [TLS Bootstrapping](https://kubernetes.io/docs/reference/access-authn-authz/kubelet-tls-bootstrapping/) which has been enabled by default in all Azure regions.
63+
For AKS to automatically rotate non-CA certificates, the cluster must have [TLS Bootstrapping](https://kubernetes.io/docs/reference/access-authn-authz/kubelet-tls-bootstrapping/) which has been enabled by default in all Azure regions.
5964

60-
> [!Note]
65+
> [!NOTE]
6166
> If you have an existing cluster you have to upgrade that cluster to enable Certificate Auto-Rotation.
62-
> Do not disable bootstrap to keep your auto-rotation enabled.
67+
> Do not disable bootstrap to keep your auto-rotation enabled.
6368
6469
For any AKS clusters created or upgraded after March 2022 Azure Kubernetes Service will automatically rotate non-CA certificates on both the control plane and agent nodes within 80% of the client certificate valid time, before they expire with no downtime for the cluster.
6570

@@ -72,14 +77,14 @@ To verify if TLS Bootstrapping is enabled on your cluster browse to the followin
7277

7378
To access agent nodes, see [Connect to Azure Kubernetes Service cluster nodes for maintenance or troubleshooting][aks-node-access] for more information.
7479

75-
> [!Note]
80+
> [!NOTE]
7681
> The file path may change as Kubernetes version evolves in the future.
7782
78-
Once a region is configured, create a new cluster or upgrade an existing cluster with `az aks upgrade` to set that cluster for auto-certificate rotation. A control plane and node pool upgrade is needed to enable this feature.
83+
Once a region is configured, create a new cluster or upgrade an existing cluster with `az aks upgrade` to set that cluster for auto-certificate rotation. A control plane and node pool upgrade is needed to enable this feature.
7984

8085
```azurecli
8186
az aks upgrade -g $RESOURCE_GROUP_NAME -n $CLUSTER_NAME
82-
```
87+
```
8388

8489
### Limitation
8590

@@ -131,7 +136,6 @@ kubectl get nodes
131136

132137
This article showed you how to automatically rotate your cluster's certificates, CAs, and SAs. You can see [Best practices for cluster security and upgrades in Azure Kubernetes Service (AKS)][aks-best-practices-security-upgrades] for more information on AKS security best practices.
133138

134-
135139
[azure-cli-install]: /cli/azure/install-azure-cli
136140
[az-aks-get-credentials]: /cli/azure/aks#az_aks_get_credentials
137141
[az-extension-add]: /cli/azure/extension#az_extension_add

0 commit comments

Comments
 (0)