TMAegisBeta
更多 openshift 规则

Red Hat OpenShift

TMA-OPENSHIFT-4.2.3

Ensure that the --authorization-mode argument is not set to AlwaysAllow

严重级别 1自动化openshift

说明

Do not allow all requests. Enable explicit authorization. Reads every node's effective kubelet configuration with oc get --raw /api/v1/nodes/<node>/proxy/configz; requires a cluster-admin oc login.

检查方式

审计方法: 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 '"authorization":\{"mode":"AlwaysAllow"' && printf '%s' "$c" | grep -Eq '"authorization":\{"mode":"'; }; then echo "noncompliant: $n"; ok=0; fi
done
if [ "$ok" -eq 1 ]; then echo compliant; fi
预期输出
compliant

修复方式

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

Set authorization.mode to 'Webhook'

属性

操作系统
任意
标签
openshiftworker-node
参考
CIS Red Hat OpenShift Container Platform Benchmark v2.0.0 - 4.2.3 Ensure that the --authorization-mode argument is not set to AlwaysAllow

检查本机

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

shell
tmaegis scan --target openshift