TMAegisBeta
Thêm quy tắc cho openshift

Red Hat OpenShift

TMA-OPENSHIFT-4.2.5

Verify that the read only port is not used or is set to 0

Trung bìnhCấp 1Tự độngopenshift

Mô tả

Disable the read-only port. Requires an oc login with read access to openshift-kube-apiserver; checks apiServerArguments kubelet-read-only-port is ["0"].

Cách kiểm tra

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

shell
v=$(oc -n openshift-kube-apiserver get configmap config -o jsonpath='{.data.config\.yaml}') || exit 1
if printf '%s' "$v" | grep -Eq '"kubelet-read-only-port":[[:space:]]*\[[[:space:]]*"0"[[:space:]]*\]'; then echo compliant; else echo noncompliant; 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

In earlier versions of OpenShift 4, the read-only-port argument is not used. Follow the instructions in the documentation to create a kubeletconfig CRD and set the kubelet-read-only-port is set to 0.

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.5 Verify that the read only port is not used or is set to 0

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