Skip to content

Commit 609887c

Browse files
authored
Merge pull request #188478 from ElazarK/Kubernetes-workload
added kubernetes
2 parents 5426d3d + 30c65d5 commit 609887c

File tree

6 files changed

+105
-54
lines changed

6 files changed

+105
-54
lines changed

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

Lines changed: 105 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Workload protections for your Kubernetes workloads
33
description: Learn how to use Microsoft Defender for Cloud's set of Kubernetes workload protection security recommendations
44
ms.topic: how-to
5-
ms.date: 01/26/2022
5+
ms.date: 02/15/2022
66
---
77

88
# Protect your Kubernetes workloads
@@ -11,59 +11,102 @@ ms.date: 01/26/2022
1111

1212
This page describes how to use Microsoft Defender for Cloud's set of security recommendations dedicated to Kubernetes workload protection.
1313

14-
Learn more about these features in [Workload protection best-practices using Kubernetes admission control](defender-for-containers-introduction.md#workload-protection-best-practices-using-kubernetes-admission-control)
15-
16-
Defender for Cloud offers more container security features if you enable Microsoft Defender for Containers. Learn more in [Overview of Microsoft Defender for Containers](defender-for-containers-introduction.md)
17-
1814
> [!TIP]
1915
> For a list of the security recommendations that might appear for Kubernetes clusters and nodes, see the [Container recommendations](recommendations-reference.md#container-recommendations) of the recommendations reference table.
2016
21-
2217
## Availability
2318

24-
| Aspect | Details |
25-
|---------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------|
26-
| Release state: | General availability (GA) |
27-
| Pricing: | Free for AKS workloads<br>For Azure Arc-enabled Kubernetes or EKS, it's billed according to the Microsoft Defender for Containers plan |
28-
| Required roles and permissions: | **Owner** or **Security admin** to edit an assignment<br>**Reader** to view the recommendations |
29-
| Environment requirements: | Kubernetes v1.14 (or newer) is required<br>No PodSecurityPolicy resource (old PSP model) on the clusters<br>Windows nodes are not supported |
30-
| Clouds: | :::image type="icon" source="./media/icons/yes-icon.png"::: Commercial clouds<br>:::image type="icon" source="./media/icons/yes-icon.png"::: National (Azure Government, Azure China 21Vianet) |
31-
| | |
32-
19+
| Aspect | Details |
20+
|--|--|
21+
| Release state: | AKS - General availability (GA) <br> Arc enabled Kubernetes - Preview |
22+
| Pricing: | Free for AKS workloads<br>For Azure Arc-enabled Kubernetes, it's billed according to the Microsoft Defender for Containers plan |
23+
| Required roles and permissions: | **Owner** or **Security admin** to edit an assignment<br>**Reader** to view the recommendations |
24+
| Environment requirements: | Kubernetes v1.14 (or newer) is required<br>No PodSecurityPolicy resource (old PSP model) on the clusters<br>Windows nodes are not supported |
25+
| Azure Clouds: | :::image type="icon" source="./media/icons/yes-icon.png"::: Commercial clouds<br>:::image type="icon" source="./media/icons/yes-icon.png"::: National (Azure Government, Azure China 21Vianet) |
26+
| Non-Azure Clouds, and On-prem: | supported via Arc enabled Kubernetes. |
27+
| | |
3328

3429
## Set up your workload protection
3530

36-
Microsoft Defender for Cloud includes a bundle of recommendations that are available when you've installed the **Azure Policy add-on for Kubernetes**.
31+
Microsoft Defender for Cloud includes a bundle of recommendations that are available once you've installed the **Azure Policy add-on for Kubernetes or extensions**.
3732

3833
## Prerequisites
3934

40-
Validate the following endpoints are configured for outbound access so that the Azure Policy add-on for Kubernetes can connect to Azure Policy to synchronize Kubernetes policies:
35+
- Add the [Required FQDN/application rules for Azure policy](../aks/limit-egress-traffic.md#azure-policy).
36+
- (For non AKS clusters) [Connect an existing Kubernetes cluster to Azure Arc](../azure-arc/kubernetes/quickstart-connect-cluster.md).
37+
38+
## Enable Kubernetes workload protection
39+
40+
When you enable Microsoft Defender for Containers, Azure Kubernetes Service clusters, and Azure Arc enabled Kubernetes clusters (Preview) protection are both enabled by default. You can configure your Kubernetes workload protections, when you enable Microsoft Defender for Containers.
41+
42+
**To enable Azure Kubernetes Service clusters and Azure Arc enabled Kubernetes clusters (Preview)**:
43+
44+
1. Sign in to the [Azure portal](https://portal.azure.com).
45+
46+
1. Navigate to **Microsoft Defender for Cloud** > **Environment settings**.
47+
48+
1. Select the relevant subscription.
49+
50+
1. On the Defender plans page, ensure that Containers is toggled to **On**.
51+
52+
1. Select **Configure**.
53+
54+
:::image type="content" source="media/kubernetes-workload-protections/configure-containers.png" alt-text="Screenshot showing where on the defenders plan to go to to select the configure button.":::
55+
56+
1. On the Advanced configuration page, toggle each relevant component to **On**.
57+
58+
:::image type="content" source="media/kubernetes-workload-protections/advanced-configuration.png" alt-text="Screenshot showing the toggles used to enable or disable them.":::
4159

42-
See [Required FQDN/application rules for Azure policy](../aks/limit-egress-traffic.md#azure-policy) for the required FQDN/application rules.
60+
1. Select **Save**.
4361

44-
### Step 1: Deploy the add-on
62+
## Configure Defender for Containers components
4563

46-
To configure the recommendations, install the **Azure Policy add-on for Kubernetes**.
64+
If you disabled any of the default protections when you enabled Microsoft Defender for Containers, you can change the configurations and reenable them via auto provisioning.
4765

48-
- You can auto deploy this add-on as explained in [Enable auto provisioning of the Log Analytics agent and extensions](enable-data-collection.md#auto-provision-mma). When auto provisioning for the add-on is set to "on", the extension is enabled by default in all existing and future clusters (that meet the add-on installation requirements).
66+
**To configure the Defender for Containers components**:
4967

50-
:::image type="content" source="media/defender-for-kubernetes-usage/policy-add-on-auto-provision.png" alt-text="Using Defender for Cloud's auto provisioning tool to install the policy add-on for Kubernetes":::
68+
1. Sign in to the [Azure portal](https://portal.azure.com).
5169

52-
- To manually deploy the add-on:
70+
1. Navigate to **Microsoft Defender for Cloud** > **Environment settings**.
5371

54-
1. From the recommendations page, search for the recommendation "**Azure Policy add-on for Kubernetes should be installed and enabled on your clusters**".
72+
1. Select the relevant subscription.
5573

56-
:::image type="content" source="./media/defender-for-kubernetes-usage/recommendation-to-install-policy-add-on-for-kubernetes.png" alt-text="Recommendation **Azure Policy add-on for Kubernetes should be installed and enabled on your clusters**":::
74+
1. From the left side tool bar, select **Auto provisioning**.
5775

58-
> [!TIP]
59-
> The recommendation is included in five different security controls and it doesn't matter which one you select in the next step.
76+
1. Ensure that Microsoft Defenders for Containers components (preview) is toggled to On.
6077

61-
1. From any of the security controls, select the recommendation to see the resources on which you can install the add-on.
62-
1. Select the relevant cluster, and **Remediate**.
78+
:::image type="content" source="media/kubernetes-workload-protections/toggled-on.png" alt-text="Screenshot showing that Microsoft Defender for Containers is toggled to on.":::
6379

64-
:::image type="content" source="./media/defender-for-kubernetes-usage/recommendation-to-install-policy-add-on-for-kubernetes-details.png" alt-text="Recommendation details page for **Azure Policy add-on for Kubernetes should be installed and enabled on your clusters**":::
80+
1. Select **Edit configuration**.
6581

66-
### Step 2: View and configure the bundle of recommendations
82+
:::image type="content" source="media/kubernetes-workload-protections/edit-configuration.png" alt-text="Screenshot showing the edit configuration button.":::
83+
84+
1. On the Advanced configuration page, toggle each relevant component to **On**.
85+
86+
:::image type="content" source="media/kubernetes-workload-protections/toggles.png" alt-text="Screenshot showing each option and the toggles to enable or disable them.":::
87+
88+
1. Select **Confirm**.
89+
90+
## Deploy the add-on to specified clusters
91+
92+
You can manually configure the Kubernetes workload add-on, or extension protection through the Recommendations page. This can be accomplished by remediating the `Azure Policy add-on for Kubernetes should be installed and enabled on your clusters` recommendation.
93+
94+
**To Deploy the add-on to specified clusters**:
95+
96+
1. From the recommendations page, search for the recommendation `Azure Policy add-on for Kubernetes should be installed and enabled on your clusters`.
97+
98+
:::image type="content" source="./media/defender-for-kubernetes-usage/recommendation-to-install-policy-add-on-for-kubernetes.png" alt-text="Recommendation **Azure Policy add-on for Kubernetes should be installed and enabled on your clusters**.":::
99+
100+
> [!TIP]
101+
> The recommendation is included in five different security controls and it doesn't matter which one you select in the next step.
102+
103+
1. From any of the security controls, select the recommendation to see the resources on which you can install the add-on.
104+
105+
1. Select the relevant cluster, and **Remediate**.
106+
107+
:::image type="content" source="./media/defender-for-kubernetes-usage/recommendation-to-install-policy-add-on-for-kubernetes-details.png" alt-text="Recommendation details page for Azure Policy add-on for Kubernetes should be installed and enabled on your clusters.":::
108+
109+
## View and configure the bundle of recommendations
67110

68111
1. 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:
69112

@@ -95,47 +138,55 @@ To configure the recommendations, install the **Azure Policy add-on for Kuberne
95138
| Running containers as root user should be avoided | Manage access and permissions | No |
96139
||||
97140

141+
For recommendations with parameters that need to be customized, you will need to set the parameters:
142+
143+
**To set the parameters**:
144+
145+
1. Sign in to the [Azure portal](https://portal.azure.com).
146+
147+
1. Navigate to **Microsoft Defender for Cloud** > **Environment settings**.
98148

99-
1. For the recommendations with parameters that need to be customized, set the parameters:
149+
1. Select the relevant subscription.
100150

101-
1. From Defender for Cloud's menu, select **Security policy**.
102-
1. Select the relevant subscription.
103-
1. From the **Defender for Cloud default policy** section, select **View effective policy**.
104-
1. Select the default policy for the scope you're updating.
105-
1. Open the **Parameters** tab and modify the values as required.
151+
1. From Defender for Cloud's menu, select **Security policy**.
152+
153+
1. Select the relevant assignment. The default assignment is `ASC default`.
154+
155+
1. Open the **Parameters** tab and modify the values as required.
106156

107-
:::image type="content" source="media/kubernetes-workload-protections/containers-parameter-requires-configuration.png" alt-text="Modifying the parameters for one of the recommendations in the Kubernetes workload protection bundle.":::
157+
:::image type="content" source="media/kubernetes-workload-protections/containers-parameter-requires-configuration.png" alt-text="Modifying the parameters for one of the recommendations in the Kubernetes workload protection bundle.":::
108158

109-
1. Select **Review + save**.
110-
1. Select **Save**.
159+
1. Select **Review + save**.
160+
161+
1. Select **Save**.
111162

163+
**To enforce any of the recommendations**:
112164

113-
1. To enforce any of the recommendations,
165+
1. Open the recommendation details page and select **Deny**:
114166

115-
1. Open the recommendation details page and select **Deny**:
167+
:::image type="content" source="./media/defender-for-kubernetes-usage/enforce-workload-protection-example.png" alt-text="Deny option for Azure Policy parameter.":::
116168

117-
:::image type="content" source="./media/defender-for-kubernetes-usage/enforce-workload-protection-example.png" alt-text="Deny option for Azure Policy parameter.":::
169+
This will open the pane where you set the scope.
118170

119-
This will open the pane where you set the scope.
171+
1. When you've set the scope, select **Change to deny**.
120172

121-
1. When you've set the scope, select **Change to deny**.
173+
**To see which recommendations apply to your clusters**:
122174

123-
1. To see which recommendations apply to your clusters:
175+
1. Open Defender for Cloud's [asset inventory](asset-inventory.md) page and use the resource type filter to **Kubernetes services**.
124176

125-
1. Open Defender for Cloud's [asset inventory](asset-inventory.md) page and use the resource type filter to **Kubernetes services**.
177+
1. Select a cluster to investigate and review the available recommendations available for it.
126178

127-
1. Select a cluster to investigate and review the available recommendations available for it.
179+
When viewing a recommendation from the workload protection set, you'll see the number of affected pods ("Kubernetes components") listed alongside the cluster. For a list of the specific pods, select the cluster and then select **Take action**.
128180

129-
1. When viewing a recommendation from the workload protection set, you'll see the number of affected pods ("Kubernetes components") listed alongside the cluster. For a list of the specific pods, select the cluster and then select **Take action**.
181+
:::image type="content" source="./media/defender-for-kubernetes-usage/view-affected-pods-for-recommendation.gif" alt-text="Viewing the affected pods for a K8s recommendation.":::
130182

131-
:::image type="content" source="./media/defender-for-kubernetes-usage/view-affected-pods-for-recommendation.gif" alt-text="Viewing the affected pods for a K8s recommendation.":::
183+
**To test the enforcement, use the two Kubernetes deployments below**:
132184

133-
1. To test the enforcement, use the two Kubernetes deployments below:
185+
- One is for a healthy deployment, compliant with the bundle of workload protection recommendations.
134186

135-
- One is for a healthy deployment, compliant with the bundle of workload protection recommendations.
136-
- The other is for an unhealthy deployment, non-compliant with *any* of the recommendations.
187+
- The other is for an unhealthy deployment, non-compliant with *any* of the recommendations.
137188

138-
Deploy the example .yaml files as-is, or use them as a reference to remediate your own workload (step VIII)
189+
Deploy the example .yaml files as-is, or use them as a reference to remediate your own workload (step VIII).
139190

140191

141192
## Healthy deployment example .yaml file
60.5 KB
Loading
57.1 KB
Loading
7.91 KB
Loading
65.9 KB
Loading
137 KB
Loading

0 commit comments

Comments
 (0)