MariaDB
TMA-MARIADB-1.3
Disable MariaDB Command History
低レベル 2自動mariadb
説明
On Unix, the mysql client writes a record of executed statements to a history file. By default, this file is named .mysql_history and is created in your home directory. To specify a different file, set the value of the MYSQL_HISTFILE environment variable. Run as root; counts client history files under /home and /root that are not symlinks to /dev/null.
チェック方法
監査方法: シェルコマンド
shell
[ "$(id -u)" -eq 0 ] || exit 1; l=$(find /home /root -maxdepth 4 \( -name .mysql_history -o -name .mariadb_history \) 2>/dev/null); n=0; for x in $l; do [ "$(readlink "$x")" = /dev/null ] || n=$((n+1)); done; echo "$n"- 期待される出力
0
修正方法
修正方法: ガイダンスまたは IaC パッチ
For each user remove the history file and prevent re-creation: rm -f ~<user>/.mysql_history && ln -s /dev/null ~<user>/.mysql_history, or export MYSQL_HISTFILE=/dev/null in the shell startup script.
プロパティ
- オペレーティングシステム
- すべて
- タグ
- mariadbdatabasecredentialshistory
- 参照
- CIS MariaDB 10.11 Benchmark v1.0.0 - 1.3 Disable MariaDB Command History
このホストをチェック
監査が許可されているマシンで実行してください。スキャンは読み取り専用です。
shell
tmaegis scan --target mariadb --level 2