Skip to main content

CIS Azure Kubernetes Service (AKS) Benchmark

Overview

Center for Internet Security (CIS) provides set of best practices and security recommendations which is referred to as CIS Azure Kubernetes Service (AKS) Benchmark. These benchmarks are provided for securing the Azure Kubernetes Service (AKS) clusters. Since the organizations are increasingly adopting the container orchestration platforms like AKS, it becomes essential to ensure that these environments are configured securely to mitigate security risks and protect sensitive data.

Purpose

The main purpose of the CIS AKS Benchmark is to provide a thorough and precise set of security guidelines and procedures which are designed especially for AKS clusters. These carefully thought-out principles are designed to help DevOps experts, security teams, and AKS administrators with:

  1. Mitigating Security Hazards: By proactively identifying and mitigating security flaws and misconfigurations that could be exploited by bad actors, the benchmark assists enterprises. Organizations may drastically lower the risk of security lapses and data leaks by following these best practices.

  2. Conformity: It is mandatory for numerous companies and regulatory agencies to implement particular security protocols. In order to ensure a secure and compliant AKS environment, the CIS AKS Benchmark helps enterprises align with industry and regulatory compliance requirements.

  3. Required Standards: The benchmark encourages uniform security procedures throughout the AKS environment. Consistency and uniformity in security configurations are ensured by offering an internationally recognized set of best practices.

Importance

Securing AKS clusters is of paramount importance for the following reasons:

  • Data Protection: AKS clusters often host critical workloads and applications that handle sensitive data. Inadequate security measures can lead to data breaches and data loss.

  • Operational Continuity: Security incidents can disrupt operations and lead to downtime. A secure AKS environment is crucial for maintaining business continuity.

  • Reputation and Trust: Security incidents can damage an organization's reputation and erode the trust of customers and partners. A proactive security approach is vital for maintaining trust and integrity.

  • Legal and Regulatory Compliance: Many industries and jurisdictions have stringent data protection and security regulations. Non-compliance can result in legal penalties and liabilities.

By implementing the recommendations outlined in the CIS AKS Benchmark, organizations can significantly bolster the security of their AKS clusters, protect their assets, and mitigate potential threats effectively.

How BOS targets CIS AKS Benchmarks v1.4.0

