5 ms·
I get that this is for learning purposes, but doesn't this tutorial start by making your database insecure?
by wilsonrocks 6y ago
I get that this is for learning purposes, but doesn't this tutorial start by making your database insecure?
- orev 6y agoIf you need remote access to the DB, then you need remote access. Most people in a normal setup would not have the database server ports directly exposed to the Internet, but if you have the perspective that all servers are in the cloud, then you would also be expected to know how to keep them secure. But making it listen on an external IP does not inherently make it insecure, as long as you also have other firewall and user account controls.
- MaxBarraclough 6y agoI don't know much about Postgres specifically, but what I'm seeing in the tutorial does seem insecure. > If you need remote access to the DB, then you need remote access That's not a defence for teaching insecure practices. It's possible to configure Postgres for secure remote access. Using md5 for password security seems like a red flag, and sure enough, the Postgres docs remind us that md5 should no longer be considered secure. [0] I don't think there's any verification of the server's fingerprint, either. There's really no excuse here, as there's a quick and easy way to do it: SSH tunnels. [1] > Most people in a normal setup would not have the database server ports directly exposed to the Internet Not a safe assumption. Instances on Linode and, iirc, Digital Ocean, are not behind a cloud firewall, all ports are wide open to the Internet. (I think that's a bad move on the part of Linode and Digital Ocean, but that's not the point.) > if you have the perspective that all servers are in the cloud, then you would also be expected to know how to keep them secure If you already knew how to securely configure Postgres, you wouldn't need the tutorial. > making it listen on an external IP does not inherently make it insecure, as long as you also have other firewall and user account controls You still need to configure the crypto properly. [0] https://www.postgresql.org/docs/current/auth-password.html https://www.postgresql.org/docs/current/auth-password.html [1] https://www.postgresql.org/docs/current/ssh-tunnels.html https://www.postgresql.org/docs/current/ssh-tunnels.html