TMAegis
Thêm quy tắc cho openshift

Red Hat OpenShift

TMA-OPENSHIFT-4.2.2

Ensure that the --anonymous-auth argument is set to false

Nghiêm trọngCấp 1Tự độngopenshift

Mô tả

Disable anonymous requests to the Kubelet server. Reads every node's effective kubelet configuration with oc get --raw /api/v1/nodes/<node>/proxy/configz; requires a cluster-admin oc login.

Cách kiểm tra

Phương pháp kiểm tra: Lệnh shell

shell
nodes=$(oc get nodes -o jsonpath='{range .items[*]}{.metadata.name}{"\n"}{end}') || exit 1
[ -n "$nodes" ] || exit 1
ok=1
for n in $nodes; do
  c=$(oc get --raw "/api/v1/nodes/$n/proxy/configz") || exit 1
  if ! { printf '%s' "$c" | grep -Eq '"anonymous":\{"enabled":false\}'; }; then echo "noncompliant: $n"; ok=0; fi
done
if [ "$ok" -eq 1 ]; then echo compliant; fi
Đầu ra mong đợi
compliant

Cách khắc phục

Phương pháp khắc phục: Hướng dẫn hoặc bản vá hạ tầng

Create a kubeletconfig to explicitly disable anonymous authentication. Examples of how to do this can be found in the OpenShift documentation.

Thuộc tính

Hệ điều hành
Bất kỳ
Thẻ
openshiftworker-node
Tham chiếu
CIS Red Hat OpenShift Container Platform Benchmark v2.0.0 - 4.2.2 Ensure that the --anonymous-auth argument is set to false

Kiểm tra máy này

Chạy lệnh này trên máy bạn được phép kiểm tra. Lần quét chỉ ở chế độ đọc.

shell
tmaegis scan --target openshift