Benchmark IndexCIS Benchmark RecommendationBOS Env Template SupportsBOS Pipeline Template SupportsBOS DefaultComments
2.1Logging
2.1.1Enable audit Logs (Manual)YesNAYesBOS Environment Template support enabling of audit logs for AKS.
3.1Worker Node Configuration Files
3.1.1Ensure that the kubeconfig file permissions are set to 644 or more restrictive (Manual)NANANAThe CIS Kubernetes benchmark recommends these files must have certain permission requirements. AKS clusters use a Helm chart to deploy control plane pods and don't rely on files in the node VM.
3.1.2Ensure that the kubelet kubeconfig file ownership is set to root:root (Manual)NANANAThe CIS Kubernetes benchmark recommends these files must have certain permission requirements. AKS clusters use a Helm chart to deploy control plane pods and don't rely on files in the node VM.
3.1.3Ensure that the kubelet configuration file has permissions set to 644 or more restrictive (Manual)NANAYesThis is implemented by Azure as part of AKS Creation. AKS nodes are managed by azure and this control is auto enabled in it.
3.1.4Ensure that the kubelet configuration file ownership is set to root:root (Manual)NANAYesThis is implemented by Azure as part of AKS Creation. AKS nodes are managed by azure and this control is auto enabled in it.
3.2Kubelet
3.2.1Ensure that the --anonymous-auth argument is set to false (Automated)NANAYesThis is implemented by Azure as part of AKS Creation. AKS nodes are managed by azure and this control is auto enabled in it.
3.2.2Ensure that the --authorization-mode argument is not set to AlwaysAllow (Automated)NANAYesThis is implemented by Azure as part of AKS Creation. AKS nodes are managed by azure and this control is auto enabled in it.
3.2.3Ensure that the --client-ca-file argument is set as appropriate (Automated)NANAYesThis is implemented by Azure as part of AKS Creation. AKS nodes are managed by azure and this control is auto enabled in it.
3.2.4Ensure that the --read-only-port is secured (Manual)NANAYesThis is implemented by Azure as part of AKS Creation. AKS nodes are managed by azure and this control is auto enabled in it.
3.2.5Ensure that the --streaming-connection-idle-timeout argument is not set to 0 (Automated)NANAYesThis is implemented by Azure as part of AKS Creation. AKS nodes are managed by azure and this control is auto enabled in it.
3.2.6Ensure that the --make-iptables-util-chains argument is set to true (Automated)NANAYesThis is implemented by Azure as part of AKS Creation. AKS nodes are managed by azure and this control is auto enabled in it.
3.2.7Ensure that the --hostname-override argument is not set (Manual)NANAYesThis is implemented by Azure as part of AKS Creation. AKS nodes are managed by azure and this control is auto enabled in it.
3.2.8Ensure that the --eventRecordQPS argument is set to 0 or a level which ensures appropriate event capture (Automated)NANAYesThis is implemented by Azure as part of AKS Creation. AKS nodes are managed by azure and this control is auto enabled in it.
3.2.9Ensure that the --rotate-certificates argument is not set to false (Automated)NANAYesThis is implemented by Azure as part of AKS Creation. AKS nodes are managed by azure and this control is auto enabled in it.
3.2.10Ensure that the RotateKubeletServerCertificate argument is set to true (Manual)NANAYesThis is implemented by Azure as part of AKS Creation. AKS nodes are managed by azure and this control is auto enabled in it.
4.1RBAC and Service Accounts
4.1.1Ensure that the cluster-admin role is only used where required (Manual)NAYesYesNo explicit cluster role bindings are created. Every deployment is controlled by BOS Pipelines.
4.1.2Minimize access to secrets (Manual)NAYesYesNo explicit access to secret is given. Every deployment is controlled by BOS Pipelines.
4.1.3Minimize wildcard use in Roles and ClusterRoles (Manual)NAYesYesNo wildcards are used. Every deployment is controlled by BOS Pipelines.
4.1.4Minimize access to create pods (Manual)NAYesYesNo explicit access is given to create pods. Every deployment is controlled by BOS Pipelines.
4.1.5Ensure that default service accounts are not actively used. (Manual)NANANABOS Pipeline template uses Subscription level SP for accessing the cluster to deploy containers.
4.1.6Ensure that Service Account Tokens are only mounted where necessary (Manual)NANANABOS Pipeline template uses Subscription level SP for accessing the cluster to deploy containers
4.2Pod Security Standards
4.2.1Minimize the admission of privileged containers (Manual)NAYesYesBOS Pipeline template uses security context to define privilege permission, Privilege Escalation, root permissions, capabilities for each pods and container in a given namespace.
4.2.2Minimize the admission of containers wishing to share the host process ID namespace (Manual)NAYesYesBOS Pipeline template uses security context to define privilege permission, Privilege Escalation, root permissions, capabilities for each pods and container in a given namespace.
4.2.3Minimize the admission of containers wishing to share the host IPC namespace (Manual)NAYesYesBOS Pipeline template uses security context to define privilege permission, Privilege Escalation, root permissions, capabilities for each pods and container in a given namespace.
4.2.4Minimize the admission of containers wishing to share the host network namespace (Manual)NAYesYesBOS Pipeline template uses security context to define privilege permission, Privilege Escalation, root permissions, capabilities for each pods and container in a given namespace.
4.2.5Minimize the admission of containers with allowPrivilegeEscalation (Manual)NAYesYesBOS Pipeline template uses security context to define privilege permission, Privilege Escalation, root permissions, capabilities for each pods and container in a given namespace.
4.2.6Minimize the admission of root containers (Manual)NAYesYesBOS Pipeline template uses security context to define privilege permission, Privilege Escalation, root permissions, capabilities for each pods and container in a given namespace.
4.2.7Minimize the admission of containers with added capabilities (Manual)NAYesYesBOS Pipeline template uses security context to define privilege permission, Privilege Escalation, root permissions, capabilities for each pods and container in a given namespace.
4.2.8Minimize the admission of containers with capabilities assigned (Manual)NAYesYesBOS Pipeline template uses security context to define privilege permission, Privilege Escalation, root permissions, capabilities for each pods and container in a given namespace.
4.3Azure Policy / OPA
4.3A more modern alternative to the PSP is the Open Policy Agent (OPA) and OPAGatekeeper. OPA is an admission controller which is integrated with the OPA ConstraintFramework to enforce Custom Resource Definition (CRD) based policies and allow declaratively configured policies to be reliably shareable. The Kubernetes projects is shifting focus from PSPs to OPAs.YesNAYesAzure Policy is enabled on the AKS cluster. BOS Environment Template creates AKS Cluster with Azure Policy is enabled, controlled via a parameter.
4.4CNI Plugin
4.4.1Ensure latest CNI version is used (Manual)YesNAYesAzure CNI is enabled on the AKS cluster. BOS Environment Template creates AKS Cluster with Azure Policy is enabled, controlled via a parameter.
4.4.2Ensure that all Namespaces have Network Policies defined (Manual)NAYesYesBOS Pipeline Template have Network Policies defined. Every deployment is controlled by BOS Pipelines.
4.5Secrets Management
4.5.1Prefer using secrets as files over secrets as environment variables (Manual)NANANAThe current release of the BOS template does not offer support for this.
4.5.2Consider external secret storage (Manual)NANANAThe current release of the BOS template does not offer support for this.
4.6Extensible Admission Control
4.6.1Verify that admission controllers are working as expected (Manual)YesNAYesAzure Policy is enabled on the AKS cluster. BOS Environment Template creates AKS Cluster with Azure Policy is enabled, controlled via a parameter.
4.7General Policies
4.7.1Create administrative boundaries between resources using namespaces (Manual)NAYesYesBOS Pipeline Templates uses separate namespaces for separate environments. Every deployment is controlled by BOS Pipelines.
4.7.2Apply Security Context to Your Pods and Containers (Manual)NAYesYesBOS Pipeline Template have Security Context defined. Every deployment is controlled by BOS Pipelines.
4.7.3The default namespace should not be used (Manual)NAYesYesBOS Pipeline Templates does not use default Namespace for any deployments. Every deployment is controlled by BOS Pipelines.
5.1Image Registry and Image Scanning
5.1.1Ensure Image Vulnerability Scanning using Azure Defender image scanning or a third party provider (Manual)YesNAYesBOS Environment Templates enables Azure defender lists down the Vulnerabilities
5.1.2Minimize user access to Azure Container Registry (ACR) (Manual)YesNAYesBOS Environment Templates created AKS cluster which has just acrpull access on the ACR registry created along with it.
5.1.3Minimize cluster access to read-only for Azure Container Registry (ACR) (Manual)YesNAYesBOS Environment Templates created AKS cluster which has just acrpull access on the ACR registry created along with it.
5.1.4Minimize Container Registries to only those approved (Manual)YesNAYesBOS Environment Templates created AKS cluster which has just acrpull access on the ACR registry created along with it.
5.2Access and identity options for Azure Kubernetes Service (AKS)
5.2.1Prefer using dedicated AKS Service Accounts (Manual)NAYesNABOS Pipeline template uses Subscription level SP for accessing the cluster to deploy containers.
5.3Key Management Service (KMS)
5.3.1Ensure Kubernetes Secrets are encrypted (Manual)NANANAThe current release of the BOS template does not offer support for this.
5.4Cluster Networking
5.4.1Restrict Access to the Control Plane Endpoint (Manual)YesNAYesBOS Environment Templates created AKS Cluster which can be accessed with only authorized IPs.
5.4.2Ensure clusters are created with Private Endpoint Enabled and Public Access Disabled (Manual)NANANAThe current release of the BOS template does not offer support for this.
5.4.3Ensure clusters are created with Private Nodes (Manual)YesNAYesNodes Created by BOS Environment Template has only Private IP.
5.4.4Ensure Network Policy is Enabled and set as appropriate (Manual)YesNAYesAzure Network Policy is enabled on the AKS cluster. BOS Environment Template creates AKS Cluster with Azure Network Policy is enabled, controlled via a parameter.
5.4.5Encrypt traffic to HTTPS load balancers with TLS certificates (Manual)NAYesYesBOS Pipeline Template uses Certificate in Application gateway Ingress Controller to enable HTTPS
5.5Authentication and Authorization
5.5.1Manage Kubernetes RBAC users with Azure AD (Manual)NANANAThe current release of the BOS template does not offer support for this.
5.5.2Use Azure RBAC for Kubernetes Authorization (Manual)NANANAThe current release of the BOS template does not offer support for this.
5.6Other Cluster Configurations
5.6.1Restrict untrusted workloads (Manual)NANANAThe current release of the BOS template does not offer support for this.
5.6.2Hostile multi-tenant workloads (Manual)NANANAThe current release of the BOS template does not offer support for this.