TMAegis
Plus de règles pour postgres

PostgreSQL

TMA-POSTGRES-6.10

Ensure Weak SSL/TLS Ciphers Are Disabled

MoyenneNiveau 1Automatiséepostgres

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.

Méthode de vérification

Méthode d'audit: Requête SQL

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"
Sortie attendue
compliant

Méthode de correction

Méthode de correction: Recommandation ou correctif d'infrastructure

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.

Propriétés

Systèmes d'exploitation
Tous
Étiquettes
postgresdatabasetls
Référence
CIS PostgreSQL 18 Benchmark v1.0.0 - 6.10 Ensure Weak SSL/TLS Ciphers Are Disabled

Vérifier cet hôte

Exécutez cette commande sur une machine que vous êtes autorisé à auditer. L'analyse est en lecture seule.

shell
tmaegis scan --target postgres