Introduction
Container security starts with the application image, but the operating system running Kubernetes nodes is equally important. A compromised node can expose container workloads, application secrets, network connections, and other cluster resources. For this reason, organizations running production workloads on Azure Kubernetes Service (AKS) need a consistent approach to securing the underlying node operating system.
Azure Container Linux (ACL) is a container-optimized, immutable operating system designed for AKS. It includes security features such as Secure Boot, virtual Trusted Platform Module (vTPM), dm-verity, and SELinux enforcement. These features reduce the possibility of unauthorized operating system changes and help maintain a consistent security posture across nodes.
The Center for Internet Security (CIS) has also published a dedicated CIS Azure Container Linux Benchmark. This benchmark provides security configuration recommendations that organizations can use to assess their ACL environments.
However, applying a CIS benchmark to an immutable operating system is different from hardening a traditional Linux server. Administrators cannot simply install packages, modify system files, and run a collection of remediation scripts. They must understand the operating system's security model and use supported AKS configuration mechanisms.
This article explains how to use CIS security benchmarks to assess and harden Azure Container Linux on AKS.
Understanding Azure Container Linux
Azure Container Linux is based on the Flatcar Container Linux project. Microsoft maintains and integrates it with Azure services and AKS to provide a minimal, security-focused operating system for container workloads.
Unlike a traditional Linux distribution, ACL follows an immutable operating system model. Its system files are protected against unauthorized runtime modifications, and node updates are delivered through complete operating system images.
The main security characteristics include:
Immutable filesystem
ACL protects the /usr directory using dm-verity. The directory is mounted as read-only, and the kernel validates its contents against a signed root hash.
This makes it difficult for an attacker or an unauthorized process to modify system binaries and libraries.
It also reduces configuration drift because nodes use a consistent operating system image instead of accumulating manual changes over time.
SELinux enforcement
ACL includes Security-Enhanced Linux (SELinux), which provides mandatory access control.
SELinux restricts what processes can access, even when traditional Linux file permissions would otherwise allow access.
For example, a process running with elevated privileges does not automatically receive unrestricted access to every system resource. SELinux policies continue to enforce access restrictions.
SELinux runs in enforcing mode by default in ACL.
Secure Boot and vTPM
ACL requires Trusted Launch with Secure Boot and a virtual Trusted Platform Module.
It uses a Unified Kernel Image (UKI), which combines the kernel, initial RAM filesystem, and kernel command-line configuration into a signed artifact.
During startup, the boot components are measured and recorded in the vTPM. This helps establish whether the system started using trusted components.
Minimal operating system
ACL contains only the components required to run container workloads. A smaller operating system reduces the number of installed components and potential attack surfaces.
It also does not provide a traditional package manager or RPM database on the node. This is an important operational difference when performing security assessments and vulnerability scans.
Understanding the CIS Azure Container Linux Benchmark
The CIS Benchmark is a collection of security configuration recommendations developed through industry consensus.
It helps administrators evaluate whether systems follow recognized security practices.
CIS benchmarks generally organize recommendations into two levels:
Level | Purpose |
|---|
Level 1 | Essential security settings designed to improve protection with limited operational impact |
Level 2 | More restrictive security settings for environments requiring stronger security controls |
The CIS website lists a dedicated Azure Container Linux Benchmark version 1.0.0. It also lists separate benchmarks for AKS Optimized Azure Linux 2 and AKS Optimized Azure Linux 3.
These benchmarks must not be treated as interchangeable. Azure Container Linux and Azure Linux Container Host are different AKS operating system options with different architectures and update models.
Microsoft also publishes separate benchmark guidance for Azure Linux 3.0 Container Host. That guidance does not automatically describe the CIS assessment status of Azure Container Linux.
Before beginning an assessment, confirm the exact operating system and benchmark version used by the cluster.
Preparing an AKS Cluster With Azure Container Linux
Azure Container Linux is generally available as an AKS operating system option starting with AKS Kubernetes version 1.34.
The following example creates an AKS cluster using ACL.
Create the resource group
export RESOURCE_GROUP="acl-security-rg"
export REGION="eastus"
export CLUSTER_NAME="acl-security-cluster"
az group create \
--name $RESOURCE_GROUP \
--location $REGION
Create the AKS cluster
Use the AzureContainerLinux operating system SKU.
az aks create \
--resource-group $RESOURCE_GROUP \
--name $CLUSTER_NAME \
--os-sku AzureContainerLinux \
--node-count 3 \
--generate-ssh-keys
This command creates an AKS cluster with Azure Container Linux nodes.
ACL requires Trusted Launch with Secure Boot and vTPM. It does not support Generation 1 virtual machines or non-Trusted Launch configurations.
Connect to the cluster
Retrieve the cluster credentials:
az aks get-credentials \
--resource-group $RESOURCE_GROUP \
--name $CLUSTER_NAME
Verify the nodes:
kubectl get nodes -o wide
Check the operating system image version:
az aks nodepool list \
--resource-group $RESOURCE_GROUP \
--cluster-name $CLUSTER_NAME \
--query "[].{Name:name,OS:osSku,ImageVersion:nodeImageVersion}" \
--output table
Confirm that the node pool uses the expected ACL image before starting the CIS assessment.
Assessing ACL Against the CIS Benchmark
The first step in hardening is assessment. Administrators should identify which recommendations are already satisfied and which require additional controls.
Obtain the appropriate CIS Azure Container Linux Benchmark and review its recommendations.
The assessment should distinguish between:
- Controls enforced by the ACL operating system.
- Controls managed by AKS or Azure infrastructure.
- Controls that depend on cluster configuration.
- Controls that require workload-level security settings.
- Controls that are not applicable to the selected operating system or deployment model.
This distinction prevents administrators from applying inappropriate remediation instructions.
Review operating system security settings
ACL includes several security mechanisms by default. Validate the actual node configuration instead of assuming that every CIS recommendation is automatically satisfied.
For example, administrators can inspect the operating system's package inventory through its SPDX manifests.
Connect to an ACL node using Kubernetes debugging:
kubectl debug node/<node-name> -it \
--image=mcr.microsoft.com/cbl-mariner/base/core:2.0
From the debugging environment, access the host filesystem:
chroot /host
List the available operating system package manifests:
ls /usr/share/os-manifests/
Inspect package identifiers:
grep -h -o '"pkg:rpm/[^"]*"' \
/usr/share/os-manifests/*.spdx.json
ACL provides these SPDX manifests because the node does not include a traditional RPM database or package manager.
Security scanners can use the package names and versions in the manifests to match installed components against vulnerability information.
The base operating system manifest and any system extension manifests should be considered together when building a complete package inventory.
Validate SELinux
SELinux is enabled in enforcing mode by default.
Administrators can inspect its current mode from the node:
getenforce
The expected result is:
Enforcing
Enforcing mode means SELinux policies are actively applied rather than merely recording violations.
Avoid disabling SELinux to resolve application compatibility problems. Investigate the relevant denial messages and adjust supported application or system configurations instead.
Review filesystem protection
The immutable filesystem is one of ACL's most important security features.
Inspect the /usr mount:
findmnt /usr
The output should indicate that the filesystem is mounted read-only.
Do not attempt to make the directory writable as a normal hardening or troubleshooting procedure. The immutable filesystem is part of the operating system's integrity protection model.
Applying Additional Kubernetes Security Controls
A CIS operating system benchmark does not cover every security requirement in an AKS environment. Node security must be combined with Kubernetes workload, identity, and network controls.
Enforce Pod Security Admission
Pod Security Admission helps prevent workloads from using dangerous container configurations.
For example, apply the restricted Pod Security Standard to an application namespace:
kubectl label namespace production \
pod-security.kubernetes.io/enforce=restricted \
pod-security.kubernetes.io/audit=restricted \
pod-security.kubernetes.io/warn=restricted
The restricted policy helps prevent configurations such as privileged containers, host namespace sharing, and unsafe volume access.
Before enforcing it in production, test existing workloads. Some applications may need changes to run without elevated privileges.
Restrict container privileges
Configure application containers to use non-root identities and read-only root filesystems wherever possible.
Example:
apiVersion: v1
kind: Pod
metadata:
name: secure-application
namespace: production
spec:
securityContext:
runAsNonRoot: true
seccompProfile:
type: RuntimeDefault
containers:
- name: application
image: myregistry.azurecr.io/application:v1
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities:
drop:
- ALL
resources:
requests:
cpu: 100m
memory: 128Mi
limits:
cpu: 500m
memory: 512Mi
This example reduces container privileges and limits resource consumption.
The image must support non-root execution and a read-only root filesystem. Applications that need temporary files should use explicitly configured writable volumes.
Restrict network communication
Use Kubernetes NetworkPolicies to control communication between pods.
For example, the following policy denies ingress traffic to pods in a namespace unless another policy explicitly allows it.
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: default-deny-ingress
namespace: production
spec:
podSelector: {}
policyTypes:
- Ingress
Apply the policy:
kubectl apply -f default-deny-ingress.yaml
Add separate policies for approved application communication.
Network policy enforcement depends on the configured AKS networking implementation. Validate that the selected network plugin supports the policies before relying on them as a security boundary.
Managing Security Updates
A secure operating system needs regular security updates.
ACL uses image-based updates rather than traditional package-level updates. New AKS node images include operating system security fixes and bug fixes.
The supported node OS upgrade channels for ACL are NodeImage and None. The Unmanaged and SecurityPatch channels are incompatible with ACL's immutable filesystem model.
For most production clusters, the NodeImage channel provides a practical approach to receiving updated node images.
Configure it using Azure CLI:
az aks update \
--resource-group $RESOURCE_GROUP \
--name $CLUSTER_NAME \
--node-os-upgrade-channel NodeImage
Node image upgrades can replace or reimage nodes. Configure maintenance windows and surge capacity to reduce disruption during updates.
Also monitor the node image version:
az aks nodepool list \
--resource-group $RESOURCE_GROUP \
--cluster-name $CLUSTER_NAME \
--query "[].{Name:name,ImageVersion:nodeImageVersion}" \
--output table
This helps administrators confirm that node pools are using the expected image versions.
Common Mistakes to Avoid
Applying the wrong CIS benchmark
Azure Container Linux and Azure Linux Container Host are separate operating systems. Using the Azure Linux 3.0 Container Host assessment results as proof of ACL compliance can produce misleading results.
Always select the benchmark that matches the actual operating system.
Running traditional package remediation scripts
ACL does not use a traditional package manager on its nodes. Scripts that depend on dnf, rpm, or package installation may fail or conflict with the immutable operating system design.
Use supported image updates and system extensions instead of modifying protected system files.
Disabling SELinux to fix application issues
Disabling SELinux weakens an important security boundary. Investigate access denials and correct application permissions or supported policy configurations.
Ignoring Kubernetes workload security
A hardened node does not automatically make every container secure. Privileged pods, exposed secrets, excessive service account permissions, and unrestricted network access can still create security risks.
Delaying node image updates
A secure baseline is not permanent. New vulnerabilities are discovered regularly, so node image updates and vulnerability assessments must remain part of the operational process.
Best Practices for Production Environments
Organizations should maintain a documented CIS assessment process for every ACL node image and benchmark version.
Use the following practices:
- Confirm the exact operating system and CIS benchmark version before assessing compliance.
- Use an assessment tool that explicitly supports the selected ACL benchmark and its evaluation requirements.
- Preserve the original assessment results for auditing and compliance reporting.
- Use SPDX package manifests to support operating system vulnerability analysis.
- Keep SELinux in enforcing mode and investigate policy violations instead of disabling protection.
- Enforce restricted pod security settings and non-root container execution.
- Apply network policies and Azure network controls to restrict unnecessary communication.
- Configure the NodeImage upgrade channel and schedule maintenance windows.
- Review security findings after node image updates because benchmark results can change between releases.
A useful production workflow is to assess, prioritize, validate, and document. Not every benchmark recommendation should be applied blindly. Some controls may already be implemented through an equivalent Azure or Kubernetes mechanism, while others may require workload-specific decisions.
Advantages and Disadvantages
Advantages | Disadvantages |
|---|
Immutable operating system reduces configuration drift | Traditional package-level customization is unavailable |
Secure Boot and vTPM help protect the boot chain | Requires compatible Trusted Launch VM configurations |
SELinux enforces mandatory access control | Some applications may need compatibility testing |
CIS benchmark provides a structured assessment baseline | Compliance still requires workload and cluster-level controls |
SPDX manifests support package vulnerability analysis | Security tools must support the ACL inventory model |
Image-based updates simplify consistent node servicing | Node image upgrades require maintenance planning |
Conclusion
Hardening Azure Container Linux with CIS security benchmarks requires more than applying a list of Linux configuration commands. ACL uses an immutable operating system model with Secure Boot, vTPM, dm-verity, and SELinux to protect AKS nodes.
The CIS Azure Container Linux Benchmark provides a structured way to evaluate the node security configuration. However, administrators must select the correct benchmark, understand which controls are managed by ACL or AKS, and avoid applying traditional Linux remediation scripts that conflict with the immutable design.
For production environments, combine CIS assessments with Kubernetes workload security, network restrictions, vulnerability monitoring, and regular node image updates. This layered approach helps maintain a consistent security posture across the operating system, Kubernetes platform, and application workloads.
Azure Container LinuxAKS securityCIS BenchmarkKubernetes node hardeningSELinuxTrusted LaunchSecure Boot
Join the conversation! Your thoughts help the community grow.