TMAegis
更多 tdsql 规则

TMA-TDSQL-4.4

Ensure `skip-grant-tables` Is Disabled

严重级别 1自动化tdsql

说明

When MySQL is started with --skip-grant-tables, the server does not load the privilege system, and any user can log in without authentication and perform arbitrary operations. Counts mysqld processes started with --skip-grant-tables and my.cnf files (/data/tdsql/mysqld/*/my.cnf, /etc/my.cnf) that enable it.

检查方式

审计方法: Shell 命令

shell
out=$(ps -eo args= 2>/dev/null) || exit 1; p=$(printf '%s\n' "$out" | grep mysqld | grep -ci '[s]kip.grant.tables' || true); c=$(grep -il '^[[:space:]]*[s]kip.grant.tables' /data/tdsql/mysqld/*/my.cnf /etc/my.cnf 2>/dev/null | wc -l); echo $((p + c))
预期输出
0

修复方式

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

Remove skip-grant-tables from my.cnf and the mysqld command line and restart the MySQL instance.

属性

操作系统
任意
标签
tdsqlauthentication
参考
CIS Tencent TDSQL 10.3.22 Benchmark v1.0.0 - 4.4 Ensure `skip-grant-tables` Is Disabled

检查本机

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

shell
tmaegis scan --target tdsql