TMAegisBeta
Thêm quy tắc cho yugabytedb

YugabyteDB

TMA-YUGABYTEDB-5.7

Ensure the default password is changed for the yugabyte superuser

Nghiêm trọngCấp 1Tự độngyugabytedb

Mô tả

The yugabyte role is the built-in YSQL superuser in YugabyteDB. By default, it has a well-known password. This default password must be changed before the cluster is deployed to a non-development environment. Leaving the default password in place allows anyone with knowledge of the default to gain full superuser access to all databases in the cluster. The benchmark rates this recommendation Manual; the automated check covers its objective pass criterion. Attempts a ysqlsh login as yugabyte with the default password against PGHOST/PGPORT (default 127.0.0.1:5433); passes only when the login is rejected with an authentication error. A successful login (including trust authentication) fails, an unreachable server fails.

Cách kiểm tra

Phương pháp kiểm tra: Lệnh shell

shell
command -v ysqlsh >/dev/null 2>&1 || exit 1; out=$(PGPASSWORD=yugabyte PGPASSFILE=/dev/null ysqlsh -h "${PGHOST:-127.0.0.1}" -p "${PGPORT:-5433}" -U yugabyte -d yugabyte -w -tAc 'SELECT 1' 2>&1); rc=$?; if [ $rc -eq 0 ]; then echo default_password_accepted; elif printf '%s' "$out" | grep -qi 'authentication failed'; then echo compliant; else exit 1; fi
Đầu ra mong đợi
compliant

Cách khắc phục

Phương pháp khắc phục: Hướng dẫn hoặc bản vá hạ tầng

ALTER ROLE yugabyte WITH PASSWORD '<new strong password>'; store it in a password vault, and make sure ysql_enable_auth=true (5.6).

Thuộc tính

Hệ điều hành
Bất kỳ
Thẻ
yugabytedbauthentication
Tham chiếu
CIS YugabyteDB Benchmark v2.0.0 - 5.7 Ensure the default password is changed for the yugabyte superuser

Kiểm tra máy này

Chạy lệnh này trên máy bạn được phép kiểm tra. Lần quét chỉ ở chế độ đọc.

shell
tmaegis scan --target yugabytedb