TMAegis
Plus de règles pour mysql

TMA-MYSQL-1.4

Verify That the MYSQL_PWD Environment Variable is Not in Use

MoyenneNiveau 1Automatiséemysql

Description

MySQL can read a default database password from an environment variable called MYSQL_PWD. Avoiding use of this environment variable can better safeguard the confidentiality of MySQL credentials. Run as root; counts processes whose environment contains MYSQL_PWD (including the scanner itself if it was given MYSQL_PWD).

Méthode de vérification

Méthode d'audit: Commande shell

shell
[ "$(id -u)" -eq 0 ] || exit 1; n=$(grep -lsaz '^MYSQL_PWD=' /proc/[0-9]*/environ 2>/dev/null | wc -l); echo "$n"
Sortie attendue
0

Méthode de correction

Méthode de correction: Recommandation ou correctif d'infrastructure

Find the processes (grep -lsaz ^MYSQL_PWD= /proc/*/environ) and change the users/scripts that export MYSQL_PWD to use an option file readable only by the user, mysql_config_editor or certificate-based authentication.

Propriétés

Systèmes d'exploitation
Tous
Étiquettes
mysqldatabasecredentials
Référence
CIS Oracle MySQL Community Server 8.4 Benchmark v1.1.0 - 1.4 Verify That the MYSQL_PWD Environment Variable is Not in Use

Vérifier cet hôte

Exécutez cette commande sur une machine que vous êtes autorisé à auditer. L'analyse est en lecture seule.

shell
tmaegis scan --target mysql