IBM Cloud
TMA-IBMCLOUD-RESTRICT-API-KEY-CREATION
Ensure creation of platform API keys is restricted
中等級 2自動化ibmcloud
說明
Restricting API key creation to explicitly authorised users reduces unmanaged long-lived credentials. restrict_create_platform_apikey must be RESTRICTED. Read-only ibmcloud CLI calls using the current CLI session and targeted region (ibmcloud login, or IBMCLOUD_API_KEY); JSON output is parsed with grep/sed/awk. A missing CLI, plugin or session fails the check.
檢查方式
稽核方法: Shell 指令
shell
out=$(ibmcloud iam account-settings --output json 2>/dev/null) || exit 1
v=$(printf '%s\n' "$out" | sed -n 's/.*"restrict_create_platform_apikey"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/p' | head -n 1)
[ "$v" = RESTRICTED ] && echo compliant- 預期輸出
compliant
修補方式
修補方法: 操作指南或基礎設施修補檔
ibmcloud iam account-settings-update --restrict-create-platform-apikey RESTRICTED, then grant 'User API key creator' only to those who need it.
屬性
- 作業系統
- 不限
- 標籤
- ibmcloudiam
- 參考資料
- CIS IBM Cloud Foundations Benchmark v2.0.0 - Identity and Access Management - restrict user API key creation (verify section number for your release)
檢查此主機
請在您有權稽核的機器上執行此指令。掃描為唯讀操作。
shell
tmaegis scan --target ibmcloud --level 2