Domain 3 β€” Module 7 of 8 88%
21 of 28 overall
Domain 3: Secure compute Free ⏱ ~13 min read

Defender for Containers: AKS, ACR, ACI, Container Apps Security

Container security on Azure end-to-end β€” Defender for Containers across AKS, ACR, ACI, and Container Apps. Vulnerability scanning of images, admission control, runtime threat detection, registry protection, and the security controls each compute tier exposes.

One Defender plan, four compute tiers

Simple explanation

Containers on Azure can run in four different places: Azure Kubernetes Service (AKS), Azure Container Apps, Azure Container Instances (ACI), and via container support in App Service. They all pull images from Azure Container Registry (ACR).

Microsoft Defender for Containers is the single Defender for Cloud plan that protects the container surface across all of these. It does three things:

  • Scans container images in ACR for vulnerabilities β€” before they’re pulled, and continuously as new CVEs are disclosed.
  • Scans the runtime in AKS clusters for behavioural threats β€” suspicious processes inside containers, anomalous Kubernetes API calls, sensitive volume mounts, lateral movement signals.
  • Hardens posture β€” Kubernetes admission control via Azure Policy (with Gatekeeper under the hood), CIS benchmark and Microsoft Cloud Security Benchmark recommendations, secret-scanning of images.

Plus each compute tier has its own native security controls β€” RBAC, network isolation, identity, image signing β€” that you must know how to configure.

Defender for Containers β€” coverage at a glance

Defender for Containers coverage across the four Azure container compute surfaces
Defender capabilityAKSContainer AppsACIACR
Vulnerability scanning of imagesβœ“ (via ACR)βœ“ (via ACR)βœ“ (via ACR)βœ“ direct
Runtime threat detection (in-cluster)βœ“ (Defender sensor on nodes)Limited β€” platform managed; runtime detection is more about anomalous control plane eventsLimitedN/A (not a runtime)
Kubernetes admission control via Azure Policyβœ“N/AN/AN/A
Hardening recommendations (CIS + MCSB)βœ“βœ“βœ“βœ“
Secrets scanning of image layersβœ“βœ“βœ“βœ“
Defender XDR integrationβœ“βœ“βœ“βœ“

Azure Kubernetes Service (AKS) security controls

AKS-specific SC-500 surfaces:

  • Authentication: Microsoft Entra ID integration for the cluster’s API. Two patterns:
    • Entra integration (legacy) β€” the cluster uses Entra users/groups for kubectl auth via a kubelogin plugin.
    • Entra integration with Azure RBAC for Kubernetes Authorisation β€” both authentication AND authorisation flow through Microsoft Entra + Azure RBAC. The modern default.
  • Authorisation: Azure RBAC for Kubernetes Authorization replaces Kubernetes RBAC for cluster-scoped and namespace-scoped operations. Built-in roles: Azure Kubernetes Service RBAC Reader, ... Writer, ... Admin, ... Cluster Admin.
  • Network: control plane public/private (private cluster β€” control plane reached over Private Endpoint), node pool networking (Azure CNI / Overlay / Kubenet), Cilium for advanced network policy, ingress via Application Gateway for Containers / AGIC / managed NGINX.
  • Workload identity: federation between Kubernetes service accounts and Entra ID user-assigned managed identities (covered in identity module 4). Replaces the legacy β€œpod-managed identity” path.
  • Pod security: Pod Security Admission (the Kubernetes built-in), Azure Policy for Kubernetes admission rules, Defender sensor for runtime detection.
  • Confidential containers: AKS supports confidential container node pools on AMD SEV-SNP and Intel TDX, with workload attestation.

Azure Container Registry (ACR) security controls

  • Authentication: Microsoft Entra ID (token via az acr login or pull-from-compute managed identity), repository-scoped tokens for fine-grained CI/CD, admin user disabled (the SC-500 right answer when admin user is mentioned).
  • Network: ACR firewall (allow selected VNets and IPs), Private Endpoint for VNet-only access, trusted Azure services exception.
  • Content trust / signing: image signing via Notation (and Notary v2) for supply-chain integrity; combined with admission-time signature verification on AKS.
  • Encryption: encryption at rest with platform or customer-managed keys (CMK).
  • Geo-replication: replicates the registry to multiple regions; available on Premium SKU.
  • Defender integration: Defender for Containers scans ACR images on push, on pull (over the last 30 days), and continuously against MDVM.

Azure Container Instances (ACI) security controls

  • Authentication to ACR: managed identity is the right pattern (replaces imagePullSecrets with credentials).
  • Network: deploy ACI into a delegated subnet for VNet integration.
  • Identity: ACI supports system-assigned and user-assigned managed identities for the container’s outbound auth.
  • Confidential containers: ACI supports confidential containers on AMD SEV-SNP for memory-encrypted workloads.

Azure Container Apps security controls

  • Identity: managed identities for both the container app’s outbound auth and ACR image pulls.
  • Network: deploy into a Container Apps environment with VNet integration (workload profiles environment); internal-only ingress (no public IP).
  • Ingress: managed certificates, custom domain bindings, IP restrictions, mTLS between apps within the environment.
  • Secrets: native secrets store with optional Key Vault references β€” but managed identity to read directly from Key Vault is the cleaner SC-500 pattern.
  • Defender integration: image vulnerability scanning via ACR; CSPM and hardening recommendations apply.
