Microsoft Defender for Cloud
Cloud and workloads

Container runtime antimalware detection and blocking

In brief

The page now documents enabling antimalware through Defender sensor auto-provisioning, Helm for sensor 0.10.x or later, or the AKS preview API. It also updates prerequisites and removes earlier multicloud and `--antimalware` instructions.

What Defender admins need to know

Administrators have updated AKS procedures and configuration examples for enabling the antimalware collector.

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.

Prerequisites

  • To use container runtime antimalware detection and blocking, you need to run the Defender for Containers sensor, which is available for Amazon Web Services (AWS), Google Cloud Platform (GCP), and Azure Kubernetes Service (AKS) clouds. This feature is supported for:Defender for Containers enabled on your subscription.

    • AKS: Helm provisioning with sensor version 0.10.X GA latest version.
    • Multicloud:
      • Enable Azure Arc (ARC) auto-provisioning on the enablement page.

        :::image type="content" source="media/anti-malware/enable-toggles.png" alt-text="Screenshot that shows the enablement toggles for ARC." lightbox="media/anti-malware/enable-toggles.png":::

      • Helm provisioning with sensor version 0.10.X GA latest version or the ARC extension, with the command --configuration-settings collectors.antimalwareCollector.enable='true'.

        For example:

        az k8s-extension create --name  microsoft.azuredefender.kubernetes --extension-type  microsoft.azuredefender.kubernetes --cluster-name <name> --resource-group <rg> --cluster-type connectedClusters --configuration-settings collectors.antimalwareCollector.enable='true'
        
  • You must enable the Defender for Containers sensor on the subscriptions and connectors.

  • To create and modify antimalware policies, you need Security Admin or higher permissions on the tenant. To view antimalware policies, you need Security Reader or higher permissions on the tenant.

  • In addition to the core sensor memory and central processing unit (CPU) requirements,core sensor memory and central processing unit (CPU) requirements, you need:

    Component Request Limit
    CPU 50 m 300 m
    Memory 128Mi 500Mi
  • Learn more about antimalware detection and blocking availability.

    Components

    The following components are part of antimalware detection and blocking:

    • An enhanced sensor that detects and prevents malware.

    • Antimalware policy configuration options.

    • Antimalware alerts.

    Enable antimalware detection and blocking

    Antimalware isn't enabled by default because it uses extra cluster resources. Use one of the following methods based on your cluster platform.

    Azure Kubernetes Service (AKS)

    You can enable the antimalware collector using one of the following methods:

    Auto-provisioning (recommended)

    In the Defender sensor configuration, turn on Enable Defender Runtime Anti Malware.

    To install:::image type="content" source="media/anti-malware/enable-defender-runtime-antimalware.png" alt-text="Screenshot of the Defender sensor configuration with antimalware enabled, followDefender Runtime Anti Malware enabled." lightbox="media/anti-malware/enable-defender-runtime-antimalware.png":::

    Helm

    Deploy sensor version 0.10.x or later by following the instructions to install the Defender for Containers sensor by using Helm and. During installation, include the following setting:

    --set microsoft-defender-for-containers-sensor.antimalwareCollector.enabled=true
    

    AKS preview API

    You can manually enable the antimalware collector by updating the AKS security profile.

    Get the current state

    az rest --method GET `
      --url "https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.ContainerService/managedClusters/{clusterName}?api-version=2026-03-02-preview" `
      --query "properties.securityProfile.defender" `
      --output json
    

    Enable antimalware

    Use the existing Defender configuration returned by the GET request to create a JSON file named enable-am.json. Preserve the existing properties under defender, and add the antimalware flag.configuration:

    {
      "location": "<cluster-location>",
      "properties": {
        "securityProfile": {
          "defender": {
            "antimalware": {
              "enabled": true
            },
            "logAnalyticsWorkspaceResourceId": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}",
            "securityMonitoring": {
              "enabled": true
            }
          }
        }
      }
    }
    
    az rest --method PUT `
      --url "https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.ContainerService/managedClusters/{clusterName}?api-version=2026-03-02-preview" `
      --body "@enable-am.json"
    

    Amazon EKS and Google GKE

    For connected multicloud clusters, you can enable the antimalware collector using one of the following methods:

    Azure Arc auto-provisioning (recommended)

    On the enablement page, turn on Auto provision Defender's sensor for Azure Arc and Enable Defender Anti-Malware.

    :::image type="content" source="media/anti-malware/enable-defender-antimalware-arc.png" alt-text="Screenshot of the Defender for Containers enablement settings with Defender sensor auto-provisioning for Azure Arc and Defender Anti-Malware enabled." lightbox="media/anti-malware/enable-defender-antimalware-arc.png":::

    Azure Arc extension

    Deploy the Defender for Containers Azure Arc extension with the antimalware collector enabled.

    az k8s-extension create \
      --name microsoft.azuredefender.kubernetes \
      --extension-type microsoft.azuredefender.kubernetes \
      --cluster-name <cluster-name> \
      --resource-group <resource-group> \
      --cluster-type connectedClusters \
      --configuration-settings antimalwareCollector.enabled='true'
    

    Helm

    Deploy sensor version 0.10.x or later by following the instructions to install the Defender for Containers sensor by using Helm. During installation, include the following setting:

    --set microsoft-defender-for-containers-sensor.antimalwareCollector.enabled=true
    

    Add antimalware rules

    When you install the sensor with antimalware enabled, it configures three antimalware rules by default. These rules include:

    • Malware alert on binaries not originated from original image: a suggested rule for situations where the system detects a drifted binary.
    • Default antimalware workload rule.

    The two default antimalware rules (workload and host) apply to every potential situation if no other rule matches first. You can only modify the default rules' actions and set them to alert, block, or ignore.

    You can create new antimalware rules to define when alerts should be generated, blocked,specify whether detected malware is ignored, generates an alert, or ignored.is blocked. Each rule can define the conditions for generating alerts. This structure allows you to tailor the system to your specific needs and reduce false positives. You can create exclusions by setting higher configuring higher-priority rules for specific scopes orscopes, clusters, images, pods, Kubernetes labels, or namespaces.

    1. Sign in to the Azure portal.

      :::image type="content" source="media/anti-malware/alert-on-malware-rule-screen.png" alt-text="Screenshot of Microsoft Defender for Cloud showing the anti-malware policy page with three rules: Alert on Malware, Default for workload, and Default for host." lightbox="media/anti-malware/alert-on-malware-rule-screen.png":::

    2. Select Antimalware > + Add rule

      :: :::image type="content" source="media/anti-malware/configure-new-rule-screen.png" alt-text="Screenshot of the Add Rule side panel showing fields for rule name, conditions, and actions with options to alert, block, or ignore." lightbox="media/anti-malware/configure-new-rule-screen.png":::

    3. Enter a rule name.

    4. Select an available action:

      • Ignore MalwareMalware:: Ignore the selected malware.
      • Alert on MalwareMalware:: Generate an alert. For example, ifalert when malware is detected, such as when a rule detects a drifted binary.
      • Block MalwareMalware:: Block the malware from running.
    5. Enter a scope name.

    6. Select a cloud scope and (optional)and, if needed, a specific subscription.

    7. (Optional) SelectIf needed, select a resource scope.

    8. (Optional) AddIf needed, add conditions to the resource scope based on the following categories: Container name, Image name, Namespace, Pod labels, Pod name, or Cluster name. Then choose an operator: Starts with, Ends with, Equals, or Contains. Finally, enter the value to match. You can add as many conditions as needed by selecting +Add condition.

    9. (Optional) SelectIf needed, select the checkbox to exclude binaries from container image.

    10. (Optional) AddIf needed, add an Allow list for processes, a list of to specify the processes that are allowed to run in the container. If a process isn't on thisthe list, an alert is generated.

    11. Select Apply.

    12. Select Save.

    Manage antimalware rules

    Based on the alerts,alerts you receive and review, you might need to adjust the rules in the antimalware policy. This adjustmentThese adjustments might include refining conditions, adding rules, or removing rules that generate many false positives. The goal is to balance security needs with operational efficiency by using effective antimalware policies and rules.

    Effective antimalware detection relies on your active role in configuring, monitoring, and adjusting policies for your environment.

    You can arrange rules by priority by selecting the up or down arrow. The rule with the highest priority (the lowest number) runs first. If a rule matches, the rule action runs and the evaluation ends. If noa rule doesn't match, the system evaluates the next rule. If no rule matches, the system applies the default rules.

    You can manage each rule by using the toolbar controls.

    Next step

    [!div class="nextstepaction"] Overview of Container security in Microsoft Defender for Containers

    \ No newline at end of file