Microsoft Defender for Cloud
Architecture and deployment

Deploy Defender Sensor and Azure Policy to Clusters Using Azure CLI - Microsoft Defender for Cloud | Microsoft Learn

In brief

The article now uses clearer wording for deploying the Defender sensor and Azure Policy, verifying automatic provisioning, Azure Arc extensions, RBAC permissions, and GKE Autopilot resource limits. Step numbering and title capitalization were also updated.

What Defender admins need to know

Administrators should find the deployment and verification instructions easier to follow. No action is required.

Summaries are generated from the documentation change itself.

Documentation change

The comparison below shows only the changed extract. Use the full-page view for complete context.

Deploy Defender sensorSensor and Azure Policy to clusters usingClusters Using Azure CLI - Microsoft Defender for Cloud | Microsoft Learn

This article explains how toYou can deploy the Microsoft Defender for Containers sensor and Azure Policy for Kubernetes to clusters by using Azure CLI afterCLI. First, enable the Defender for Containers plan in Microsoft Defender for Cloud.

For clusters that aren’aren't running in Azure Kubernetes Service (AKS), Defender for Cloud uses Azure Arc-enabled Kubernetes to deploy the required extensions.

Before you begin, review the prerequisites for your cluster type, including enabling the Defender for Containers plan, installing Azure CLI 2.40.0 or later, and meeting any Azure Arc connectivity requirements.

Azure Kubernetes Service (AKS)

Prerequisites

Deploy the Defender sensor

If you enabled automatic provisioning was enabled when you turned on the Defender for Containers plan, the Defender sensor might already be installed. Before you run the following command, verify whether the deployment is already complete before running this command..

  1. Deploy the Defender sensor to a specific AKS cluster:

    --name
    --enable-defender

    
    
  2. Enable Azure Policy for Kubernetes to assess and enforce configuration best practices:

    az aks enable-addons \
    

Deploy the Defender sensor

For EKS clusters, you deploy Defender components as Azure Arc Kubernetes extensions when you manually deploy them by using Azure CLI.

If you enabled automatic provisioning when you turned on the Defender for Containers plan, the Defender sensor might already be installed. Before you run the following command, verify whether the deployment is already complete before running these commands..

Run the following command to deploy the Defender sensor extension to your Arc-connected EKS cluster:

For Autopilot clusters:

  • The Defender sensor automatically adjusts resource requests.
  • No manual configuration is needed forYou don't need to configure resource limits.

Important

In GKE Autopilot clusters, you can't manually configure resource requests and limits for the Defender sensorsensor. GKE Autopilot controls resource management and you can't be manually configured. Resource management is controlled by GKE Autopilot and can't be overridden.override it.

Deploy the Defender sensor

For GKE clusters, you deploy Defender components are deployed as Azure Arc Kubernetes extensions when you manually deploy them manuallyby using Azure CLI.

If you enabled automatic provisioning was enabled when you turned on the Defender for Containers plan, the Defender sensor might already be installed. Before you run the following command, verify whether the deployment is already complete before running this command..

Run the following command to install the Defender sensor extension on your Arc-connected GKE cluster:

For Arc-enabled Kubernetes clusters, Defender components are deployed as Azure Arc Kubernetes extensions.

If you enabled automatic provisioning was enabled when you turned on the Defender for Containers plan, the Defender sensor might already be installed. Before you run the following command, verify whether the deployment is already complete before running this command..

Run the following command to install the Defender sensor extension on your Arc-enabled Kubernetes cluster: