CIS Red Hat OpenShift Container Platform Benchmark v1.6.0 - Control 1.2.3
Profile Applicability
- Level: 1
Description
Do not use token based authentication.
Rationale
The token-based authentication utilizes static tokens to authenticate requests to the apiserver. The tokens are stored in clear-text in a file on the apiserver, and cannot be revoked or rotated without restarting the apiserver. Hence, do not use static token-based authentication.
Impact
OpenShift does not use the token-auth-file flag. OpenShift includes a built-in OAuth server rather than relying on a static token file. The OAuth server is integrated with the API server.
Audit Procedure
OpenShift does not use the token-auth-file flag. OpenShift includes a built-in OAuth server rather than relying on a static token file. Authentication is managed by the OpenShift authentication-operator. To verify that the token-auth-file flag is not present and that the authentication-operator is running, run the following commands:
# Verify that the token-auth-file flag is not present
oc get configmap config -n openshift-kube-apiserver -ojson | jq -r '.data["config.yaml"]' | jq '.apiServerArguments'
oc get configmap config -n openshift-apiserver -ojson | jq -r '.data["config.yaml"]' | jq '.apiServerArguments'
oc get kubeapiservers.operator.openshift.io cluster -o json | jq '.spec.observedConfig.apiServerArguments'
#Verify that the authentication operator is running
oc get clusteroperator authentication
Verify that the --token-auth-file argument does not exist.
Verify that the authentication-operator is running: Available is True.
Remediation
None is required.
Default Value
By default, --token-auth-file argument is not set and OAuth authentication is configured.
References
- https://docs.openshift.com/container-platform/4.5/authentication/configuring-internal-oauth.html
- https://docs.openshift.com/container-platform/4.5/authentication/understanding-authentication.html
- https://docs.openshift.com/container-platform/4.5/operators/operator-reference.html#cluster-authentication-operator_red-hat-operators
- https://docs.openshift.com/container-platform/4.5/operators/operator-reference.html#kube-apiserver-operator_red-hat-operators
- https://docs.openshift.com/container-platform/4.5/operators/operator-reference.html#openshift-apiserver-operator_red-hat-operators
- https://kubernetes.io/docs/reference/access-authn-authz/authentication/#static-token-file
- https://kubernetes.io/docs/reference/command-line-tools-reference/kube-apiserver/
CIS Controls
| Controls Version | Control | IG 1 | IG 2 | IG 3 |
|---|---|---|---|---|
| v8 | 4.6 Securely Manage Enterprise Assets and Software | x | x | x |
| v7 | 16.4 Encrypt or Hash all Authentication Credentials | x | x |
MITRE ATT&CK Mappings
| Techniques / Sub-techniques | Tactics | Mitigations |
|---|---|---|
| T1078 | TA0001, TA0006 | M1043 |
Profile
Level 1 (Manual)