I restarted the machine for my postgresql app but I’m getting the password authentication failed error but I can still access the DB externally. The following is the logs
2023-01-01T03:25:48.079 app[217810xxx] sin [info] keeper | 2023-01-01 03:25:48.077 UTC [1384] FATAL: password authentication failed for user "postgres"
2023-01-01T03:25:48.079 app[217810xxx] sin [info] keeper | 2023-01-01 03:25:48.077 UTC [1384] DETAIL: Connection matched pg_hba.conf line 8: "host all all ::0/0 md5"
2023-01-01T03:25:49.293 app[217810xxx] sin [info] keeper | 2023-01-01 03:25:49.290 UTC [1390] FATAL: password authentication failed for user "postgres"
2023-01-01T03:25:49.293 app[217810xxx] sin [info] keeper | 2023-01-01 03:25:49.290 UTC [1390] DETAIL: Connection matched pg_hba.conf line 8: "host all all ::0/0 md5"
2023-01-01T03:25:51.143 app[217810xxx] sin [info] keeper | 2023-01-01 03:25:51.141 UTC [1394] FATAL: password authentication failed for user "postgres"
2023-01-01T03:25:51.143 app[217810xxx] sin [info] keeper | 2023-01-01 03:25:51.141 UTC [1394] DETAIL: Connection matched pg_hba.conf line 8: "host all all ::0/0 md5"
2023-01-01T03:25:54.996 app[217810xxx] sin [info] keeper | 2023-01-01 03:25:54.990 UTC [1421] FATAL: password authentication failed for user "postgres"
2023-01-01T03:25:54.996 app[217810xxx] sin [info] keeper | 2023-01-01 03:25:54.990 UTC [1421] DETAIL: Connection matched pg_hba.conf line 8: "host all all ::0/0 md5"
2023-01-01T03:25:57.801 app[217810xxx] sin [info] keeper | 2023-01-01 03:25:57.799 UTC [1440] FATAL: password authentication failed for user "postgres"
2023-01-01T03:25:57.801 app[217810xxx] sin [info] keeper | 2023-01-01 03:25:57.799 UTC [1440] DETAIL: Connection matched pg_hba.conf line 8: "host all all ::0/0 md5"
2023-01-01T03:25:58.569 app[217810xxx] sin [info] keeper | 2023-01-01 03:25:58.567 UTC [1445] FATAL: password authentication failed for user "postgres"
2023-01-01T03:25:58.569 app[217810xxx] sin [info] keeper | 2023-01-01 03:25:58.567 UTC [1445] DETAIL: Connection matched pg_hba.conf line 8: "host all all ::0/0 md5"
2023-01-01T03:26:00.680 app[217810xxx] sin [info] keeper | 2023-01-01 03:26:00.678 UTC [1457] FATAL: password authentication failed for user "postgres"
2023-01-01T03:26:00.680 app[217810xxx] sin [info] keeper | 2023-01-01 03:26:00.678 UTC [1457] DETAIL: Connection matched pg_hba.conf line 8: "host all all ::0/0 md5"
I would like to know if this should be ignored as everything works anyways, or is this something I should fix, and how would I fix it. Thanks everyone.
This started happening once I made the DB “externally accessible” (by following this guide). I made it external using ipv4 because I was worried about compatibility if I made it ipv6.
I had something like this when my Database was hosted on Heroku too. I asked support at Heroku and they told me that its bots that are attacking it and theres nothing you can do about it.
It seems like there are bots that are continually scanning the entire ip4 address space looking for postgres instances and when they find one they just start trying to brute force the password.
Am I correct in thinking this or is there something else going on here?
I just changed the default user from “postgres” to something else so they are now getting “user not found” errors instead. Hopefully that will stop the bot from trying, will let you know.
I noticed this too, I figured it was my own fault, but to test I created a fresh db, I never exposed it to the internet, and the error still happens:
2023-11-01T02:21:03.335 app[9080e391f13478] syd [info] postgres | 2023-11-01 02:21:03.334 UTC [1312] DETAIL: Connection matched pg_hba.conf line 8: "host all all ::0/0 md5"
2023-11-01T02:21:05.295 app[9080e391f13478] syd [info] postgres | 2023-11-01 02:21:05.293 UTC [1318] FATAL: password authentication failed for user "postgres"
2023-11-01T02:21:05.295 app[9080e391f13478] syd [info] postgres | 2023-11-01 02:21:05.293 UTC [1318] DETAIL: Connection matched pg_hba.conf line 8: "host all all ::0/0 md5"
2023-11-01T02:21:05.295 app[9080e391f13478] syd [info] postgres | 2023-11-01 02:21:05.293 UTC [1319] FATAL: password authentication failed for user "postgres"
2023-11-01T02:21:05.295 app[9080e391f13478] syd [info] postgres | 2023-11-01 02:21:05.293 UTC [1319] DETAIL: Connection matched pg_hba.conf line 8: "host all all ::0/0 md5"
2023-11-01T02:21:08.477 app[9080e391f13478] syd [info] postgres | 2023-11-01 02:21:08.476 UTC [1325] FATAL: password authentication failed for user "postgres"
2023-11-01T02:21:08.477 app[9080e391f13478] syd [info] postgres | 2023-11-01 02:21:08.476 UTC [1325] DETAIL: Connection matched pg_hba.conf line 8: "host all all ::0/0 md5"