Verify that Microsoft Defender for Containers Is Set To 'On'
Why this matters
Containerized workloads—such as Kubernetes clusters, container registries, and running container images—introduce dynamic and distributed attack surfaces. Without dedicated runtime protection and vulnerability management, misconfigurations and exploitable images can remain undetected.
Microsoft Defender for Containers strengthens defense-in-depth by providing:
- Vulnerability assessment for container images
- Runtime threat detection for Kubernetes workloads
- Security posture management via Azure Policy
- Agentless scanning and discovery capabilities
If this plan is disabled, container workloads may lack centralized threat detection, vulnerability insights, and continuous monitoring. This increases the risk of undetected compromises, supply chain attacks, and compliance violations.
Note: Microsoft Defender for Container Registries (ContainerRegistry) is deprecated and replaced by Microsoft Defender for Containers (Containers).
What this check does
This Auto Check verifies that Microsoft Defender for Containers is enabled at the subscription level and that all required protection components are active.
Check Logic
Passes if:
- Pricing tier for
Containersis set toStandard, and - The following extensions are enabled (
isEnabled = True): ContainerRegistriesVulnerabilityAssessmentsAgentlessDiscoveryForKubernetesAgentlessVmScanningContainerSensor
Fails if:
- Pricing tier is
Free,Disabled, or unset, or - Any required extension is disabled.
Applies to:
- All Azure subscriptions
- Kubernetes clusters (AKS and connected clusters)
- Azure Container Registries
- Multi-cloud and hybrid container workloads connected to Defender for Cloud
The check queries Microsoft Defender for Cloud pricing configuration via Azure Security APIs.
How to fix it
Enable Microsoft Defender for Containers and all required extensions.
Azure Portal
- Go to Microsoft Defender for Cloud.
- Select Environment settings.
- Choose the relevant subscription.
- Open Defender plans.
- Under Cloud Workload Protection (CWP), locate Containers.
- Set Status to On.
- If Monitoring coverage shows Partial, open Settings.
- Enable all components.
- Click Save.
- Repeat for each subscription.
Azure CLI
Run:
az security pricing create \
-n 'Containers' \
--tier 'standard' \
--extensions name=ContainerRegistriesVulnerabilityAssessments isEnabled=True \
--extensions name=AgentlessDiscoveryForKubernetes isEnabled=True \
--extensions name=AgentlessVmScanning isEnabled=True \
--extensions name=ContainerSensor isEnabled=True
Repeat for each subscription as needed.
PowerShell
Run:
Set-AzSecurityPricing -Name 'Containers' -PricingTier 'Standard' -Extension `
'[{"name":"ContainerRegistriesVulnerabilityAssessments","isEnabled":"True"},
{"name":"AgentlessDiscoveryForKubernetes","isEnabled":"True"},
{"name":"AgentlessVmScanning","isEnabled":"True"},
{"name":"ContainerSensor","isEnabled":"True"}]'
Repeat for each subscription.
Default value
Microsoft Defender for Containers is disabled by default.
Impact
Incurs additional cost per vCore.
Pricing depends on monitored workloads and enabled extensions.
Cost estimation should be reviewed before enabling across multiple subscriptions.
Exceptions
- No standard exceptions are recommended for production environments.
- If Defender for Containers must remain disabled:
- Document the business justification.
- Implement alternative runtime protection and vulnerability scanning controls.
- Ensure centralized logging and threat detection is in place.
Further resources
- https://learn.microsoft.com/en-us/cli/azure/security/pricing
- https://learn.microsoft.com/en-us/powershell/module/az.security/get-azsecuritypricing
- https://learn.microsoft.com/en-us/powershell/module/az.security/set-azsecuritypricing
- https://learn.microsoft.com/en-us/azure/defender-for-cloud/defender-for-containers-introduction
- https://learn.microsoft.com/en-us/azure/defender-for-cloud/tutorial-enable-containers-azure
- https://learn.microsoft.com/en-us/security/benchmark/azure/mcsb-logging-threat-detection#lt-1-enable-threat-detection-capabilities