AzureTracks

Practical Azure and Microsoft 365 security walkthroughs

· ·

Secure AKS with Microsoft Defender for Containers

Goal: Enable Microsoft Defender for Containers for AKS and validate posture, image vulnerability, and runtime security signals.

AKS security spans several layers: cluster configuration, node pools, container images, identities, network exposure, and runtime behavior. A cluster can pass a simple deployment test and still carry risky images, exposed workloads, or suspicious runtime activity.

This article walks through enabling Defender for Containers for an AKS pilot, validating cluster coverage, reviewing image and posture findings, and preparing the findings for engineering remediation. The goal is a security workflow that container and platform teams can operate together.

Figure 1. Small architecture diagram for the build path and finished state.

Why build this?

Defender for Containers is useful when AKS security needs to combine posture, vulnerability, and runtime signals rather than relying on one tool per layer. The key is to validate the signal path and owner assignment before scaling to all clusters.

Start with a cluster that has real workloads but manageable blast radius. The pilot should prove coverage, findings, and remediation ownership, not just plan enablement.

Security outcome

  • AKS cluster posture and container findings are visible in Defender for Cloud.
  • Image vulnerability findings are mapped to repository or workload owners.
  • Runtime and posture alerts have a triage path before production expansion.

What you will deploy or configure

  • Defender for Containers enabled for the subscription.
  • AKS cluster coverage validated.
  • Image and runtime findings reviewed.
  • Alert routing and remediation ownership documented.
Microsoft baseline: Enable the Defender for Containers plan through Defender for Cloud and validate the cluster appears healthy before relying on findings. Keep AKS RBAC, network policy, and image governance in place as separate controls.
Special Highlight: For production clusters, add admission control or pipeline gates after visibility is stable. Do not start with blocking controls until the finding volume and false-positive profile are understood.

Prerequisites

  • AKS cluster in a supported region.
  • Defender for Containers plan licensing.
  • Cluster admin or appropriate Azure permissions to validate coverage.
  • Container registry and workload owner participation.

Before-state checklist

Capture the before state first. This gives the article stronger screenshots, helps readers understand what changed, and gives administrators a clean rollback reference.

  • Record the current plan, policy, connector, rule, identity, or workspace setting before making changes.
  • Capture current access behavior or alert visibility so the final validation has a clear before/after comparison.
  • Confirm the owner for the resource and the person who can approve rollback if the pilot exposes a dependency.
  • Check whether existing logs, alerts, or recommendations already exist so the article does not confuse old data with new validation evidence.

Lab build

Use one AKS cluster and one representative workload. Enable the plan in Microsoft Defender for Cloud , wait for findings, then validate that cluster, image, and workload context appears in Defender for Cloud.

Shown above: Navigate to Defender for Cloud > Environment settings > Settings > Select Subscription to view different plans and pricing in your tenant. The features are highlighted above.

Learn more: https://learn.microsoft.com/en-us/azure/defender-for-cloud/support-matrix-defender-for-containers?tabs=azureva%2Cazurert%2Cazurespm%2Cazurecssc%2Cawsnet&WT.mc_id=Portal-Microsoft_Azure_Security#supported-features-by-environment

Enable Containers in MDC by moving the slider to ON.

Next Steps:

  1. Review AKS cluster baseline: private/public API server, RBAC, node pools, network policy, and image sources.
  2. Enable Microsoft Defender for Containers for the subscription in Defender for Cloud.
  3. Confirm the AKS cluster appears in Defender inventory and that required components or extensions report healthy.
  4. Review container image vulnerability findings and prioritize images running in production namespaces.
  5. Review runtime security alerts and map them to incident handling procedures.
  6. Fix one concrete issue, such as an exposed dashboard, privileged container, vulnerable base image, or overly permissive Kubernetes role.
  7. Create an operating cadence: weekly critical image review, runtime alert triage, and monthly cluster posture review.

