When reviewing database security, it's crucial to concentrate on two areas: how well the system has been hardened, and how the data and database access is controlled. Most hackers target the data held in a database. Therefore the server, where the database resides, needs to be hardened and protected, both physically and logically. Ideally, the database will be on its own dedicated machine, but it should never reside on a public-facing server, such as a Web server. Naturally, all system and database program patches should be installed, and unnecessary features should be removed or disabled. Most database programs have several default accounts and passwords, all of which need to be changed.
After assessing the Web Server's security, check the database connections, access controls and the table access controls, because any weaknesses will negate the hardening measures performed on the server.
- Any applications that connect to the database should use an encrypted link, even if the database resides in a controlled network.
- Applications and users that connect to the database should only have the minimum privileges required to complete their tasks, and access to system level resources should be controlled with access control lists (ACL).
- It is also important to check that different database connections are used for application administration and normal user activities.
- Data should only be accessible through stored procedures as they provide another layer of data access control.
- If information security policies require data to be encrypted, then the database connection must not allow clear text access to the data.
- Also, encrypted data should not store the encryption key on the database server.
Another security layer of a more sophisticated nature includes real-time Database Activity Monitoring, either by analyzing protocol traffic (SQL) over the network, or by observing local database activity on each server using software agents, or both. Use of agents or native logging is required to capture activities executed on the database server, which typically include the activities of the database administrator. Agents allow this information to be captured in a fashion that cannot be disabled by the database administrator, who has the ability to disable or modify native audit logs.