---
title: "NET-DB-020 PostgreSQL SSL Not Enabled"
canonical: https://openvapt.com/checks/NET-DB-020.html
html: https://openvapt.com/checks/NET-DB-020.html
site: OpenVAPT, https://openvapt.com/
license: OpenVAPT Source-Available Licence 1.3, https://openvapt.com/legal/licence-text.html
modified: 2026-10-14
version: 0.1.0-alpha.6
---

# NET-DB-020 PostgreSQL SSL Not Enabled

postgresql.conf does not set ssl = on, so TCP clients cannot encrypt their sessions and hostssl rules cannot apply.

- Domain: Network
- Severity: Medium
- Control category: Cryptography and TLS
- Fix effort: low
- CVSS v3.1 vector: `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N`
- CIS Controls v8: 3.10
- NIST CSF 2.0: PR.DS-02
- CWE: CWE-319
- OWASP Top 10 2021: A02:2021
- OWASP ASVS 4.0.3: 9.2.2
- NIST SP 800-53 Rev. 5: SC-8, SC-13
- Benchmark topic: Database transport encryption (topic only, no benchmark text)

## Why It Matters

Without SSL every query and result crosses the network in the clear. Enabling it costs one certificate and lets pg_hba.conf require hostssl for remote clients. When listen_addresses keeps the server on loopback (the PostgreSQL default, localhost) the plaintext path never leaves the machine and only a local root user could read it, so the check reports Pass with a note instead of a Medium finding; the Medium applies to servers reachable from the network.

## How It Detects

Reads postgresql.conf and flags ssl absent or off. Passes with a note when listen_addresses is empty (no TCP at all) or names only loopback addresses (localhost, 127.0.0.1, ::1), or when it is unset, since the PostgreSQL default is localhost.

## How to Fix

Install a certificate and key readable only by the postgres user, set  ssl = on , ssl_cert_file and ssl_key_file, reload, then change remote pg_hba.conf rules from host to hostssl.

## How to Verify

```
SHOW ssl;  should print on, and  psql "sslmode=require host=127.0.0.1"  should connect.
```

## Learn the Theory

- [P3 Network Exposure and Firewalls](https://openvapt.com/academy/p3.md)
- [P8 Data Services: Databases, File Shares, DNS and Mail](https://openvapt.com/academy/p8.md)
- [P19 Database, Mail and DNS Hardening](https://openvapt.com/academy/p19.md)

## References

- [PostgreSQL, Secure TCP/IP Connections with SSL](https://www.postgresql.org/docs/current/ssl-tcp.html)
- [NIST SP 800-53 Rev. 5, SC-8 Transmission Confidentiality and Integrity](https://csrc.nist.gov/pubs/sp/800/53/r5/upd1/final)

## Source Code

https://github.com/OpenVAPT/openvapt/blob/574f7f3333c44b75a3c649e2d93a76d507f75adf/internal/checks/network/data_depth.go

Run it: `openvapt scan --only NET-DB-020`. Read it offline: `openvapt explain NET-DB-020`.

---

OpenVAPT is academic, non-commercial, source-available and built by AI Cybersecurity Engineers (AI systems, not people). Free for your own use on machines you own or control, 100% at your own risk; not for sale and not for providing services. This page in HTML: https://openvapt.com/checks/NET-DB-020.html. Part of OpenVAPT Check Catalogue. How to cite: https://openvapt.com/cite.html. Site summary for models: https://openvapt.com/llms.txt.
