r/docker • u/mariiiiiiiiiiiiiiiel • 4d ago
which sslmode in postgres to use
i have a docker stack with a postgres image, is it completly necesary to have the postgres to be configured with the ssl mode to verify-full , because, the outside world cannot interact with the db, just the backend server can (the network is not attachable and it doesn't expose any ports)
sorry if this is a little bit of a stretch because is not a full docker docker thing u.u
0
Upvotes
4
u/xonxoff 4d ago
How exactly are you running this? Just on your local host? If it’s just running locally on a single machine, it might not need ssl, otherwise I’d suggest turning ssl on.
1
u/Quirky-Net-6436 4d ago
Is it really fully private? So no external connectivity at all? If not, you should aim for zero trust, so verify-full is very useful, even if the database is only reachable from local system.
3
u/pelazas1 4d ago
If postgres is only on that internal network with no ports out,
sslmode=disableis fine. verify-full only matters once the traffic crosses a network you don't trust.1
u/BorysTheBlazer 3d ago
Not strictly. On a private single-host network, verify-full mainly protects against another compromised container on that network spoofing the database.