TMAegis
Више правила за postgres

PostgreSQL

TMA-POSTGRES-5.5

Ensure per-account connection limits are used

НискаНиво 1Аутоматскаpostgres

Опис

Limiting concurrent connections to a PostgreSQL server can be used to reduce the risk of Denial of Service (DoS) attacks. Counts login roles with an unlimited (-1) connection limit. Runs psql as ${PGUSER:-postgres} against ${PGDATABASE:-postgres}; set PGHOST/PGPORT and use ~/.pgpass (not PGPASSWORD, see 1.6/1.7) when peer authentication is not available.

Како се проверава

Метод провере: SQL упит

sql_query
out=$(psql -X -U "${PGUSER:-postgres}" -d "${PGDATABASE:-postgres}" -tAc "SELECT count(*) FROM pg_roles WHERE rolname !~ '^pg_' AND rolcanlogin AND rolconnlimit = -1" 2>/dev/null) || exit 1; printf '%s\n' "$out"
Очекивани излаз
0

Како се исправља

Метод исправке: Смерница или закрпа инфраструктуре

ALTER ROLE <dbuser> CONNECTION LIMIT <reasonable concurrent connection count>; for every login role reported (SELECT rolname FROM pg_roles WHERE rolcanlogin AND rolconnlimit = -1).

Својства

Оперативни системи
Било који
Ознаке
postgresdatabaseauthentication
Референца
CIS PostgreSQL 18 Benchmark v1.0.0 - 5.5 Ensure per-account connection limits are used

Проверите овај рачунар

Покрените ово на рачунару за који имате дозволу за проверу. Скенирање ради у режиму само за читање.

shell
tmaegis scan --target postgres