Ensure that your Azure Kubernetes Service (AKS) clusters are configured to use Image Cleaner to automatically detect and remove unused container images from nodes, preventing storage issues and potential security risks. Enabling it improves overall security and reduces manual maintenance efforts.
Pipelines are commonly used to build and deploy container images on Azure Kubernetes Service (AKS) clusters. However, while they efficiently create images, they often overlook stale images left behind, leading to image bloat on cluster nodes. These outdated images may also pose security risks due to potential vulnerabilities. To enhance cluster security, it's important to remove these unreferenced images. Manually cleaning them can be time-consuming, but Image Cleaner automates the process by identifying and removing unused images, reducing both security risks and the time needed for cleanup.
Audit
To determine if Image Cleaner is enabled for your Azure Kubernetes Service (AKS) clusters, perform the following operations:
Checking the Image Cleaner feature status for AKS clusters using Microsoft Azure Portal (Azure Console) is not currently supported.Remediation / Resolution
To enable the Image Cleaner feature in order to clean up vulnerable stale images on your Azure Kubernetes Service (AKS) clusters, perform the following operations:
Enabling Image Cleaner for AKS clusters using Microsoft Azure Portal (Azure Console) is not currently supported.References
- Azure Official Documentation
- Security concepts for applications and clusters in Azure Kubernetes Service (AKS)
- Vulnerability management for Azure Kubernetes Service (AKS)
- Use Image Cleaner to clean up vulnerable stale images on your Azure Kubernetes Service (AKS) cluster
- Azure PowerShell Documentation
- az account list
- az account set
- az aks list
- az aks show
- az aks