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
Copy file name to clipboardExpand all lines: articles/defender-for-cloud/kubernetes-workload-protections.md
+22-25Lines changed: 22 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,20 +21,20 @@ Microsoft Defender for Cloud includes a bundle of recommendations that are avail
21
21
22
22
## Prerequisites
23
23
24
-
-Add the [Required FQDN/application rules for Azure policy](../aks/outbound-rules-control-egress.md#azure-policy).
24
+
- Add the [Required FQDN/application rules for Azure policy](../aks/outbound-rules-control-egress.md#azure-policy).
25
25
- (For non AKS clusters) [Connect an existing Kubernetes cluster to Azure Arc](../azure-arc/kubernetes/quickstart-connect-cluster.md).
26
26
27
27
## Enable Kubernetes data plane hardening
28
28
29
29
You can enable the Azure policy for Kubernetes by one of two ways:
30
+
30
31
- Enable for all current and future clusters using plan/connector settings
31
-
-[Enabling for Azure subscriptions or on-premises](#enabling-for-azure-subscriptions-or-on-premises)
32
-
-[Enabling for GCP projects](#enabling-for-gcp-projects)
33
-
-[Enable for existing clusters using recommendations (specific clusters or all clusters)](#manually-deploy-the-add-on-to-clusters-using-recommendations-on-specific-clusters).
32
+
-[Enabling for Azure subscriptions or on-premises](#enabling-for-azure-subscriptions-or-on-premises)
33
+
-[Enabling for GCP projects](#enabling-for-gcp-projects)
34
+
-[Enable for existing clusters using recommendations (specific clusters or all clusters)](#manually-deploy-the-add-on-to-clusters-using-recommendations-on-specific-clusters).
34
35
35
36
### Enable for all current and future clusters using plan/connector settings
36
37
37
-
38
38
> [!NOTE]
39
39
> When you enable this setting, the Azure Policy for Kubernetes pods are installed on the cluster. Doing so allocates a small amount of CPU and memory for the pods to use. This allocation might reach maximum capacity, but it doesn't affect the rest of the CPU and memory on the resource.
40
40
@@ -47,7 +47,7 @@ When you enable Microsoft Defender for Containers, the "Azure Policy for Kuberne
47
47
48
48
If you disabled the "Azure Policy for Kubernetes" settings under the containers plan, you can follow the below steps to enable it across all clusters in your subscription:
49
49
50
-
1. Sign in to the [Azure portal](https://portal.azure.com).
50
+
1. Sign in to the [Azure portal](https://portal.azure.com).
51
51
52
52
1. Navigate to **Microsoft Defender for Cloud** > **Environment settings**.
53
53
@@ -63,33 +63,32 @@ If you disabled the "Azure Policy for Kubernetes" settings under the containers
63
63
64
64
:::image type="content" source="media/kubernetes-workload-protections/toggle-on-extensions.png" alt-text="Screenshot showing the toggles used to enable or disable the extensions." lightbox="media/kubernetes-workload-protections/toggle-on-extensions.png":::
65
65
66
-
#### Enabling for GCP projects
66
+
#### Enabling for GCP projects
67
67
68
68
When you enable Microsoft Defender for Containers on a GCP connector, the "Azure Policy Extension for Azure Arc" setting is enabled by default for the Google Kubernetes Engine in the relevant project. If you disable the setting on initial configuration you can enable it afterwards manually.
69
69
70
-
If you disabled the "Azure Policy Extension for Azure Arc" settings under the GCP connector, you can follow the below steps to [enable it on your GCP connector](/defender-for-containers-enable?tabs=aks-deploy-portal%2Ck8s-deploy-asc%2Ck8s-verify-asc%2Ck8s-remove-arc%2Caks-removeprofile-api&pivots=defender-for-container-gke&preserve-view=true#protect-google-kubernetes-engine-gke-clusters).
70
+
If you disabled the "Azure Policy Extension for Azure Arc" settings under the GCP connector, you can follow the below steps to [enable it on your GCP connector](defender-for-containers-enable.md?tabs=aks-deploy-portal%2Ck8s-deploy-asc%2Ck8s-verify-asc%2Ck8s-remove-arc%2Caks-removeprofile-api&pivots=defender-for-container-gke&preserve-view=true#protect-google-kubernetes-engine-gke-clusters).
71
71
72
72
### Manually deploy the add-on to clusters using recommendations on specific clusters
73
73
74
74
You can manually configure the Kubernetes data plane hardening add-on, or extension on specific cluster through the Recommendations page using the following recommendations:
75
75
76
-
-**Azure Recommendations** - `"Azure Policy add-on for Kubernetes should be installed and enabled on your clusters"`, or `"Azure policy extension for Kubernetes should be installed and enabled on your clusters"`.
76
+
-**Azure Recommendations** - `"Azure Policy add-on for Kubernetes should be installed and enabled on your clusters"`, or `"Azure policy extension for Kubernetes should be installed and enabled on your clusters"`.
77
77
-**GCP Recommendation** - `"GKE clusters should have Microsoft Defender's extension for Azure Arc installed"`.
78
78
-**AWS Recommendation** - `"EKS clusters should have Microsoft Defender's extension for Azure Arc installed"`.
79
79
80
80
Once enabled, the hardening recommendation becomes available (some of the recommendations require another configuration to work).
81
81
82
-
> [!NOTE]
82
+
> [!NOTE]
83
83
> For AWS it isn't possible to do onboarding at scale using the connector, but it can be installed on all clusters or specific clusters using the recommendation ["EKS clusters should have Microsoft Defender's extension for Azure Arc installed"](https://portal.azure.com/#blade/Microsoft_Azure_Security/RecommendationsBlade/assessmentKey/38307993-84fb-4636-8ce7-3a64466bb5cc).
84
84
85
-
86
85
**To deploy the add-on to specified clusters**:
87
86
88
87
1. From the recommendations page, search for the relevant recommendation:
89
88
-**Azure** - `Azure Kubernetes Service clusters should have the Azure Policy add-on for Kubernetes installed` or `Azure policy extension for Kubernetes should be installed and enabled on your clusters`
90
89
-**AWS** - `EKS clusters should have Microsoft Defender's extension for Azure Arc installed`
91
90
-**GCP** - `GKE clusters should have Microsoft Defender's extension for Azure Arc installed`
92
-
91
+
93
92
:::image type="content" source="./media/kubernetes-workload-protections/azure-kubernetes-service-clusters-recommendation.png" alt-text="Screenshot showing the Azure Kubernetes service clusters recommendation." lightbox="media/kubernetes-workload-protections/azure-kubernetes-service-clusters-recommendation.png":::
94
93
95
94
> [!TIP]
@@ -106,7 +105,7 @@ Once enabled, the hardening recommendation becomes available (some of the recomm
106
105
Approximately 30 minutes after the add-on installation completes, Defender for Cloud shows the clusters’ health status for the following recommendations, each in the relevant security control as shown:
107
106
108
107
> [!NOTE]
109
-
> If you're installing the add-on/extension for the first time, these recommendations will appear as new additions in the list of recommendations.
108
+
> If you're installing the add-on/extension for the first time, these recommendations will appear as new additions in the list of recommendations.
110
109
111
110
> [!TIP]
112
111
> Some recommendations have parameters that must be customized via Azure Policy to use them effectively. For example, to benefit from the recommendation **Container images should be deployed only from trusted registries**, you'll have to define your trusted registries. If you don't enter the necessary parameters for the recommendations that require configuration, your workloads will be shown as unhealthy.
@@ -130,27 +129,26 @@ Approximately 30 minutes after the add-on installation completes, Defender for C
130
129
| Privileged containers should be avoided | Manage access and permissions | No |
131
130
| Running containers as root user should be avoided | Manage access and permissions | No |
132
131
133
-
134
132
For recommendations with parameters that need to be customized, you need to set the parameters:
135
133
136
134
**To set the parameters**:
137
-
138
-
1. Sign in to the [Azure portal](https://portal.azure.com).
135
+
136
+
1. Sign in to the [Azure portal](https://portal.azure.com).
139
137
140
138
1. Navigate to **Microsoft Defender for Cloud** > **Environment settings**.
141
139
142
140
1. Select the relevant subscription.
143
141
144
142
1. From Defender for Cloud's menu, select **Security policy**.
145
-
143
+
146
144
1. Select the relevant assignment. The default assignment is `ASC default`.
147
-
145
+
148
146
1. Open the **Parameters** tab and modify the values as required.
149
147
150
148
:::image type="content" source="media/kubernetes-workload-protections/containers-parameter-requires-configuration.png" alt-text="Screenshot showing where to modify the parameters for one of the recommendations in the Kubernetes data plane hardening protection bundle." lightbox="media/kubernetes-workload-protections/containers-parameter-requires-configuration.png":::
151
149
152
150
1. Select **Review + save**.
153
-
151
+
154
152
1. Select **Save**.
155
153
156
154
**To enforce any of the recommendations**:
@@ -159,19 +157,19 @@ For recommendations with parameters that need to be customized, you need to set
159
157
160
158
:::image type="content" source="./media/defender-for-kubernetes-usage/enforce-workload-protection-example.png" alt-text="Screenshot showing the Deny option for Azure Policy parameter." lightbox="media/defender-for-kubernetes-usage/enforce-workload-protection-example.png":::
161
159
162
-
The pane to set the scope opens.
160
+
The pane to set the scope opens.
163
161
164
162
1. Set the scope and select **Change to deny**.
165
163
166
164
**To see which recommendations apply to your clusters**:
167
165
168
166
1. Open Defender for Cloud's [asset inventory](asset-inventory.md) page and set the resource type filter to **Kubernetes services**.
169
167
170
-
1. Select a cluster to investigate and review the available recommendations available for it.
168
+
1. Select a cluster to investigate and review the available recommendations available for it.
171
169
172
170
When you view a recommendation from the workload protection set, the number of affected pods ("Kubernetes components") is listed alongside the cluster. For a list of the specific pods, select the cluster and then select **Take action**.
173
171
174
-
:::image type="content" source="./media/defender-for-kubernetes-usage/view-affected-pods-for-recommendation.gif" alt-text="Screenshot showing where to view the affected pods for a Kubernetes recommendation.":::
172
+
:::image type="content" source="./media/defender-for-kubernetes-usage/view-affected-pods-for-recommendation.gif" alt-text="Screenshot showing where to view the affected pods for a Kubernetes recommendation.":::
175
173
176
174
**To test the enforcement, use the two Kubernetes deployments below**:
177
175
@@ -181,7 +179,6 @@ When you view a recommendation from the workload protection set, the number of a
181
179
182
180
Deploy the example .yaml files as-is, or use them as a reference to remediate your own workload.
183
181
184
-
185
182
## Healthy deployment example .yaml file
186
183
187
184
```yml
@@ -293,9 +290,9 @@ spec:
293
290
294
291
## Next steps
295
292
296
-
In this article, you learned how to configure Kubernetes data plane hardening.
293
+
In this article, you learned how to configure Kubernetes data plane hardening.
297
294
298
-
For related material, see the following pages:
295
+
For related material, see the following pages:
299
296
300
297
- [Defender for Cloud recommendations for compute](recommendations-reference.md#recs-compute)
301
298
- [Alerts for AKS cluster level](alerts-reference.md#alerts-k8scluster)
0 commit comments