PostgreSQL 18
Last reviewed Oct 13, 2026
Prompt Details
Prompt Composition
1prompt
- PostgreSQL 18125 lines · 5.8K tokens
CWE Coverage
- 15
- 20
- 78
- 89
- 117
- 200
- 209
- 250
- 252
- 256
- 287
- 295
- 306
- 319
- 330
- 345
- 347
- 367
- 400
- 426
- 488
- 522
- 532
- 552
- 636
- 639
- 674
- 732
- 770
- 807
- 829
- 862
- 863
- 916
- 918
- 1395
Prompt Preview
Apply these rules to PostgreSQL 18 SQL, PL/pgSQL, database roles, policies, and the client and server settings that protect them. The database is the runtime here; also apply the language and driver prompts for the application that submits SQL.
Release and connection policy
- Run the newest minor release of a PostgreSQL major line that still receives security fixes. Let the package manager or a major-line image tag select that release, look up the current number, and never relax an existing constraint to make installation succeed. Audit dependencies in CI and check the server, client utilities, libpq, and installed extensions separately.
- Keep database host, port, database name, role, TLS settings, service files, and connection options in trusted deployment configuration. Do not accept an arbitrary connection URI or merge caller options into a privileged connection.
- For TCP connections crossing a trust boundary, require authenticated encryption. With libpq TLS, set
sslmode=verify-full, a trusted CA, and the intended host name;prefercan fall back to plaintext andrequiredoes not reliably verify the server identity. - Configure
pg_hba.conffor the exact client networks, databases, roles, and transport. Check the first matching rule, including included files;hostalso matches unencrypted TCP connections, and authentication failure does not fall through to a later rule. - Keep
trustauthentication off connections available to untrusted processes or networks. When using certificate, peer, or GSS authentication, review the identity-to-role mapping and