Group
Guide to the Secure Configuration of Amazon Elastic Kubernetes Service
Group contains 3 groups and 15 rules |
Group
Kubernetes Settings
Group contains 2 groups and 15 rules |
[ref]
Each section of this configuration guide includes information about the
configuration of a Kubernetes cluster and a set of recommendations for
hardening the configuration. For each hardening recommendation, information
on how to implement the control and/or how to verify or audit the control
is provided. In some cases, remediation information is also provided.
Some of the settings in the hardening guide are in place by default. The
audit information for these settings is provided in order to verify that
the cluster administrator has not made changes that would be less secure.
A small number of items require configuration.
Finally, there are some recommendations that require decisions by the
system operator, such as audit log size, retention, and related settings. |
Group
Kubernetes Kubelet Settings
Group contains 9 rules |
[ref]
The Kubernetes Kubelet is an agent that runs on each node in the cluster. It
makes sure that containers are running in a pod.
The kubelet takes a set of PodSpecs that are provided through various
mechanisms and ensures that the containers described in those PodSpecs are
running and healthy. The kubelet doesn’t manage containers which were not
created by Kubernetes. |
Rule
Disable Anonymous Authentication to the Kubelet
[ref] | By default, anonymous access to the Kubelet server is enabled. This
configuration check ensures that anonymous requests to the Kubelet
server are disabled. Edit the Kubelet server configuration file
/etc/kubernetes/kubelet/kubelet-config.json on the kubelet node(s)
and set the below parameter:
authentication:
...
anonymous:
enabled: false
...
| Rationale: | When enabled, requests that are not rejected by other configured
authentication methods are treated as anonymous requests. These
requests are then served by the Kubelet server. OpenShift Operators should
rely on authentication to authorize access and disallow anonymous
requests. | Severity: | medium | Rule ID: | xccdf_org.ssgproject.content_rule_kubelet_anonymous_auth | References: | | |
|
Rule
Ensure authorization is set to Webhook
[ref] | Unauthenticated/unauthorized users should have no access to OpenShift nodes.
The Kubelet should be set to only allow Webhook authorization.
To ensure that the Kubelet requires authorization,
validate that authorization is configured to Webhook
in /etc/kubernetes/kubelet/kubelet-config.json :
authorization:
mode: Webhook
...
| Rationale: | Ensuring that the authorization is configured correctly helps enforce that
unauthenticated/unauthorized users have no access to OpenShift nodes. | Severity: | medium | Rule ID: | xccdf_org.ssgproject.content_rule_kubelet_authorization_mode | References: | | |
|
Rule
kubelet - Hostname Override handling
[ref] | Normally, OpenShift lets the kubelet get the hostname from either the
cloud provider itself, or from the node's hostname. This ensures that
the PKI allocated by the deployment uses the appropriate values, is valid
and keeps working throughout the lifecycle of the cluster. IP addresses
are not used, and hence this makes it easier for security analysts to
associate kubelet logs with the appropriate node. | Rationale: | Allowing hostnames to be overridden creates issues around resolving nodes
in addition to TLS configuration, certificate validation, and log correlation
and validation. | Severity: | low | Rule ID: | xccdf_org.ssgproject.content_rule_kubelet_disable_hostname_override | References: | nerc-cip | CIP-003-3 R6, CIP-004-3 R3, CIP-007-3 R6.1 | nist | CM-6, CM-6(1) | cis | 3.2.8 |
| |
|
Rule
kubelet - Enable Certificate Rotation
[ref] | To enable the kubelet to rotate client certificates, edit the kubelet configuration
file /etc/kubernetes/kubelet/kubelet-config.json
on the kubelet node(s) and set the below parameter:
...
rotateCertificates: true
...
| Rationale: | Allowing the kubelet to auto-update the certificates ensure that there is no downtime
in certificate renewal as well as ensures confidentiality and integrity. | Severity: | medium | Rule ID: | xccdf_org.ssgproject.content_rule_kubelet_enable_cert_rotation | References: | | |
|
Rule
kubelet - Enable Client Certificate Rotation
[ref] | To enable the kubelet to rotate client certificates, edit the kubelet configuration
file /etc/kubernetes/kubelet/kubelet-config.json
on the kubelet node(s) and set the below parameter:
featureGates:
...
RotateKubeletClientCertificate: true
...
| Rationale: | Allowing the kubelet to auto-update the certificates ensure that there is no downtime
in certificate renewal as well as ensures confidentiality and integrity. | Severity: | medium | Rule ID: | xccdf_org.ssgproject.content_rule_kubelet_enable_client_cert_rotation | References: | | |
|
Rule
kubelet - Allow Automatic Firewall Configuration
[ref] | The kubelet has the ability to automatically configure the firewall to allow
the containers required ports and connections to networking resources and destinations
parameters potentially creating a security incident.
To allow the kubelet to modify the firewall, edit the kubelet configuration
file /etc/kubernetes/kubelet/kubelet-config.json
on the kubelet node(s) and set the below parameter:
makeIPTablesUtilChains: true
| Rationale: | The kubelet should automatically configure the firewall settings to allow access and
networking traffic through. This ensures that when a pod or container is running that
the correct ports are configured as well as removing the ports when a pod or
container is no longer in existence. | Severity: | medium | Rule ID: | xccdf_org.ssgproject.content_rule_kubelet_enable_iptables_util_chains | References: | | |
|
Rule
kubelet - Enable Protect Kernel Defaults
[ref] |
Protect tuned kernel parameters from being overwritten by the kubelet.
| Rationale: | Kernel parameters are usually tuned and hardened by the system administrators
before putting the systems into production. These parameters protect the
kernel and the system. Your kubelet kernel defaults that rely on such
parameters should be appropriately set to match the desired secured system
state. Ignoring this could potentially lead to running pods with undesired
kernel behavior. | Severity: | medium | Rule ID: | xccdf_org.ssgproject.content_rule_kubelet_enable_protect_kernel_defaults | References: | | |
|
Rule
kubelet - Enable Server Certificate Rotation
[ref] | To enable the kubelet to rotate server certificates, edit the kubelet configuration
file /etc/kubernetes/kubelet/kubelet-config.json
on the kubelet node(s) and set the below parameter:
serverTLSBootstrap: true
| Rationale: | Allowing the kubelet to auto-update the certificates ensure that there is no downtime
in certificate renewal as well as ensures confidentiality and integrity. | Severity: | medium | Rule ID: | xccdf_org.ssgproject.content_rule_kubelet_enable_server_cert_rotation | References: | | |
|
Rule
kubelet - Do Not Disable Streaming Timeouts
[ref] | Timouts for streaming connections should not be disabled as they help to prevent
denial-of-service attacks.
To configure streaming connection timeouts
To set the streamingConnectionIdleTimeout option for the kubelet,
create a KubeletConfig option along these lines:
apiVersion: machineconfiguration.openshift.io/v1
kind: KubeletConfig
metadata:
name: kubelet-config-$pool
spec:
machineConfigPoolSelector:
matchLabels:
pools.operator.machineconfiguration.openshift.io/$pool_name: ""
kubeletConfig:
streamingConnectionIdleTimeout: 4h0m0s
| Rationale: | Ensuring connections have timeouts helps to protect against denial-of-service attacks as
well as disconnect inactive connections. In addition, setting connections timeouts helps
to prevent from running out of ephemeral ports. | Severity: | medium | Rule ID: | xccdf_org.ssgproject.content_rule_kubelet_enable_streaming_connections | References: | | |
|
Group
Kubernetes - Worker Node Settings
Group contains 6 rules |
[ref]
Contains evaluations for the worker node configuration settings. |
Rule
Verify Group Who Owns The Kubelet Configuration File
[ref] | To properly set the group owner of /etc/kubernetes/kubelet/kubelet-config.json , run the command: $ sudo chgrp root /etc/kubernetes/kubelet/kubelet-config.json
| Rationale: | The kubelet configuration file contains information about the configuration of the
OpenShift node that is configured on the system. Protection of this file is
critical for OpenShift security. | Severity: | medium | Rule ID: | xccdf_org.ssgproject.content_rule_file_groupowner_kubelet_conf | References: | | |
|
Rule
Verify Group Who Owns The Worker Kubeconfig File
[ref] | To properly set the group owner of /var/lib/kubelet/kubeconfig , run the command: $ sudo chgrp root /var/lib/kubelet/kubeconfig
| Rationale: | The worker kubeconfig file contains information about the administrative configuration of the
OpenShift cluster that is configured on the system. Protection of this file is
critical for OpenShift security. | Severity: | medium | Rule ID: | xccdf_org.ssgproject.content_rule_file_groupowner_worker_kubeconfig | References: | | |
|
Rule
Verify User Who Owns The Kubelet Configuration File
[ref] | To properly set the owner of /etc/kubernetes/kubelet/kubelet-config.json , run the command: $ sudo chown root /etc/kubernetes/kubelet/kubelet-config.json
| Rationale: | The kubelet configuration file contains information about the configuration of the
OpenShift node that is configured on the system. Protection of this file is
critical for OpenShift security. | Severity: | medium | Rule ID: | xccdf_org.ssgproject.content_rule_file_owner_kubelet_conf | References: | | |
|
Rule
Verify User Who Owns The Worker Kubeconfig File
[ref] | To properly set the owner of /var/lib/kubelet/kubeconfig , run the command: $ sudo chown root /var/lib/kubelet/kubeconfig
| Rationale: | The worker kubeconfig file contains information about the administrative configuration of the
OpenShift cluster that is configured on the system. Protection of this file is
critical for OpenShift security. | Severity: | medium | Rule ID: | xccdf_org.ssgproject.content_rule_file_owner_worker_kubeconfig | References: | | |
|
Rule
Verify Permissions on The Kubelet Configuration File
[ref] |
To properly set the permissions of /etc/kubernetes/kubelet/kubelet-config.json , run the command:
$ sudo chmod 0644 /etc/kubernetes/kubelet/kubelet-config.json
| Rationale: | If the kubelet configuration file is writable by a group-owner or the
world the risk of its compromise is increased. The file contains the configuration of
an OpenShift node that is configured on the system. Protection of this file is
critical for OpenShift security. | Severity: | medium | Rule ID: | xccdf_org.ssgproject.content_rule_file_permissions_kubelet_conf | References: | | |
|
Rule
Verify Permissions on the Worker Kubeconfig File
[ref] |
To properly set the permissions of /var/lib/kubelet/kubeconfig , run the command:
$ sudo chmod 0644 /var/lib/kubelet/kubeconfig
| Rationale: | If the worker kubeconfig file is writable by a group-owner or the
world the risk of its compromise is increased. The file contains the administration configuration of the
OpenShift cluster that is configured on the system. Protection of this file is
critical for OpenShift security. | Severity: | medium | Rule ID: | xccdf_org.ssgproject.content_rule_file_permissions_worker_kubeconfig | References: | | |
|