I have an app server hosting a CakePHP app and a database server hosting the databases. The servers are physically separate. The databases contain encrypted sensitive information. The encryption keys for the encrypted data are also stored in the database (which are themselves encrypted). The keys are decrypted by the app for use in decrypting the database information.
I am under the impression that if someone were to compromise the database server and steal the databases they would not be able to decrypt the data since the app, (which is on a different server), has the encryption key. The problem arrises if someone is able to compromise the app server. If the app server becomes compromised, the database connection information is stored directly in the CakePHP app as follows:
public $default = array(
'datasource' => 'Database/Mysql', 'persistent' => false, 'host' => 'xxx.xxx.xxx.xxx', 'login' => 'login', 'password' => 'password', 'database' => 'database', 'prefix' => '', //'encoding' => 'utf8',
Is there a way to store this connection information in a more secure fashion or is this just a matter of knowing that if the app is compromised, the database is also compromised? Are there things I can do to mitigate the chances of this type of compromise that I may not have thought of? Thank you in advance!