zlacker

[parent] [thread] 1 comments
1. harral+(OP)[view] [source] 2025-01-06 05:23:39
Docker doesn’t expose ports by default. It only bypasses your firewall if you choose to explicitly publish a port.

OP explicitly forwarded a port in Docker to their home network.

OP explicitly forwarded their port on their router to the Internet.

OP may have ran Postgres as root.

OP may have used a default password.

OP got hacked.

Imagine having done these same steps on a bare metal server.

replies(1): >>phoron+0g
2. phoron+0g[view] [source] 2025-01-06 09:00:46
>>harral+(OP)
I do imagine:

1. postgres would have a sane default pg_hba disallowing remote superuser access.

2. postgres would not be running as root.

3. postgres would not have a default superuser password, as it uses peer authentication by default.

4. If ran on a redhat-derived distro, postgres would be a subject to selinux restrictions.

And yes, all of these can be circumvented by an incompetent admin.

[go to top]