TMAegisBeta
更多 openshift 规则

Red Hat OpenShift

TMA-OPENSHIFT-4.2.5

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

中级别 1自动化openshift

说明

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

检查方式

审计方法: 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
预期输出
compliant

修复方式

修复方法: 操作指南或基础设施补丁

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.

属性

操作系统
任意
标签
openshiftworker-node
参考
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

检查本机

请在您有权审计的机器上运行此命令。扫描为只读操作。

shell
tmaegis scan --target openshift