Attempting to launch kubectl in the Rancher v2.x UI, for a cluster upon which the Rancher CIS Hardening Guide has been applied, results in a
Closed Code: 1006 message. Further, using the browser developer tools to inspect requests when opening this page reveals the API request to initiate the connection (https:///v3/clusters/?shell=true) receiving a HTTP 403 response.
- An RKE CLI or Rancher v2.x launched Kubernetes cluster, with the Rancher v2.1.x, v2.2.x or v2.3.x CIS Hardening Guide applied.
This behaviour is caused by CIS Control 1.1.12, which specifies that the DenyEscalatingExec Admission Controller should be enabled on the Kubernetes API Server.
The terminal for the Rancher UI is provided by exec'ing into a cattle-node-agent Pod, whilst Pods within this DaemonSet run in Privileged mode. As a result the exec to open the terminal session is denied by the DenyEscalatingExec Admission Controller.
You can workaround the issue by removing
DenyEscalatingExec from the list of
extra_args for the
This issue is tracked in the Rancher GitHub issue #19439.