Change-window notes

  • Schedule the pilot when a resource owner can validate application behavior immediately after the change.
  • Keep the first production change intentionally narrow. A smaller but verified rollout is better than a broad rollout with uncertain impact.
  • Do not remove the old control path until the new validation evidence is captured and reviewed.
  • For controls that can affect traffic flow, authentication, backup retention, or alert volume, pre-stage the rollback steps in the change ticket.

Get Hands On

Use the following block as a starting point for validation or implementation. Replace names, scopes, and resource identifiers before using it in production.

# AKS inventory and extension checks

az aks list -o table
# Kubernetes-side review examples
kubectl get pods -A
kubectl get rolebindings,clusterrolebindings -A
kubectl get networkpolicy -A

Production hardening

For production, tie Defender for Containers findings to the container build pipeline and platform backlog. A finding should identify the image, workload, namespace, owner, severity, and remediation path.

  • Treat this control as part of the normal security operations backlog, not as a one-time portal configuration. Assign a named owner and review cadence before wider rollout.
  • Use tags or a documented inventory to identify owner, environment, data sensitivity, and business criticality before expanding beyond the pilot.
  • Separate deployment permission from approval permission. Security controls are stronger when one identity cannot both weaken and approve the control.
  • Send logs, alerts, or audit evidence to the existing SOC workflow instead of creating a new place that nobody checks.
  • Create an exception process with owner, expiry date, business justification, and compensating controls.
  • Add the configuration to your normal change-management and monthly control-review process.

Operational handoff

  • Add the new control to the monthly security review or platform operations checklist.
  • Record the expected alert owner, escalation path, and response time for findings created by the control.
  • Store the validation query, screenshot checklist, and rollback notes with the service runbook.
  • Review exceptions quarterly and remove any exception that no longer has a business owner or expiry date.

Finished-state validation

Figure 2. Finished-state validation chart for the completed build.

ControlExpected resultEvidence to capture
PlanDefender for Containers is enabledDefender plans
ClusterAKS cluster appears covered/healthyDefender inventory
ImagesVulnerability findings are visibleRecommendations
RuntimeAlerts have an incident pathDefender alerts
RemediationOne high-risk finding is fixedRecommendation state
CadenceOwners and review rhythm existRunbook

Cost and licensing notes

Defender for Containers is a paid Defender for Cloud plan. Build cost review into AKS subscription onboarding and avoid enabling noisy clusters without an alert ownership model.

For publication, add a tenant-specific cost note after the pilot. A good AzureTracks post should tell readers where cost can change without attempting to replace the official pricing calculator.

Known limitations and edge cases

  • Coverage and components vary by Kubernetes environment and region.
  • Visibility is not the same as enforcement.
  • Application teams still need secure image build practices and dependency management.

Troubleshooting

  • If the control does not appear enabled, re-check RBAC at the subscription and resource scope before changing the configuration again.
  • If logs or recommendations do not appear immediately, confirm documented data latency before assuming the deployment failed.
  • If a production dependency breaks, stop expansion, capture the failing path, and compare it against the before-state inventory.
  • If an alert is noisy, tune scope and ownership first. Do not suppress security signals globally without a review record.

Rollback or cleanup

  • For lab resources, remove the pilot association, policy assignment, connector, rule, or configuration after screenshots and validation are complete.
  • For production resources, rollback should be a controlled change that restores the last known-good configuration and preserves audit evidence.
  • For irreversible settings, such as locked backup immutability, rollback is not available. Treat the approval step as the control point.

References

  • https://learn.microsoft.com/en-us/azure/defender-for-cloud/defender-for-containers-introduction (https://learn.microsoft.com/en-us/azure/defender-for-cloud/defender-for-containers-introduction)

About AzureTracks

AzureTracks publishes practical Azure and Microsoft 365 security guidance with deployment, validation, operational, and rollback considerations.

Learn more about Andrew and the site’s technical approach →