CIS 1.23 Self-Assessment Guide
CIS Kubernetes Benchmark v1.23 - RKE2
Overview
This document is a companion to the RKE2 security hardening guide. The hardening guide provides prescriptive guidance for hardening a production installation of RKE2, and this benchmark guide is meant to help you evaluate the level of security of the hardened cluster against each control in the CIS Kubernetes benchmark. It is to be used by RKE2 operators, security teams, auditors, and decision makers.
This guide is specific to the v1.25 release line of RKE2 and the v1.23 release of the CIS Kubernetes Benchmark.
For more details about each control, including detailed descriptions and remediations for failing tests, you can refer to the corresponding section of the CIS Kubernetes Benchmark v1.23 You can download the benchmark after logging in to CISecurity.org.
Testing controls methodology
Each control in the CIS Kubernetes Benchmark was evaluated against an RKE2 cluster that was configured according to the accompanying hardening guide.
Where control audits differ from the original CIS benchmark, the audit commands specific to RKE2 are provided for testing.
These are the possible results for each control:
- Pass - The RKE2 cluster under test passed the audit outlined in the benchmark.
- Not Applicable - The control is not applicable to RKE2 because of how it is designed to operate. The remediation section will explain why this is so.
- Manual - Operator Dependent - The control is Manual in the CIS benchmark and it depends on the cluster's use case or some other factor that must be determined by the cluster operator. These controls have been evaluated to ensure RKE2 does not prevent their implementation, but no further configuration or auditing of the cluster under test has been performed.
Controls
1 Master Node Security Configuration
1.1 Master Node Configuration Files
1.1.1
Ensure that the API server pod specification file permissions are set to 644 or more restrictive (Automated)
Details
Rationale
The API server pod specification file controls various parameters that set the behavior of the API server. You should restrict its file permissions to maintain the integrity of the file. The file should be writable by only the administrators on the system.Result: Pass
Audit:
stat -c %a /var/lib/rancher/rke2/agent/pod-manifests/kube-apiserver.yaml
644
Remediation:
By default, RKE2 creates these files with 644
permissions. No manual remediation needed.
1.1.2
Ensure that the API server pod specification file ownership is set to root:root
(Automated)
Details
Rationale
The API server pod specification file controls various parameters that set the behavior of the API server. You should set its file ownership to maintain the integrity of the file. The file should be owned byroot:root
.Result: Pass
Audit:
stat -c %U:%G /var/lib/rancher/rke2/agent/pod-manifests/kube-apiserver.yaml
root:root
Remediation:
By default, RKE2 creates these files with root:root
ownership. No manual remediation needed.
1.1.3
Ensure that the controller manager pod specification file permissions are set to 644
or more restrictive (Automated)
Details
Rationale
The controller manager pod specification file controls various parameters that set the behavior of the Controller Manager on the master node. You should restrict its file permissions to maintain the integrity of the file. The file should be writable by only the administrators on the system.Result: Pass
Audit:
stat -c %a /var/lib/rancher/rke2/agent/pod-manifests/kube-controller-manager.yaml
644
Remediation:
By default, RKE2 creates these files with 644
permissions. No manual remediation needed.
1.1.4
Ensure that the controller manager pod specification file ownership is set to root:root
(Automated)
Details
Rationale
The controller manager pod specification file controls various parameters that set the behavior of various components of the master node. You should set its file ownership to maintain the integrity of the file. The file should be owned by root:root.Result: Pass
Audit:
stat -c %U:%G /var/lib/rancher/rke2/agent/pod-manifests/kube-controller-manager.yaml
root:root
Remediation:
By default, RKE2 creates these files with root:root
ownership. No manual remediation needed.
1.1.5
Ensure that the scheduler pod specification file permissions are set to 644
or more restrictive (Automated)
Details
Rationale
The scheduler pod specification file controls various parameters that set the behavior of the Scheduler service in the master node. You should restrict its file permissions to maintain the integrity of the file. The file should be writable by only the administrators on the system.Result: Pass
Audit:
stat -c %a /var/lib/rancher/rke2/agent/pod-manifests/kube-scheduler.yaml
644
Remediation:
By default, RKE2 creates these files with 644
permissions. No manual remediation needed.
1.1.6
Ensure that the scheduler pod specification file ownership is set to root:root
(Automated)
Details
Rationale
The scheduler pod specification file controls various parameters that set the behavior of the kube-scheduler service in the master node. You should set its file ownership to maintain the integrity of the file. The file should be owned by root:root.Result: Pass
Audit:
stat -c %U:%G /var/lib/rancher/rke2/agent/pod-manifests/kube-scheduler.yaml
root:root
Remediation:
By default, RKE2 creates these files with root:root
ownership. No manual remediation needed.
1.1.7
Ensure that the etcd pod specification file permissions are set to 644
or more restrictive (Automated)
Details
Rationale
The etcd pod specification file /var/lib/rancher/rke2/agent/pod-manifests/etcd.yaml controls various parameters that set the behavior of the etcd service in the master node. etcd is a highly-available key-value store which Kubernetes uses for persistent storage of all of its REST API object. You should restrict its file permissions to maintain the integrity of the file. The file should be writable by only the administrators on the system.Result: Pass
Audit:
stat -c %a /var/lib/rancher/rke2/agent/pod-manifests/etcd.yaml
644
Remediation:
By default, RKE2 creates these files with 644
permissions. No manual remediation needed.
1.1.8
Ensure that the etcd pod specification file ownership is set to root:root
(Automated)
Details
Rationale
The etcd pod specification file /var/lib/rancher/rke2/agent/pod-manifests/etcd.yaml controls various parameters that set the behavior of the etcd service in the master node. etcd is a highly-available key-value store which Kubernetes uses for persistent storage of all of its REST API object. You should set its file ownership to maintain the integrity of the file. The file should be owned by root:root.Result: Pass
Audit:
stat -c %U:%G /var/lib/rancher/rke2/agent/pod-manifests/etcd.yaml
root:root
Remediation:
By default, RKE2 creates these files with root:root
ownership. No manual remediation needed.
1.1.9
Ensure that the Container Network Interface file permissions are set to 644 or more restrictive (Manual)
Details
Rationale
Container Network Interface provides various networking options for overlay networking. You should consult their documentation and restrict their respective file permissions to maintain the integrity of those files. Those files should be writable by only the administrators on the system.Result: Pass
Audit:
stat -c %a /var/lib/rancher/rke2/server/manifests/rke2-canal.yml
644
Remediation:
RKE2 deploys the default CNI, Canal, using a Helm chart. The chart is defined as a custom resource in a file with 644
permissions. No manual remediation needed.
1.1.10
Ensure that the Container Network Interface file ownership is set to root:root
(Manual)
Details
Rationale
Container Network Interface provides various networking options for overlay networking. You should consult their documentation and restrict their respective file permissions to maintain the integrity of those files. Those files should be owned by root:root.Result: Pass
Audit:
stat -c %U:%G /var/lib/rancher/rke2/server/manifests/rke2-canal.yml
root:root
Remediation:
RKE2 deploys the default CNI, Canal, using a Helm chart. The chart is defined as a custom resource in a file with root:root
ownership. No manual remediation needed.
1.1.11
Ensure that the etcd data directory permissions are set to 700 or more restrictive (Automated)
Details
Rationale
etcd is a highly-available key-value store used by Kubernetes deployments for persistent storage of all of its REST API objects. This data directory should be protected from any unauthorized reads or writes. It should not be readable or writable by any group members or the world.Result: Pass
Audit:
stat -c %a /var/lib/rancher/rke2/server/db/etcd
700
Remediation: RKE2 manages the etcd data directory and sets its permissions to 700. No manual remediation needed.
1.1.12
Ensure that the etcd data directory ownership is set to etcd:etcd
(Automated)
Details
Rationale
etcd is a highly-available key-value store used by Kubernetes deployments for persistent storage of all of its REST API objects. This data directory should be protected from any unauthorized reads or writes. It should be owned by etcd:etcd.Result: Pass
Audit:
stat -c %U:%G /var/lib/rancher/rke2/server/db/etcd
etcd:etcd
Remediation:
When running RKE2 with the profile
flag set to cis-1.23
, RKE2 will refuse to start if the etcd
user and group doesn't exist on the host. If it does exist, RKE2 will automatically set the ownership of the etcd data directory to etcd:etcd
and ensure the etcd static pod is started with that user and group.
1.1.13
Ensure that the admin.conf
file permissions are set to 644
or more restrictive (Automated)
Details
Rationale
The admin.conf is the administrator kubeconfig file defining various settings for the administration of the cluster. You should restrict its file permissions to maintain the integrity of the file. The file should be writable by only the administrators on the system.In RKE2, this file is located at /var/lib/rancher/rke2/server/cred/admin.kubeconfig
.
Result: Pass
Audit:
stat -c %a /var/lib/rancher/rke2/server/cred/admin.kubeconfig
644
Remediation:
By default, RKE2 creates this file at /var/lib/rancher/rke2/server/cred/admin.kubeconfig
and automatically sets its permissions to 644
. No manual remediation needed.
1.1.14
Ensure that the admin.conf file ownership is set to root:root
(Automated)
Details
Rationale
The admin.conf file contains the admin credentials for the cluster. You should set its file ownership to maintain the integrity of the file. The file should be owned by root:root.In RKE2, this file is located at /var/lib/rancher/rke2/server/cred/admin.kubeconfig
.
Result: Pass
Audit:
stat -c %U:%G /var/lib/rancher/rke2/server/cred/admin.kubeconfig
root:root
Remediation:
By default, RKE2 creates this file at stat -c %U:%G /var/lib/rancher/rke2/server/cred/admin.kubeconfig
and automatically sets its ownership to root:root
.
1.1.15
Ensure that the scheduler.conf
file permissions are set to 644
or more restrictive (Automated)
Rationale
The scheduler.conf file is the kubeconfig file for the Scheduler. You should restrict its file permissions to maintain the integrity of the file. The file should be writable by only the administrators on the system.
In RKE2, this file is located at /var/lib/rancher/rke2/server/cred/scheduler.kubeconfig
.
Result: Pass
Audit:
stat -c %a /var/lib/rancher/rke2/server/cred/scheduler.kubeconfig
644
Remediation:
By default, RKE2 creates this file at /var/lib/rancher/rke2/server/cred/scheduler.kubeconfig
and automatically sets its permissions to 644
. No manual remediation needed.
1.1.16
Ensure that the scheduler.conf
file ownership is set to root:root
(Automated)
Details
Rationale
The scheduler.conf file is the kubeconfig file for the Scheduler. You should set its file ownership to maintain the integrity of the file. The file should be owned by root:root.In RKE2, this file is located at /var/lib/rancher/rke2/server/cred/scheduler.kubeconfig
.
Result: Pass
Audit:
stat -c %U:%G /var/lib/rancher/rke2/server/cred/scheduler.kubeconfig
root:root
Remediation:
By default, RKE2 creates this file at /var/lib/rancher/rke2/server/cred/scheduler.kubeconfig
and automatically sets its ownership to root:root
.
1.1.17
Ensure that the controller.kubeconfig
file permissions are set to 644
or more restrictive (Automated)
Details
Rationale
The controller.kubeconfig file is the kubeconfig file for the Scheduler. You should restrict its file permissions to maintain the integrity of the file. The file should be writable by only the administrators on the system.In RKE2, this file is located at /var/lib/rancher/rke2/server/cred/controller.kubeconfig
.
Result: Pass
Audit:
stat -c %a /var/lib/rancher/rke2/server/cred/controller.kubeconfig
644
Remediation:
By default, RKE2 creates this file at /var/lib/rancher/rke2/server/cred/controller.kubeconfig
and automatically sets its permissions to 644
. No manual remediation needed.