PostgreSQL
TMA-POSTGRES-6.10
Ensure Weak SSL/TLS Ciphers Are Disabled
Description
The PostgreSQL ssl_ciphers and ssl_tls13_ciphers directives specify which Cipher Suites are allowed in the negotiation with the client. ssl_ciphers is used to specify the list of allowed cipher suites for TLS 1.2 and earlier versions. While ssl_tls13_ciphers is a list of cipher suites that are allowed by connections using TLS version 1.3. Passes only when ssl_ciphers and ssl_tls13_ciphers (PostgreSQL 18) list nothing but TLS_AES_256_GCM_SHA384, TLS_AES_128_GCM_SHA256 and TLS_AES_128_CCM_SHA256; an empty ssl_tls13_ciphers falls back to the OpenSSL defaults and fails. 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.
How it is checked
Audit method: SQL query
out=$(psql -X -U "${PGUSER:-postgres}" -d "${PGDATABASE:-postgres}" -tAc "SELECT CASE WHEN NOT EXISTS (SELECT 1 FROM regexp_split_to_table(current_setting('ssl_ciphers') || ':' || coalesce(current_setting('ssl_tls13_ciphers', true), ''), '[:,]') AS t(c) WHERE btrim(c) NOT IN ('TLS_AES_256_GCM_SHA384','TLS_AES_128_GCM_SHA256','TLS_AES_128_CCM_SHA256')) THEN 'compliant' ELSE 'noncompliant' END" 2>/dev/null) || exit 1; printf '%s\n' "$out"- Expected output
compliant
How it is fixed
Fix method: Guidance or infrastructure patch
ALTER SYSTEM SET ssl_ciphers = 'TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256,TLS_AES_128_CCM_SHA256'; ALTER SYSTEM SET ssl_tls13_ciphers = 'TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256,TLS_AES_128_CCM_SHA256'; SELECT pg_reload_conf(); then check pg_stat_ssl for sessions using other ciphers.
Properties
- Operating systems
- Any
- Tags
- postgresdatabasetls
- Reference
- CIS PostgreSQL 18 Benchmark v1.0.0 - 6.10 Ensure Weak SSL/TLS Ciphers Are Disabled
Check this host
Run this on a machine you are allowed to audit. The scan is read-only.
tmaegis scan --target postgres