Are authentication mechanisms based on UNIX domain sockets (Linux) secure? And more specifically, are the respective MySQL and PostgreSQL implementations on Linux secure?
The background for my question is: I want to get rid of having to manage all the database user passwords used by various web applications when accessing MySQL and PostgreSQL databases. In all cases when the DB and the App(s) are on the same host, domain socket authentication seems to be the best way to connect them, assuming that each app runs as a separate user.
This mechanism however seems to be very rarely used. Most web apps provide installation instructions proposing password authentication, most linux distributions use passwords by default (infamous MySQL root password) even if DBs are preconfigured for local access only.
I wonder whether there is a good reason to stick to passwords which seems to have only disadvantages (if you impersonate as the user you get their password from the config files and can then access the database without having to re-gain access to the user account).