TMA-MYSQL-1.4
Verify That the MYSQL_PWD Environment Variable is Not in Use
보통레벨 1자동mysql
설명
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).
점검 방법
감사 방식: 셸 명령
shell
[ "$(id -u)" -eq 0 ] || exit 1; n=$(grep -lsaz '^MYSQL_PWD=' /proc/[0-9]*/environ 2>/dev/null | wc -l); echo "$n"- 예상 출력
0
조치 방법
조치 방식: 가이드 또는 인프라 패치
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.
속성
- 운영 체제
- 모두
- 태그
- mysqldatabasecredentials
- 참고 자료
- CIS Oracle MySQL Community Server 8.4 Benchmark v1.1.0 - 1.4 Verify That the MYSQL_PWD Environment Variable is Not in Use
이 호스트 점검하기
감사 권한이 있는 시스템에서 실행하세요. 스캔은 읽기 전용입니다.
shell
tmaegis scan --target mysql