Does password-protecting a database living next to the application add any security?

It makes sense to password protect the database if you secure access to the application's config file that holds the plaintext credentials. When you restrict read access to the application's account only, the attacker requires root access to see the password. In case he breached any other (less privileged) account, he will not be able to gain access to the database.


That is kind of an onion protection (also known as "Layered Security" or "Defense in Depth" as seen, for example, in SANS' "Layered Security: Why It Works" whitepaper). If an attacker can reach the machine (s)he cannot gain full database access. The application should have a restricted access limited to only the required tables, and everything that need not be written should be read-only. Any higher access should require a different password never used in the application.


The benefit is that an attacker who has got network access to the database but not filesystem access to the server will be unable to actually log into the database.

Tags:

Databases