0

My friends and I have a Mattermost instance up on a server through this set up. Mattermost does not support e2e encryption and we have a container with a Postgres database running that stores all of our messages. We want to make sure that one of us just doesn't lurk around the messages in the database without someone else being present. We agreed that if we need to go into the database or data for whatever reason, two of us need to be present. We can encrypt the backups with two of our GPG key's to make sure there is not a lone ranger lurking the data via the backups, but how do we go about making sure there isn't a lone wolf getting to the data via the database container or the volume that stores the database's data on the server? Is there any way to require two people are present before being able to ssh into a server or a specific directory? Is there some other way to go about this that I am not thinking of?

If that isn't possible something else I've been thinking about is some sort of notification every time anyone ssh's into the server like this. Are there any ways people can get around this that I am not thinking of (assuming any physical access)?

  • Both of your user accounts shall not have sudo rights. Nobody of you shall have root access. The database shall be owned by a third user account. The database shall be stored within a encrypted container/partition, this encrypted container/partition shall be stored again in another encrypted container/partition. User A shall have encryption key saved with chmod 440 in his homedir, this key is for outer encryption, User B has key for inner encryption. Database is autodecrypted by third user account. Access to database is only able when both user accounts are logged in, using a lock file script. – paladin Jul 09 '21 at 06:18
  • The stored keys shall be encrypted too. Maybe chmod 400. Database account shall be a system user account and this user is able to read the encrypted key files only with your explicicity encryption. So you both need always to login after a reboot and decrypt the keyfiles and send the keys to the database user via a pipe mechanic, so the encrypted key is stored only in RAM. You may use a tmpfs for this. – paladin Jul 09 '21 at 06:26

0 Answers0