TMAegisBeta
更多 tdsql 規則

TDSQL

TMA-TDSQL-1.3

Ensure Interactive Login Is Disabled for TDSQL Service Accounts

中等級 1自動化tdsql

說明

The operating system accounts running TDSQL services should have interactive login disabled (shell set to /sbin/nologin or /bin/false). Passes when the tdsql account (and mysql, if present) has /sbin/nologin or /bin/false as its shell; FAILs when no tdsql account exists.

檢查方式

稽核方法: Shell 指令

shell
u=$(getent passwd tdsql) || exit 1; bad=0; for a in tdsql mysql; do s=$(getent passwd "$a" | cut -d: -f7) || continue; case "$s" in /sbin/nologin|/usr/sbin/nologin|/bin/false|/usr/bin/false) ;; *) bad=1;; esac; done; [ $bad -eq 0 ] && echo compliant || echo 'interactive shell'
預期輸出
compliant

修補方式

修補方法: 操作指南或基礎設施修補檔

usermod -s /sbin/nologin tdsql; usermod -s /sbin/nologin mysql

屬性

作業系統
不限
標籤
tdsqlservice-account
參考資料
CIS Tencent TDSQL 10.3.22 Benchmark v1.0.0 - 1.3 Ensure Interactive Login Is Disabled for TDSQL Service Accounts

檢查此主機

請在您有權稽核的機器上執行此指令。掃描為唯讀操作。

shell
tmaegis scan --target tdsql