Microsoft Defender for Cloud
Architecture and deployment

Deploy Defender sensor and Azure Policy to clusters using Azure CLI

In brief

The article now includes prerequisites, numbered AKS deployment steps, and explicit Defender sensor and Azure Policy extension instructions for Arc-connected EKS, GKE, and Kubernetes clusters. It also clarifies TCP 443 firewall access for private clusters and adds deployment verification links.

What Defender admins need to know

Administrators should use the updated prerequisites and cluster-specific instructions when deploying Defender for Containers.

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 sensor and Azure Policy to clusters using Azure CLI

For clusters that 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

If automatic provisioning was enabled when you turned on the Defender for Containers plan, the Defender sensor might already be installed. Verify the deployment before running this command.

  1. To deployDeploy the Defender sensor to a specific AKS cluster:

    az aks update \
      --resource-group <resource-group> \
      --name <aks-cluster-name> \
      --enable-defender
    

    Deploy the Azure Policy add-on

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

    az aks enable-addons \
      --addons azure-policy \
      --name <aks-cluster-name> \
      --resource-group <resource-group>
    

Amazon Elastic Kubernetes Service (EKS)

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

If automatic provisioning was enabled when you turned on the Defender for Containers plan, the Defender sensor might already be installed. Verify the deployment before running this command.these commands.

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

az k8s-extension create \

## Deploy the Azure Policy extension

Install the Azure Policy extension to enable policy-based security recommendations and compliance assessments for your EKS cluster:

```azurecli
az k8s-extension create \
  --name azurepolicy \

Private GKE clusters must allow outbound HTTPS (TCP 443) access to Microsoft Defender for Cloud endpoints.

If required, configureyour private cluster blocks outbound traffic, create a firewall rulesrule to allow egress from cluster nodes:nodes to reach Microsoft Defender for Cloud endpoints over TCP 443:

```bash
gcloud compute firewall-rules create allow-azure-defender \

## Cluster-specific considerations

Review the following considerations based on your GKE cluster type before deploying the Defender sensor.

### Standard GKE clusters

No special configuration is required. Follow the default deployment steps.steps in the [Deploy the Defender sensor](#deploy-the-defender-sensor) and [Deploy the Azure Policy extension](#deploy-the-azure-policy-extension) sections.

### GKE Autopilot clusters


If automatic provisioning was enabled when you turned on the Defender for Containers plan, the Defender sensor might already be installed. [Verify the deployment](defender-for-containers-verify-deployment.md) before running this command.

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

```azurecli
az k8s-extension create \
  --name microsoft.azuredefender.kubernetes \

## Deploy the Azure Policy extension

Install the Azure Policy extension on your Arc-connected GKE cluster to enable policy-based security recommendations and compliance assessments:

```azurecli
az k8s-extension create \
  --name azurepolicy \

If automatic provisioning was enabled when you turned on the Defender for Containers plan, the Defender sensor might already be installed. [Verify the deployment](defender-for-containers-verify-deployment.md) before running this command.

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

```azurecli
az k8s-extension create \
  --name microsoft.azuredefender.kubernetes \

## Deploy the Azure Policy extension

Install the Azure Policy extension on your Arc-enabled Kubernetes cluster to enable policy-based security recommendations and compliance assessments:

```azurecli
az k8s-extension create \
  --name azurepolicy \