TMAegisBeta
更多 mysql 规则

MySQL

TMA-MYSQL-4.5

Ensure 'mysqld' is Not Started With '--skip-grant-tables'

严重级别 1自动化mysql

说明

This option causes mysqld to start without using the privilege system. Counts enabled skip-grant-tables settings in the server option groups and on the running server command line.

检查方式

审计方法: Shell 命令

shell
c=$(my_print_defaults mysqld 2>/dev/null) || exit 1; p=$(ps -eo comm=,args= 2>/dev/null) || exit 1; n=$( { printf '%s\n' "$c"; printf '%s\n' "$p" | awk '$1=="mysqld"||$1=="mariadbd"' | tr ' ' '\n'; } | grep -Eic '^--skip[-_]grant[-_]tables(=(1|on|true|yes))?$' ); echo "$n"
预期输出
0

修复方式

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

Remove skip-grant-tables (and skip_grant_tables) from the option files or set skip-grant-tables = FALSE, remove it from the start-up command line, and restart MySQL.

属性

操作系统
任意
标签
mysqldatabaseauthentication
参考
CIS Oracle MySQL Community Server 8.4 Benchmark v1.1.0 - 4.5 Ensure 'mysqld' is Not Started With '--skip-grant-tables'

检查本机

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

shell
tmaegis scan --target mysql