Skip to content

Commit 898e227

Browse files
committed
fixed data hardening page
1 parent 6378420 commit 898e227

3 files changed

Lines changed: 40 additions & 74 deletions

File tree

articles/defender-for-cloud/kubernetes-workload-protections.md

Lines changed: 40 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -11,90 +11,60 @@ ms.date: 03/23/2026
1111

1212
Kubernetes data plane hardening helps enforce secure configurations for workloads running in your cluster, such as restricting privileged containers, enforcing resource limits, and limiting network access.
1313

14-
In Microsoft Defender for Cloud, data plane hardening is implemented by using [Azure Policy](defender-for-cloud-glossary.md#azure-policy-for-kubernetes) for Kubernetes to evaluate and enforce these configurations. Azure Policy is deployed as part of Defender for Containers automatically when automatic provisioning is enabled. If Azure Policy for Kubernetes is turned off in the Defender for Containers plan settings, you can deploy it by remediating the relevant recommendation.
14+
In Microsoft Defender for Cloud, data plane hardening is implemented by using [Azure Policy](defender-for-cloud-glossary.md#azure-policy-for-kubernetes) for Kubernetes to evaluate and enforce these configurations. Azure Policy is deployed as part of Defender for Containers when automatic provisioning is enabled.
1515

16-
After Azure Policy for Kubernetes is deployed, Defender for Cloud generates data plane hardening recommendations based on your cluster configuration. This page shows how to review these recommendations, configure policy parameters, and enforce them on your clusters.
17-
18-
> [!TIP]
19-
> For a list of the security recommendations that might appear for Kubernetes clusters and nodes, review [container recommendations](recommendations-reference-container.md).
20-
21-
## Prerequisites
22-
23-
- Add the [Required FQDN/application rules for Azure policy](/azure/aks/outbound-rules-control-egress#azure-policy).
24-
- (For non AKS clusters) [Connect an existing Kubernetes cluster to Azure Arc](/azure/azure-arc/kubernetes/quickstart-connect-cluster).
25-
26-
## Enable Azure Policy for Kubernetes
27-
28-
> [!NOTE]
29-
> 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.
30-
31-
### Enable Azure Policy using
32-
33-
If you disabled the "Azure Policy for Kubernetes" settings under the containers plan, you can follow the steps below to enable it across all clusters in your subscription:
34-
35-
1. Sign in to the [Azure portal](https://portal.azure.com).
36-
37-
1. Go to **Microsoft Defender for Cloud** > **Environment settings**.
38-
39-
1. Select the relevant subscription.
40-
41-
1. On the Defender plans page, ensure that **Containers** is toggled to **On**.
42-
43-
1. Select **Settings**.
44-
45-
:::image type="content" source="media/kubernetes-workload-protections/containers-settings.png" alt-text="Screenshot showing the settings button in the Defender plan." lightbox="media/kubernetes-workload-protections/containers-settings.png":::
16+
If Azure Policy for Kubernetes is turned off in the Defender for Containers plan settings, you can deploy it by remediating the relevant recommendation. You can also deploy Azure Policy manually by using [Azure CLI](defender-for-containers-deploy-azure-cli.md) or [Helm](deploy-helm.md) if you didn't use automatic provisioning or if you excluded clusters from automatic provisioning.
4617

47-
1. In the Settings & Monitoring page, toggle the **Azure Policy for Kubernetes** to **On**.
18+
If Azure Policy for Kubernetes is turned off in the Defender for Containers plan settings, you can deploy it by remediating the relevant recommendation. You can also deploy Azure Policy manually by using [Azure CLI](defender-for-containers-deploy-azure-cli.md) or [Helm](deploy-helm.md) if you disabled automatic provisioning during enablement or excluded specific clusters from automatic provisioning.
4819

49-
:::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":::
50-
51-
#### Enable for GCP projects
52-
53-
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.
20+
After Azure Policy for Kubernetes is deployed, Defender for Cloud generates data plane hardening recommendations based on your cluster configuration. This page shows how to review these recommendations, configure policy parameters, and enforce them on your clusters.
5421

55-
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#enable-the-plan).
22+
## Prerequisites
5623

57-
### Deploy Azure Policy for Kubernetes on existing clusters
24+
To begin, make sure that:
5825

59-
You can manually configure the Azure Policy for Kubernetes on existing Kubernetes clusters through the Recommendations page. Once enabled, the hardening recommendations become available (some of the recommendations require another configuration to work).
26+
- [Defender for Containers is enabled on your subscription](defender-for-containers-enable-portal.md).
27+
- You have added the [required FQDN/application rules for Azure policy](/azure/aks/outbound-rules-control-egress#azure-policy).
28+
- (For non AKS clusters) Your Kubernetes cluster is [connected to Azure Arc](/azure/azure-arc/kubernetes/quickstart-connect-cluster).
6029

61-
> [!NOTE]
62-
> For AWS, onboarding at scale using the connector isn't supported. However, you can install Azure Policy for Kubernetes on all existing clusters or on specific clusters by using the recommendation `Azure Arc-enabled Kubernetes clusters should have the Azure policy extension for Kubernetes extension installed`.
30+
## Deploy Azure Policy for Kubernetes by remediating recommendations
6331

64-
**To deploy the Azure Policy for Kubernetes to specified clusters**:
32+
If Azure Policy for Kubernetes isn't deployed or was turned off in the Defender for Containers plan settings, you can install it by remediating the relevant recommendation in Defender for Cloud.
6533

6634
1. Sign in to the [Azure portal](https://portal.azure.com).
6735

68-
1. Go to **Microsoft Defender for Cloud** > **General** > **Recommendations**.
36+
1. Go to **Microsoft Defender for Cloud** > **Recommendations**.
6937

7038
1. Search for the relevant recommendation:
7139

72-
- **Azure -** `"Azure Kubernetes Service clusters should have the Azure Policy add-on for Kubernetes installed"`
73-
- **GCP** - `"GKE clusters should have the Azure Policy extension"`.
74-
- **AWS and On-premises** - `"Azure Arc-enabled Kubernetes clusters should have the Azure policy extension for Kubernetes extension installed"`.
40+
- **Azure:** Azure Kubernetes Service clusters should have the Azure Policy add-on for Kubernetes installed
41+
- **GCP:** GKE clusters should have the Azure Policy extension installed
42+
- **AWS/Arc-enabled Kubernetes:** Azure Arc-enabled Kubernetes clusters should have the Azure Policy extension installed
7543

7644
:::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":::
7745

78-
1. Select a found recommendation.
46+
1. Select a recommendation.
7947

80-
1. Select **Fix**.
48+
1. In the **Take action** tab, select **Fix**.
8149

8250
:::image type="content" source="media/kubernetes-workload-protections/azure-kubernetes-service-clusters-recommendation-fix.png" alt-text="Screenshot of a recommendation with the Fix button highlighted." lightbox="media/kubernetes-workload-protections/azure-kubernetes-service-clusters-recommendation-fix.png":::
8351

84-
1. Repeat for each additional recommendation.
52+
1. Select **Fix** to remediate the selected resources.
8553

86-
## View and configure the bundle of recommendations
54+
1. Repeat for each recommendation.
8755

88-
After Azure Policy for Kubernetes is deployed, Defender for Cloud evaluates your cluster configuration and generates data plane hardening recommendations. This can take up to 30 minutes.
56+
## Review data plane hardening recommendations
8957

90-
> Microsoft components, such as the Defender sensor, are deployed in the `kube-system` namespace by default and aren't marked as noncompliant. Third-party components installed in other namespaces might be flagged. To exclude specific namespaces, configure policy exclusions.
58+
After you deploy Azure Policy for Kubernetes Defender for Cloud evaluates your cluster configuration and generates data plane hardening recommendations. This process can take up to 30 minutes.
59+
60+
> Microsoft components, such as the Defender sensor, are deployed in the `kube-system` namespace by default and aren't marked as noncompliant. Third-party components installed in other namespaces might be flagged. To exclude specific namespaces, configure Azure policy exclusions.
9161
9262
The following table lists common data plane hardening recommendations:
9363

9464
| Recommendation name | Security control | Configuration required |
9565
|---------------------|------------------|------------------------|
9666
| Container CPU and memory limits should be enforced | Protect applications against DDoS attack | **Yes** |
97-
| Container images should be deployed only from trusted registries | Remediate vulnerabilities | **Yes** |
67+
| Container images should be deployed from trusted registries only | Remediate vulnerabilities | **Yes** |
9868
| Least privileged Linux capabilities should be enforced for containers | Manage access and permissions | **Yes** |
9969
| Containers should only use allowed AppArmor profiles | Remediate security configurations | **Yes** |
10070
| Services should listen on allowed ports only | Restrict unauthorized network access | **Yes** |
@@ -112,7 +82,7 @@ The following table lists common data plane hardening recommendations:
11282

11383
### Configure policy parameters
11484

115-
Some recommendations require parameter configuration to be effective. For example, the recommendation **Container images should be deployed only from trusted registries** requires you to define a list of trusted registries.
85+
Some recommendations require parameter configuration to be effective. For example, the recommendation **Container images should be deployed from trusted registries only** requires you to define a list of trusted registries.
11686

11787
If required parameters aren't configured, resources are shown as unhealthy.
11888

@@ -128,11 +98,7 @@ To configure policy parameters:
12898

12999
:::image type="content" source="media/kubernetes-workload-protections/security-policies-page.png" alt-text="Screenshot of the Security policies page." lightbox="media/kubernetes-workload-protections/security-policies-page.png":::
130100

131-
1. On the **Standards** tab, search for the relevant security standard.
132-
133-
1. Select the security standard's 3-dot menu and select **Manage**.
134-
135-
:::image type="content" source="media/kubernetes-workload-protections/security-policies-select-manage.png" alt-text="Screenshot of selecting Manage from the recommendation's 3-dot menu." lightbox="media/kubernetes-workload-protections/security-policies-select-manage.png":::
101+
1. On the **Standards** tab, select the relevant security standard.
136102

137103
1. Select the relevant policy assignment's 3-dot menu and select **Manage effect and parameters**.
138104

@@ -156,8 +122,6 @@ To enforce a recommendation:
156122

157123
1. Search for and select the relevant data plane hardening recommendation.
158124

159-
1. Open the recommendation details page.
160-
161125
1. On the **Take action** tab, select **Deny**.
162126

163127
:::image type="content" source="./media/kubernetes-workload-protections/enforce-workload-protection-example.png" alt-text="Screenshot showing the Deny option for Azure Policy parameter." lightbox="media/kubernetes-workload-protections/enforce-workload-protection-example.png":::
@@ -174,30 +138,32 @@ To view data plane hardening recommendations for a specific cluster:
174138

175139
1. Go to **Defender for Cloud** > **Inventory**.
176140

177-
1. Set the resource type filter to **Kubernetes services** and select **Apply**.
141+
1. Set the resource type filter to **Kubernetes service** and select **Apply**.
178142

179143
:::image type="content" source="media/kubernetes-workload-protections/resource-type-kubernetes-service.png" alt-text="Screenshot of using the resource type filter to select kubernetes service." lightbox="media/kubernetes-workload-protections/resource-type-kubernetes-service.png":::
180144

181-
1. Select a cluster to investigate.
145+
1. Select a cluster.
182146

183-
1. Review the available recommendations for it. When you view a recommendation from the workload protection set, the number of affected pods ("Kubernetes components") is listed alongside the cluster.
147+
1. Review the available recommendations. Data plane hardening recommendations show the number of affected Kubernetes components.
184148

185-
1. Optional: For a list of the specific pods, select the recommendation.
149+
1. Select a recommendation to view affected resources.
186150

187151
:::image type="content" source="media/kubernetes-workload-protections/resource-health-recommendation.png" alt-text="Screenshot of selecting a recommendation from the Resource health page." lightbox="media/kubernetes-workload-protections/resource-health-recommendation.png":::
188-
1. and then select **Take action**.
189152

190-
:::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.":::
153+
1. Select the **Take action** tab to review remediation options.
154+
155+
:::image type="content" source="media/kubernetes-workload-protections/take-action-tab.png" alt-text="Use the Take action tab to view remediation steps for a recommendation." lightbox="media/kubernetes-workload-protections/take-action-tab.png":::
191156

192-
**To test the enforcement, use the two Kubernetes deployments below**:
157+
## Test policy enforcement
193158

194-
- One is for a healthy deployment, compliant with the bundle of workload protection recommendations.
159+
You can validate data plane hardening policies by deploying test workloads.
195160

196-
- The other is for an unhealthy deployment, noncompliant with *any* of the recommendations.
161+
- A compliant deployment that meets data plane hardening requirements
162+
- A noncompliant deployment that violates multiple policies
197163

198-
Deploy the example .yaml files as-is, or use them as a reference to remediate your own workload.
164+
Deploy the following example YAML files to verify that compliant workloads are deployed successfully and noncompliant workloads are flagged or blocked, depending on policy enforcement settings.
199165

200-
## Healthy deployment example .yaml file
166+
### Compliant deployment example
201167

202168
```yml
203169
apiVersion: apps/v1
@@ -247,7 +213,7 @@ spec:
247213
targetPort: 80
248214
```
249215
250-
## Unhealthy deployment example .yaml file
216+
### Noncompliant deployment example
251217
252218
```yml
253219
apiVersion: apps/v1
144 KB
Loading

0 commit comments

Comments
 (0)