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