Skip to content

Commit e1505cf

Browse files
committed
continue
1 parent 94a4a6d commit e1505cf

1 file changed

Lines changed: 56 additions & 62 deletions

File tree

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

Lines changed: 56 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -11,44 +11,26 @@ 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 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 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.
1515

1616
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.
1717

1818
> [!TIP]
1919
> For a list of the security recommendations that might appear for Kubernetes clusters and nodes, review [container recommendations](recommendations-reference-container.md).
2020
21-
## Set up your workload protection
22-
23-
Microsoft Defender for Cloud includes a bundle of recommendations that are available once you've installed the **[Azure Policy for Kubernetes](defender-for-cloud-glossary.md#azure-policy-for-kubernetes)**.
24-
2521
## Prerequisites
2622

2723
- Add the [Required FQDN/application rules for Azure policy](/azure/aks/outbound-rules-control-egress#azure-policy).
2824
- (For non AKS clusters) [Connect an existing Kubernetes cluster to Azure Arc](/azure/azure-arc/kubernetes/quickstart-connect-cluster).
2925

30-
## Enable Kubernetes data plane hardening
31-
32-
You can enable the Azure Policy for Kubernetes by one of two ways:
33-
34-
- Enable for all current and future clusters using plan/connector settings:
35-
- [Enabling for Azure subscriptions or on-premises](#enable-for-azure-subscriptions-or-on-premises)
36-
- [Enabling for Google Cloud Platform (GCP) projects](#enable-for-gcp-projects)
37-
- [Deploy Azure Policy for Kubernetes on existing clusters](#deploy-azure-policy-for-kubernetes-on-existing-clusters)
38-
39-
### Enable Azure Policy for Kubernetes for all current and future clusters using plan/connector settings
26+
## Enable Azure Policy for Kubernetes
4027

4128
> [!NOTE]
4229
> 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.
4330
44-
> [!NOTE]
45-
> Enablement for AWS via the connector isn't supported due to a limitation in EKS that requires the cluster admin to add permissions for a new IAM role on the cluster itself.
46-
47-
#### Enable for Azure subscriptions or on-premises
31+
### Enable Azure Policy using
4832

49-
When you enable Microsoft Defender for Containers, the "Azure Policy for Kubernetes" setting is enabled by default for the Azure Kubernetes Service and for Azure Arc-enabled Kubernetes clusters in the relevant subscription. If you disable the setting on initial configuration, you can enable it afterwards manually.
50-
51-
If you disabled the "Azure Policy for Kubernetes" settings under the containers plan, you can follow the steps bellow to enable it across all clusters in your subscription:
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:
5234

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

@@ -103,51 +85,50 @@ You can manually configure the Azure Policy for Kubernetes on existing Kubernete
10385

10486
## View and configure the bundle of recommendations
10587

106-
Approximately 30 minutes after the Azure Policy for Kubernetes installation completes, Defender for Cloud shows the clusters’ health status for the following recommendations, each in the relevant security control as shown:
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.
10789

108-
> [!NOTE]
109-
> If you're installing the Azure Policy for Kubernetes for the first time, these recommendations appear as new additions in the list of recommendations.
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.
11091
111-
> [!TIP]
112-
> 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 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.
92+
The following table lists common data plane hardening recommendations:
11393

114-
> [!NOTE]
115-
> Microsoft components like the Defender sensor are deployed in the kube-system namespace by default. This setup ensures they aren't marked as non-compliant in data plane recommendations. However, third-party vendor tools installed in a different namespace might be flagged as non-compliant. To exclude third-party vendors from these recommendations, you can add their namespace to the exclusion list.
116-
117-
| Recommendation name | Security Control | Configuration required |
118-
|---------------------|--------------------|------------------------|
119-
| Container CPU and memory limits should be enforced | Protect applications against DDoS attack | **Yes** |
120-
| Container images should be deployed only from trusted registries | Remediate vulnerabilities | **Yes** |
121-
| Least privileged Linux capabilities should be enforced for containers | Manage access and permissions | **Yes** |
122-
| Containers should only use allowed AppArmor profiles | Remediate security configurations | **Yes** |
123-
| Services should listen on allowed ports only | Restrict unauthorized network access | **Yes** |
124-
| Usage of host networking and ports should be restricted | Restrict unauthorized network access | **Yes** |
125-
| Usage of pod HostPath volume mounts should be restricted to a known list | Manage access and permissions | **Yes** |
126-
| Container with privilege escalation should be avoided | Manage access and permissions | No |
127-
| Containers sharing sensitive host namespaces should be avoided | Manage access and permissions | No |
128-
| Immutable (read-only) root filesystem should be enforced for containers | Manage access and permissions | No |
129-
| Kubernetes clusters should be accessible only over HTTPS | Encrypt data in transit | No |
130-
| Kubernetes clusters should disable automounting API credentials | Manage access and permissions | No |
131-
| Kubernetes clusters shouldn't use the default namespace | Implement security best practices | No |
132-
| Kubernetes clusters shouldn't grant CAPSYSADMIN security capabilities | Manage access and permissions | No |
133-
| Privileged containers should be avoided | Manage access and permissions | No |
134-
| Running containers as root user should be avoided | Manage access and permissions | No |
135-
136-
For recommendations with parameters that need to be customized, you need to set the parameters:
137-
138-
**To set the parameters**:
94+
| Recommendation name | Security control | Configuration required |
95+
|---------------------|------------------|------------------------|
96+
| 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** |
98+
| Least privileged Linux capabilities should be enforced for containers | Manage access and permissions | **Yes** |
99+
| Containers should only use allowed AppArmor profiles | Remediate security configurations | **Yes** |
100+
| Services should listen on allowed ports only | Restrict unauthorized network access | **Yes** |
101+
| Usage of host networking and ports should be restricted | Restrict unauthorized network access | **Yes** |
102+
| Usage of pod HostPath volume mounts should be restricted to a known list | Manage access and permissions | **Yes** |
103+
| Container with privilege escalation should be avoided | Manage access and permissions | No |
104+
| Containers sharing sensitive host namespaces should be avoided | Manage access and permissions | No |
105+
| Immutable (read-only) root filesystem should be enforced for containers | Manage access and permissions | No |
106+
| Kubernetes clusters should be accessible only over HTTPS | Encrypt data in transit | No |
107+
| Kubernetes clusters should disable automounting API credentials | Manage access and permissions | No |
108+
| Kubernetes clusters shouldn't use the default namespace | Implement security best practices | No |
109+
| Kubernetes clusters shouldn't grant CAP_SYS_ADMIN capabilities | Manage access and permissions | No |
110+
| Privileged containers should be avoided | Manage access and permissions | No |
111+
| Running containers as root user should be avoided | Manage access and permissions | No |
112+
113+
### Configure policy parameters
114+
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.
116+
117+
If required parameters aren't configured, resources are shown as unhealthy.
118+
119+
To configure policy parameters:
139120

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

142-
1. Go to **Microsoft Defender for Cloud** > **Management** > **Environment settings**.
123+
1. Go to **Microsoft Defender for Cloud** > **Environment settings**.
143124

144125
1. Select the relevant subscription.
145126

146-
1. From the navigation menu, select **Security policies**.
127+
1. Select **Security policies**.
147128

148129
:::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":::
149130

150-
1. On the **Standards** tab, search for the appropriate security standard.
131+
1. On the **Standards** tab, search for the relevant security standard.
151132

152133
1. Select the security standard's 3-dot menu and select **Manage**.
153134

@@ -157,23 +138,37 @@ For recommendations with parameters that need to be customized, you need to set
157138

158139
:::image type="content" source="media/kubernetes-workload-protections/select-manage-effect-and-parameters.png" alt-text="Screenshot of selecting the 3-dot menu and then selecting Manage effect and aparameters." lightbox="media/kubernetes-workload-protections/select-manage-effect-and-parameters.png":::
159140

160-
1. Modify the values as required.
141+
1. Update the required parameter values.
161142

162143
:::image type="content" source="media/kubernetes-workload-protections/manage-effect-and-parameters.png" alt-text="Screenshot of the paraments panel." lightbox="media/kubernetes-workload-protections/manage-effect-and-parameters.png":::
163144

164145
1. Select **Save**.
165146

166-
**To enforce any of the recommendations**:
147+
### Enforce data plane hardening policies
148+
149+
By default, policies evaluate resources in audit mode. To enforce a policy, set its effect to **Deny**.
150+
151+
To enforce a recommendation:
152+
153+
1. Sign in to the [Azure portal](https://portal.azure.com).
154+
155+
1. Go to **Microsoft Defender for Cloud** > **Recommendations**.
156+
157+
1. Search for and select the relevant data plane hardening recommendation.
167158

168-
1. Open the recommendation details page and select **Deny**:
159+
1. Open the recommendation details page.
160+
161+
1. Select **Deny**.
169162

170163
:::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":::
171164

172-
The pane to set the scope opens.
165+
1. Set the scope.
166+
167+
1. Select **Change to deny**.
173168

174-
1. Set the scope and select **Change to deny**.
169+
### View recommendations for a cluster
175170

176-
**To see which recommendations apply to your clusters**:
171+
To view data plane hardening recommendations for a specific cluster:
177172

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

@@ -186,7 +181,6 @@ For recommendations with parameters that need to be customized, you need to set
186181
1. Select a cluster to investigate.
187182

188183
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.
189-
190184

191185
1. Optional: For a list of the specific pods, select the recommendation.
192186

0 commit comments

Comments
 (0)