- Cloud Native Applications
- Application Security
- Application Security
- Web Application Security
- Application Security Posture Management (ASPM)
- Microsegmentation
- Python Security
- SaaS Security
- Node.JS Security
- PHP Security
- AI in Cyber Security
- Cybersecurity for Financial Services
- The Principle of Least Privilege (PoLP)
- Identity and Access Management
- Cybersecurity in Banking
- Threat Detection and Response
- Cyber Kill Chain
- Threat Hunting
- Zero Trust Security
- Zero Trust Architecture
- Fileless Attacks
- DSPM
- Container Scanning
- Kubernetes
- Kubernetes
- Kubernetes Alternatives
- Kubernetes Namespace
- Kubernetes Architecture
- Kubernetes Cluster
- Kubernetes Nodes
- Kubernetes Pods
- Kubernetes Jobs
- Kubernetes Workloads
- Kubernetes Monitoring
- Kubernetes Security
- Kubernetes RBAC
- Secret Scanning
- Kubernetes Security Posture Management (KSPM)
- Kubernetes on AWS
- Kubernetes on VMware
- Kubernetes Vulnerability Scanning
- Managing Containers in Kubernetes
- K3s
- eBPF in Kubernetes
- Kubernetes Dashboard
- Kubernetes Operators
- Kubernetes Services
- Kubernetes Devops
- Kubernetes Networking
- Kubernetes ConfigMap
- Kubernetes Management
- Kubernetes Helm
- Kubernetes as a Service
- Kubernetes Serverless
- Kubernetes Tutorials
- Cloud Attacks
- Cloud Attacks
- Malware Attacks
- Zero Day Attack
- Top 10 Cyber Security Threats
- Arbitrary Code Execution
- Cryptojacking
- AI Attacks
- Prompt Injection
- Backdoor Attacks
- Reverse Shell Attack
- Remote Code Execution
- Defense Evasion
- Honeypots in Cybersecurity
- Malware Analysis
- AI Malware
- Lateral Movement
- Advanced Malware Protection
- CNAPP
- AI Security
- Container Platforms
- Containerized Architecture
- Containerized Architecture
- Docker Secrets
- Container Runtime Interface
- Container Images
- Image Scanning
- Container Compliance
- Docker Security Best Practices
- Container Security
- Container Security Best Practices
- Container Security Tools
- ECS Security
- Network Segmentation
- Istio security
- runC
- Service Mesh
- Image Repository
- Container Escape
- Container Runtime
- Docker Container
- OSS Container Image Scanning Tools
- What Is a Container?
- Docker Images
- Containerization 101
- VM vs. Container
- Containerization vs. Virtualization
- Containerized Applications
- Microservices and Containerization
- Registry Scanning
- Docker CVEs
- Docker Monitoring
- Securing Containers with Docker Scanning
- Docker CIS Benchmark
- Seccomp
- Docker Alpine
- Docker API
- Docker Tools
- 100 Best Docker Tutorials
- Docker Alternatives
- Docker Swarm
- Docker Containers vs. Virtual Machines (VMs)
- Docker Architecture
- Docker Networking
- Docker Registries
- Docker Orchestration
- OpenShift vs Docker
- Container Cloud Computing
- Container DevOps
- Docker in Production
- Container Monitoring
- Container Advantages
- Docker Hub
- Serverless Architecture
- Supply Chain Security
- Supply Chain Compliance
- SolarWinds Attack
- Supply Chain Security
- Secure Software Development Lifecycle
- Software Supply Chain Attacks
- Dependency Confusion Attack
- SLSA
- SSDF
- Software Composition Analysis
- Security Misconfigurations
- Repojacking
- Privilege Escalation
- CI/CD Security
- SAST Security
- GitLab Security
- GitHub Secret Scanning
- OWASP Dependency-Check
- Software Bill of Materials
- SBOM Tools
- NPM Vulnerabilities
- Log4j Vulnerability
- Text4Shell
- Secrets Management
- Jenkins Security
- Yarn vs. NPM
- Source Code Leaks
- Container Image Signing
- Open Source Licenses
- Vulnerability Management
- Vulnerability Management Tools
- Vulnerability Scanning Process
- Vulnerability Management
- Vulnerability Scanning
- Vulnerability Prioritization
- Open Source Vulnerability Scanning
- Vulnerability Remediation
- Vulnerability Scanner
- Risk-Based Vulnerability Management
- Vulnerability Exploitability eXchange (VEX)
- Malware Detection
- Fileless Malware
- Attack Vectors
- Malicious Code
- Risk Posture
- Alert Fatigue in Cybersecurity
- Cyber Security Posture
- MITRE ATT&CK
- MITRE ATT&CK Framework
- LLM Security
- Code Scanning
- Attack Surface
- Attack Surface Management
- What Are Indicators of Compromise (IoC)?
- Secure Code
- Configuration Drift
- Trivy
- DevSecOps
- DevSecOps
- DevSecOps Pipeline
- DevSecOps Best Practices
- DevSecOps vs SecDevOps
- Threat Modeling
- Mean Time to Repair (MTTR)
- eBPF Linux
- Cloud DevOps
- DevOps Tools
- GitOps vs DevOps
- Code Security
- Secure Code Review
- DevOps Security
- Infrastructure as Code (IaC) Security
- Infrastructure as Code DevOps
- Executive Order 14028 (U.S. Cybersecurity Executive Order)
- Open Source Security
- Shift-Left Security
- Shift Right Testing and Security
- What Is SecOps (Security Operations)?
- SecDevOps
- DevSecOps Tools
- Linux Security
- Rocky Linux
- Azure DevOps
- Cloud Security
- Cloud Security
- Cloud Security Challenges
- Cloud Security Tools
- Code to Cloud
- Cloud Protection
- Cloud Security Frameworks
- Cloud Security Standards
- Cloud Security Controls
- Cloud Security Posture Management (CSPM)
- AI Workloads
- Cloud Digital Forensics
- Cloud Computing Security Architecture
- What Is Enterprise Cloud Security?
- Virtualized Security
- CSPM Tools
- Vulnerabilities in Cloud Computing
- Top 7 Risks of Cloud Computing
- Cloud Security Assessment
- Cloud Visibility
- Cloud Governance
- Cloud Security Strategy
- Cloud Security Policy
- DFIR
- Cloud Workloads
- Public Cloud Security
- Private Cloud vs. Public Cloud
- Runtime Security
- Azure Cloud Security
- Azure Security Best Practices
- Azure Security vs. AWS Security
- AWS GovCloud: Basics & How It Compares to Azure & GCP
- S3 Security
- Cloud Misconfiguration
- Terraform Security
- Hybrid Cloud Security
- Multi-Cloud Strategy
- Agentless vs. Agent-Based Security & Monitoring
- Cloud Infrastructure Security
- Gartner CSPM
- Cloud Security Scanner
- AWS CIS Benchmark
- Cloud Configuration Management
- Cloud Workload Protection (CWP)
- Cloud Workload Protection Platforms (CWPP)
- Cloud Workload Security
- Cloud Vulnerabilities and Tools that Can Help
- Google Cloud Security
- Shared Responsibility Model
- AWS Shared Responsibility Model
- AWS Cloud Security
- Multi Cloud Security
- Cloud Compliance
- Kubernetes in Production
- Cloud Detection And Response
Kubernetes CIS Benchmark: Best Practices in Brief
Review the CIS Benchmark security best practices, summarized in a few short tables, and learn about automated security testing with kube-bench.
What is Kubernetes CIS Benchmark?
The Kubernetes CIS Benchmark is published by the Center for Internet Security (CIS), a not-for-profit organization that publishes cybersecurity best practices.
CIS Benchmark best practices are an important first step to securing Kubernetes in production by hardening Kubernetes environments. Several open source and commercial tools are available that automatically check Kubernetes clusters to see they are in line with the controls outlined in the benchmark, and flag any non-compliant configurations.
We provide a brief summary of the CIS Benchmark’s best practices, and shows how to use kube-bench to automatically test your Kubernetes deployment for these best practices.
In this article, you will learn:
Kubernetes CIS Benchmark Best Practices
The Kubernetes CIS Benchmark contains over 250 pages of details on how to secure Kubernetes deployments. Below we provide a brief summary of the recommendations provided in each section of the benchmark.
Important: Most of the recommendations are relevant for Kubernetes deployed directly by the organization, but not for managed Kubernetes services such as Amazon Elastic Kubernetes Service (AKS), Google Kubernetes Engine (GKE) or Openshift. This is because these services provide a managed control plane, and may have different command line tools compared to standard Kubernetes.
Related content: read our guide to Kubernetes security best practices ›
Control Plane Components
The CIS benchmark makes several recommendations with regard to configuration of the Kubernetes control plane—including the API Server, etcd, and Container Network Interface (CNI).
Master Node Configuration Files
The following table shows critical files you need to secure, and their recommended settings.
| Control Plane Component | File/Directory to Secure | File Permissions | File Ownership |
| API Server | Pod specification file | 644 or stricter | root:root |
| Controller Manager | Pod specification file | 644 or stricter | root:root |
| Controller Manager | controller-manager.conf | 644 or stricter | root:root |
| Scheduler | Pod specification file | 644 or stricter | root:root |
| Scheduler | scheduler.conf | 644 or stricter | root:root |
| etcd | Pod specification file | 644 or stricter | root:root |
| Container Network | CNI file | 644 or stricter | root:root |
| Interface | |||
| etcd | Data directory | 700 oir stricter | etcd:etcd |
| kubeadm | admin.conf | 644 or stricter | root:root |
| Kubernetes PKI | PKI directory | root:root | |
| Kubernetes PKI | PKI certificate | 644 or stricter | |
| Kubernetes PKI | PKI key files | 600 |
API Server
The following table summarizes recommended settings for the API server.
| Configuration Element | Recommended Setting |
| –anonymous-auth | false |
| –basic-auth-file | not set |
| –anonymous-auth | false |
| –basic-auth-file | not set |
| –token-auth-file | not set |
| –kubelet-https | true |
| –authorization-mode | AlwaysAllow, includes Node and RBAC |
| admission control plugin | EventRateLimit is set AlwaysAdmit not set AlwaysPullImages is set SecurityContextDeny set (if PodSecurityPolicy not used) ServiceAccount is set NamespaceLifecycle is set PodSecurityPolicy is set NodeRestriction is set |
| –insecure-bind-address | not set |
| –insecure-port | 0 |
| –secure-port | 0 |
| –profiling | false |
| –audit-log-path | false |
| –audit-log-maxage | 30 |
| –service-account-lookup | True |
| encryption providers | Only use strong cryptographic ciphers |
| –etcd-certfile | Ensure these parameters / arguments are set to their appropriate values |
| –etcd-keyfile | |
| –tls-cert-file | |
| –tls-private-key-file | |
| –client-ca-file | |
| –etcd-cafile | |
| –encryption-provider-config | |
| –kubelet-client-certificate | |
| –kubelet-client-key | |
| –kubelet-certificate-authority | |
| –audit-log-maxbackup | |
| –audit-log-maxsize | |
| –request-timeout argument | |
| –service-account-key-file |
Controller Manager
The following table summarizes recommended settings for Controller Manager configuration.
| Configuration Element | Recommended Setting |
| –profiling | false |
| –use-service-account-credentials | true |
| RotateKubeletServerCertificate | true |
| –bind-address | 127.0.0.1 |
| –terminated-pod-gc-threshold | Ensure these parameters / arguments are set to their appropriate values |
| –service-account-private-key-file | |
| –root-ca-file |
Scheduler
The following table summarizes recommended settings for Scheduler configuration.
| Configuration Element | Recommended Setting |
| –profiling | false |
| –bind-address | 127.0.0.1 |
etcd
The following table summarizes recommended settings for etcd configuration.
| Configuration Element | Recommended Setting |
| –client-cert-auth | true |
| –auto-tls | true |
| –peer-client-cert-auth | true |
| –peer-auto-tls | true |
| Certificate Authority | Use a unique CA |
| –cert-file | Ensure these parameters / arguments are set to their appropriate values |
| –key-file | |
| –peer-cert-file | |
| –peer-key-file |
Control Plane Configuration
When configuring the Kubernetes control plane, the Kubernetes CIS Benchmark recommends:
- Not using client certificate authentication for users—Kubernetes enables the use of client certificates for user authentication. However, there is no way to revoke these certificates when a user leaves or loses the credentials. So the recommendation is not to use them.
- Minimal audit policy—Kubernetes can audit requests made to the API server. To ensure there is at least a minimal audit trail, the –audit-policy file flag needs to be set.
- Audit policy coverage—security audit logs must record access and modification of any key cluster resources.
Worker Nodes
The Kubernetes CIS benchmark makes several recommendations for securing configuration files and defining specific configuration settings for the Kubelet on worker nodes.
Worker Node Configuration Files
The following table summarizes recommendations for worker securing configuration files.
| File/Directory to Secure | File Permissions | File Ownership |
| kubelet service file | 644 or stricter | root:root |
| proxy kubeconfig file (if exists) | 644 or stricter | root:root |
| –kubeconfig kubelet.conf | 644 or stricter | root:root |
| certificate authorities file | 644 or stricter | root:root |
| kubelet –config | 644 or stricter | root:root |
Kubelet Configuration
The following table summarizes recommendations for the Kubelet configuration.
| Configuration Element | Recommended Setting |
| –anonymous-auth | false |
| –authorization-mode | AlwaysAllow |
| –read-only-port | 0 |
| –streaming-connection-idle-timeout | Not set to 0 |
| –protect-kernel-defaults | true |
| –make-iptables-util-chains | true |
| –hostname-override | not set |
| –event-qps | 0, or another level that enables sufficient event capture |
| –rotate-certificates | not set to false |
| RotateKubeletServerCertificate | true |
| Kubelet cryptography | Uses strong cryptographic cipher |
| –client-ca-file argument | Ensure these parameters / arguments are set to their appropriate values |
| –tls-cert-file | |
| –tls-private-key-file |
Policies
The Kubernetes CIS benchmark recommends specific policies for Kubernetes elements like RBAC, pods and the container network interface (CNI), to improve security.
RBAC, Service Accounts and Admission Control
The following table summarizes recommendations for the RBAC and Service Accounts.
| Policy Pertains To | Recommended Policy |
| cluster-admin role | Only use where required |
| secrets | Ensure minimal access |
| Roles, ClusterRoles | Minimal use of wildcards |
| Create Pod permission | Ensure minimal access |
| Service Account Tokens | Only mount if/when necessary |
| Privileged containers | Minimize admission to all these types of containers |
| Admission control | Configure Image Provenance using ImagePolicyWebhook |
Pods
The following table summarizes recommendations for pods and sensitive containers.
| Policy Pertains To | Recommended Policy |
| Privileged containers | Minimize admission to all these types of containers |
| Containers sharing one of the following: 1. Host process ID namespace 2. Host IPC namespace 3. Host network namespace | |
| Containers with allowPrivilegeEscalation setting | |
| Root containers | |
| Containers with NET_RAW capability | |
| Containers with added or assigned capabilities |
Network Policies and CNI
The following table summarizes recommendations for Kubernetes networking.
| Policy Pertains To | Recommended Policy |
| CNI | Ensure support of network policies |
| Namespaces | Ensure they have network policies defined |
Secrets Management
The following table summarizes recommendations for Kubernetes secrets.
| Policy Pertains To | Recommended Policy |
| Secrets | Prefer storing as files and not as environment variables |
| Secrets | Prefer using external storage |
Related content: read our guide to Kubernetes secrets ›
General Policies
In addition to the recommendations above, the benchmark recommends:
- Creating administrative boundaries using namespaces, and never using the default namespace
- Using the seccomp profile in docker/default pod definitions
- Using Security Context in Pods and Containers
Using kube-bench to Test Your Deployment for CIS Best Practices
You can use kube-bench to check if your Kubernetes deployment runs according to the best practices defined in the CIS Kubernetes Benchmark. However, please note that there is not a one-to-one match between Kubernetes versions and versions of the CIS benchmark, so you cannot achieve 100% accuracy.
Kube-bench is written as a Go application. It is distributed as a container, and can also be installed and run as a standalone binary. To help you quickly update and extend your test suite according to any benchmark changes, each individual kube-bench test is specified in a YAML file. For easy integration with automation tools, kube-bench supports JSON output.
You can run kube-bench on each individual master and worker node, and learn whether each test fails or passes. Kube-bench can also inspect master nodes of managed Kubernetes clusters in services like Google Kubernetes Engine (GKE) and Amazon Elastic Kubernetes Service (EKS).
Additionally, you can get remediation insights for any detected issue, including specific recommendations. For example, you might need to remove insecure settings on a Kubernetes executable, or restrict the permissions on a configuration file.
Kube-bench lets you immediately determine if your configurations corresponds with CIS best practices, including secure measures for data at rest and in transit, implementation of the least privileges principle, and proper application of user authorization and authentication.
When running kube-bench, you can get four output states:
- PASS – the test ran successfully and the results passed the standards.
- FAIL – the test ran successfully and the results failed to meet the standards. You also receive a remediation output, which either describes how you can fix the configuration, or provides an error message that explains why it was not possible to run the test.
- WARN – the test requires further attention. A remediation output provides specific information regarding the matter.
- INFO – provides informational output that does not require any further action.
Learn more about kube-bench ›
Kubernetes Security with Aqua
Aqua tames the complexity of Kubernetes security with KSPM (Kubernetes Security Posture Management) and advanced agentless Kubernetes Runtime Protection.
Aqua provides Kubernetes-native capabilities to achieve policy-driven, full-lifecycle protection and compliance for K8s applications:
- Kubernetes Security Posture Management (KSPM) – a holistic view of the security posture of your Kubernetes infrastructure for accurate reporting and remediation. Helping you identify and remediate security risks.
- Automate Kubernetes security configuration and compliance – identify and remediate risks through security assessments and automated compliance monitoring. Help you enforce policy-driven security monitoring and governance.
- Control pod deployment based on K8s risk – determine admission of workloads across the cluster based on pod, node, and cluster attributes. Enable contextual reduction of risk with out-of-the-box best practices and custom Open Policy Agent (OPA) rules.
- Protect entire clusters with agentless runtime security – runtime protection for Kubernetes workloads with no need for host OS access, for easy, seamless deployment in managed or restricted K8s environments.
- Open Source Kubernetes Security – Aqua provides the most popular open source tools for securing Kubernetes, including Kube-Bench, which assesses Kubernetes clusters against 100+ tests of the CIS Benchmark, and Kube-Hunter, which performs penetration tests using dozens of known attack vectors.
Aqua Cloud Native Application Protection Platform (CNAPP)
Go cloud native with the experts!