The 'admin user enabled on ACR' trap

ACR has an β€œadmin user” capability β€” a built-in username/password that can pull and push to the registry. It exists for legacy compatibility with tools that require basic auth.

SC-500 questions that mention admin user enabled are almost always pointing at a remediation: disable the admin user, switch the consuming compute to managed-identity-based auth on the appropriate AcrPull (or AcrPush) RBAC role on the registry.

This is the same managed-identity-vs-stored-credential pattern from Domain 1, applied to ACR specifically. The right answer is always managed identity + RBAC.

Scenario: Ravi hardens Maple Genomics’ AKS workloads

Maple Genomics runs Foundry-adjacent workloads (image preprocessing, vector indexers, batch pipelines) on AKS. Ravi’s hardening pass:

  1. AKS: rotate to Entra integration with Azure RBAC for Kubernetes Authorisation. Cluster is a private cluster (control plane on Private Endpoint).
  2. Identity: workload identity federation across all pods β€” service accounts federate to user-assigned managed identities; no stored secrets in the cluster.
  3. Network: Azure CNI Overlay, Cilium for network policy, Application Gateway for Containers for ingress with WAF in front.
  4. Image source: single ACR (Premium, geo-replicated), admin user disabled, public access disabled, Private Endpoint only. Image signing with Notation; AKS admission policy requires signed images.
  5. Defender for Containers Plan: enabled on the subscription. Defender sensor deployed to all AKS node pools. ACR vulnerability scanning on push, pull, continuous.
  6. Azure Policy for Kubernetes: built-in initiative Kubernetes cluster pods should only use approved host network and port range + custom Gatekeeper policy disallowing privileged: true containers.
  7. Confidential containers: a dedicated confidential-container node pool for the patient-data preprocessing workload (memory-encrypted AMD SEV-SNP).

After: zero standing AKS admin access (everything via Entra + RBAC + PIM), zero credentials in the cluster (workload identity federation), zero unsigned images admitted, runtime threats surfaced to Defender XDR, posture continuously scored against CIS + MCSB.

Key terms

Question

What is Microsoft Defender for Containers?

Click or press Enter to reveal answer

Answer

A Microsoft Defender for Cloud workload protection plan covering container workloads on AKS, Azure Container Apps, ACI, App Service for Containers, plus EKS/GKE via multicloud connectors and Arc-enabled Kubernetes. Provides image vulnerability scanning (via ACR), runtime threat detection in clusters (via Defender sensor), Kubernetes admission control via Azure Policy + Gatekeeper, hardening recommendations (CIS + MCSB), and secret scanning in image layers.

Click to flip back

Question

What is 'Azure RBAC for Kubernetes Authorisation' on AKS?

Click or press Enter to reveal answer

Answer

An AKS authorisation mode where Azure RBAC role assignments β€” built-in roles like `Azure Kubernetes Service RBAC Reader/Writer/Admin/Cluster Admin` β€” control both authentication AND authorisation to the Kubernetes API. Replaces native Kubernetes RBAC bindings with Azure RBAC for cluster-scoped and namespace-scoped operations. The modern default for SC-500.

Click to flip back

Question

Why should the ACR admin user be disabled?

Click or press Enter to reveal answer

Answer

The ACR admin user is a built-in username/password for legacy basic-auth use cases. It bypasses Microsoft Entra, can't be scoped per-action, and is a stored credential that can leak. The SC-500 right answer: disable admin user; consuming compute uses managed identity with the `AcrPull` (or `AcrPush`) RBAC role on the registry. Same managed-identity pattern as Domain 1 applied to ACR.

Click to flip back

Question

What is Azure Policy for Kubernetes?

Click or press Enter to reveal answer

Answer

An Azure Policy extension that uses Open Policy Agent (OPA) Gatekeeper under the hood to enforce admission rules in AKS clusters β€” required labels, allowed images, disallow privileged containers, allowed Linux capabilities, image signature verification, and many others. Built-in initiatives align with MCSB and CIS Kubernetes benchmark; custom constraint templates extend coverage.

Click to flip back

Question

What is workload identity federation in AKS?

Click or press Enter to reveal answer

Answer

A pattern where Kubernetes service accounts in an AKS cluster federate to a user-assigned managed identity in Microsoft Entra via a federated identity credential. Pods using the service account obtain Entra tokens via the Azure Identity SDK with no stored client secret β€” replacing the legacy 'pod-managed identity' pattern. The SC-500 default for AKS workload-to-Azure-service authentication.

Click to flip back

Knowledge check

Knowledge Check

Ravi at Maple Genomics is hardening an AKS cluster that pulls images from an ACR with admin user currently enabled. He wants to disable admin user and have AKS pods pull images without any stored credential. What is the right pattern?

Knowledge Check

Esme at Northwind Bank is reviewing AKS cluster security at the bank. She needs: Microsoft Entra-driven kubectl access, native Kubernetes resource authorisation via Azure RBAC, AND a control plane reachable only from her core banking VNet. Which AKS configuration matches?

Knowledge Check

Asha at Aurora Health Service wants to ensure ONLY signed container images can run in her AKS clusters. Which Azure-managed pattern fits?

What’s next

Final Domain 3 module: App Service, Functions, Logic Apps + WAF + APIM API protection β€” the platform services tier security controls, the Azure Web Application Firewall (in Front Door / Application Gateway), and the back-end API protection patterns in Azure API Management.