Description:

Microsoft Defender for Containers is a security solution designed to protect containerized applications and services in Azure. It offers advanced threat protection for container workloads, including Azure Kubernetes Service (AKS) and other container environments. Enabling Microsoft Defender for Containers provides enhanced security monitoring, vulnerability scanning, and protection against threats targeting containers, images, and orchestrators.

Rationale:

Enabling Microsoft Defender for Containers ensures that your containerized workloads are continuously monitored for potential threats. This includes real-time vulnerability assessments, malware scanning, and the detection of anomalous behavior. Defender for Containers helps meet compliance requirements and mitigates risks by identifying and addressing security issues in containers before they can be exploited.

Impact:

Enabling Microsoft Defender for Containers ensures that your containerized workloads are monitored for threats, but it may introduce additional resource consumption for security scanning and monitoring. Additionally, there may be associated costs for Defender's advanced security features. However, these are outweighed by the security and operational benefits of protecting containerized environments.

Default Value:

By default, Microsoft Defender for Containers is not enabled. It must be manually configured in Microsoft Defender for Cloud.

Pre-requisites:

  • Azure subscription with Microsoft Defender for Cloud enabled.

  • Azure Kubernetes Service (AKS) or other containerized environments deployed.

  • The user must have Owner, Contributor, or Security Admin role permissions.

Audit:

  1. Sign in to the Azure portal as an Owner, Contributor, or Security Admin.

  2. Navigate to Microsoft Defender for Cloud.

  3. Ensure that Microsoft Defender for Containers is enabled for your containerized resources (e.g., AKS clusters).

Implementation Steps (Automated):

  1. Sign in to Azure portal:

    • Use an account with Owner, Contributor, or Security Admin permissions.

  2. Navigate to Microsoft Defender for Cloud:

    • In the Azure portal, go to Microsoft Defender for Cloud (formerly Azure Security Center).

  3. Enable Defender for Containers:

    • In Microsoft Defender for Cloud, click on Environment settings.

    • Under Defender plans, ensure that Microsoft Defender for Containers is enabled.

    • If it’s not enabled, select the Enable option for Microsoft Defender for Containers.

  4. Use Azure CLI to Enable Defender for Containers (Optional): If you prefer to enable Microsoft Defender for Containers using the Azure CLI, run the following commands:

    • First, ensure that Azure CLI is installed and you’re logged in with an account that has sufficient permissions.

Run the following command to enable Defender for Containers:

az security pricing create --name Containers --tier Standard

Verify that Defender for Containers is enabled using the following command:

az security pricing show --name Containers
  1. Enable Defender for AKS: If you're using Azure Kubernetes Service (AKS), ensure that Defender for Containers is enabled for your AKS clusters:

    • In Microsoft Defender for Cloud, navigate to Defender plans.

    • Under Defender for Kubernetes, select Enable.

    • This enables continuous vulnerability scanning and threat protection for AKS environments.

  2. Configure Container Image Scanning:

    • Set up container image scanning to continuously check container images in Azure Container Registry (ACR) for vulnerabilities.

    • Enable Security Center integration with Azure Container Registry to scan for vulnerabilities in images as they are pushed to the registry.

  3. Monitor Alerts and Recommendations:

    • After enabling Defender for Containers, monitor the Microsoft Defender for Cloud dashboard for alerts and recommendations related to your containerized environments.

    • Review and act on any identified vulnerabilities or threats to improve the security posture of your container workloads.

  4. Test Defender for Containers:

    • Test the functionality by deploying containers or AKS clusters with known vulnerabilities and verify that Defender for Containers detects them.

    • Ensure that security alerts are generated when vulnerabilities are found.

Backout Plan (Automated):

  1. Sign in to Azure portal:

    • Use an account with Owner, Contributor, or Security Admin permissions.

  2. Navigate to Microsoft Defender for Cloud:

    • Go to Microsoft Defender for Cloud.

  3. Disable Defender for Containers:

    • In Microsoft Defender for Cloud, go to Environment settings.

    • Under Defender plans, toggle Microsoft Defender for Containers to Off to disable the service.

Use Azure CLI to Disable: To disable Defender for Containers via Azure CLI, run the following command:

az security pricing create --name Containers --tier None
  1. Verify Disabled Status:

Verify that Defender for Containers is disabled by running:

az security pricing show --name Containers
  1. Monitor Logs:

    • Review Microsoft Defender for Cloud to ensure that no further alerts or recommendations are generated for container workloads after disabling Defender for Containers.

References: