by einhverfr · 13y ago · 0 comments
For example, we store virtual machine root passwords in an encrypted database for last resort purposes (so that someone can log in using virsh console as root when nothing else is working). There are three layers of encryption and as far as casual access goes (assuming nothing is reconfigured), mere root access to the box is not enough to reveal the information. However if you can change what is logged by PostgreSQL and reconfigure PostgreSQL's authentication options you could grab enough information to effectively read this data.
People with the sort of access required to make sure things are secure can effectively get the data off the system that they want, and the alternative in designing a system is to have one with no superusers and the possibility that information is irrevokably lost when someone forgets a password. The most secure systems end up somewhere between them.
The problem though is that someone still has to have the right to rotate keys and this process can be attacked too. For example, one could rotate keys to a known value thus giving the attacker access to the plain text. Worse, the person who can rotate the keys has to have the right to access both old and new keys in an unencrypted state.
Now, given that reality, it isn't clear to me that the fact that someone could set up the database to log all queries, and allowing passphrases for encryption to be passed in in the query poses a real added danger.
Another option is just not to allow key rotation but that allows for attacks on the key itself. You can get aroudn this by having a different key for each piece of data and thus limit the utility of cracking each piece.
However if you go that route, then you have two computers to secure instead of one, and it is vulnerable to more types of attacks than before since you are now trusting the client.....
Of course the problem is that methods like this takes a lot of effort, and so it is a tradeoff between safety and the cost and convenience, and in reality very little data.