TDSQL
TMA-TDSQL-1.5
Ensure Passwords Are Not Passed via the Command Line
높음레벨 1자동tdsql
설명
When using the MySQL client or TDSQL tools, passwords should not be specified via the command-line arguments -p<password> or --password=. Counts running MySQL client processes and shell-history entries that pass a password inline (-p<password> or --password=). Restricted to MySQL client tools to avoid false matches such as mkdir -p.
점검 방법
감사 방식: 셸 명령
shell
out=$(ps -eo args= 2>/dev/null) || exit 1; p=$(printf '%s\n' "$out" | grep -v tdsql_cli_pw_audit | grep -cE '(mysql|mysqladmin|mysqldump|mysqlbinlog|mysqlsh)[^|;]*[[:space:]](-p[^[:space:]]|--password=)' || true); h=$(cat /root/.bash_history /home/*/.bash_history 2>/dev/null | grep -cE '(mysql|mysqladmin|mysqldump|mysqlbinlog|mysqlsh)[^|;]*[[:space:]](-p[^[:space:]]|--password=)' || true); echo $((p + h)) # tdsql_cli_pw_audit- 예상 출력
0
조치 방법
조치 방식: 가이드 또는 인프라 패치
Use a MySQL option file (~/.my.cnf with [client] user/password, mode 600) or the TDSQL encrypted credential system instead of -p<password>; clear affected shell history entries and rotate any exposed passwords.
속성
- 운영 체제
- 모두
- 태그
- tdsqlcredentials
- 참고 자료
- CIS Tencent TDSQL 10.3.22 Benchmark v1.0.0 - 1.5 Ensure Passwords Are Not Passed via the Command Line
이 호스트 점검하기
감사 권한이 있는 시스템에서 실행하세요. 스캔은 읽기 전용입니다.
shell
tmaegis scan --target tdsql