You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> The Microsoft Azure Management application applies to [Azure PowerShell](/powershell/azure/what-is-azure-powershell), which calls the [Azure Resource Manager API](../../azure-resource-manager/management/overview.md). It does not apply to [Azure AD PowerShell](/powershell/azure/active-directory/overview), which calls the [Microsoft Graph API](/graph/overview).
There is also an option to activate Privileged Identity Management using PowerShell. You may find more details as documented in the article [PowerShell for Azure AD roles PIM](powershell-for-azure-ad-roles.md).
166
+
167
+
The following is a sample script for how to activate Azure resource roles using PowerShell.
168
+
169
+
```powershell
170
+
$managementgroupID = "<management group ID" # Tenant Root Group
Copy file name to clipboardExpand all lines: articles/aks/certificate-rotation.md
+25-20Lines changed: 25 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,15 +3,15 @@ title: Certificate Rotation in Azure Kubernetes Service (AKS)
3
3
description: Learn certificate rotation in an Azure Kubernetes Service (AKS) cluster.
4
4
services: container-service
5
5
ms.topic: article
6
-
ms.date: 5/10/2022
6
+
ms.date: 09/12/2022
7
7
---
8
8
9
9
# Certificate rotation in Azure Kubernetes Service (AKS)
10
10
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.
12
12
13
13
> [!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.
15
15
16
16
This article shows you how certificate rotation works in your AKS cluster.
17
17
@@ -30,36 +30,41 @@ AKS generates and uses the following certificates, Certificate Authorities, and
30
30
* Each node uses a Service Account (SA) token, which is signed by the Cluster CA.
31
31
* The `kubectl` client has a certificate for communicating with the AKS cluster.
32
32
33
+
Certificates mentioned above are maintained by Microsoft, except the cluster certificate, which you have to maintain.
34
+
33
35
> [!NOTE]
34
36
> 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*:
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.
59
64
60
-
> [!Note]
65
+
> [!NOTE]
61
66
> 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.
63
68
64
69
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.
65
70
@@ -72,14 +77,14 @@ To verify if TLS Bootstrapping is enabled on your cluster browse to the followin
72
77
73
78
To access agent nodes, see [Connect to Azure Kubernetes Service cluster nodes for maintenance or troubleshooting][aks-node-access] for more information.
74
79
75
-
> [!Note]
80
+
> [!NOTE]
76
81
> The file path may change as Kubernetes version evolves in the future.
77
82
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.
79
84
80
85
```azurecli
81
86
az aks upgrade -g $RESOURCE_GROUP_NAME -n $CLUSTER_NAME
82
-
```
87
+
```
83
88
84
89
### Limitation
85
90
@@ -105,35 +110,35 @@ az aks rotate-certs -g $RESOURCE_GROUP_NAME -n $CLUSTER_NAME
105
110
> [!IMPORTANT]
106
111
> It may take up to 30 minutes for `az aks rotate-certs` to complete. If the command fails before completing, use `az aks show` to verify the status of the cluster is *Certificate Rotating*. If the cluster is in a failed state, rerun `az aks rotate-certs` to rotate your certificates again.
107
112
108
-
Verify that the old certificates are no longer valid by running a`kubectl` command. Since you have not updated the certificates used by `kubectl`, you will see an error. For example:
113
+
Verify that the old certificates aren't valid by running any`kubectl` command. If you haven't updated the certificates used by `kubectl`, you'll see an error similar to the following example:
109
114
110
115
```console
111
-
$ kubectl get nodes
116
+
kubectl get nodes
112
117
Unable to connect to the server: x509: certificate signed by unknown authority (possibly because of "crypto/rsa: verification error" while trying to verify candidate authority certificate "ca")
113
118
```
114
119
115
-
Update the certificate used by `kubectl` by running `az aks get-credentials`.
120
+
To update the certificate used by `kubectl`, run the [az aks get-credentials][az-aks-get-credentials] command:
116
121
117
122
```azurecli
118
123
az aks get-credentials -g $RESOURCE_GROUP_NAME -n $CLUSTER_NAME --overwrite-existing
119
124
```
120
125
121
-
Verify the certificates have been updated by running a `kubectl` command, which will now succeed. For example:
126
+
To verify the certificates have been updated, run the following [kubectl get][kubectl-get] command:
122
127
123
128
```console
124
129
kubectl get nodes
125
130
```
126
131
127
132
> [!NOTE]
128
-
> If you have any services that run on top of AKS, you may need to update certificates related to those services as well.
133
+
> If you have any services that run on top of AKS, you might need to update their certificates.
129
134
130
135
## Next steps
131
136
132
137
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.
Copy file name to clipboardExpand all lines: articles/azure-monitor/containers/container-insights-agent-config.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ title: Configure Container insights agent data collection | Microsoft Docs
3
3
description: This article describes how you can configure the Container insights agent to control stdout/stderr and environment variables log collection.
4
4
ms.topic: conceptual
5
5
ms.date: 08/25/2022
6
-
ms.reviewer: aul
6
+
ms.reviewer: viviandiec
7
7
---
8
8
9
9
# Configure agent data collection for Container insights
0 commit comments