Encrypt PostgreSQL data directory #166

Merged
raucao merged 11 commits from feature/pg_encfs into master 2020-06-08 15:02:59 +00:00

11 Commits

Author SHA1 Message Date
Basti b662c04183
Finish initial encfs cookbook and postgres adaptations 2020-06-08 17:01:24 +02:00
Basti 379161eb1e
Fix postgres installation
Also, do not start at boot anymore, in favor of path-based activation.
2020-06-07 12:47:06 +02:00
Basti 353f2c13f1
Improve encfs cookbook
Fix some things, and prepare for path-based activation. Also, comment
the buggy initial dir creation and explain manual provisioning in README
for now.
2020-06-07 12:45:33 +02:00
Basti 8918452fc5
Use latest postgresql fork 2020-06-07 12:40:39 +02:00
Basti 501626de1f
Add encfs to Vagrantfile 2020-06-07 12:30:00 +02:00
Basti 4fe0e913f8
Use our own fork of the postgresql cookbook 2020-06-07 12:29:34 +02:00
Basti bd99b76287
Use human-readable flag for encfs mount script
In case someone wants to see what it does without reading a manual in
the future.
2020-06-06 12:24:08 +02:00
Greg 1e60722ec4 Create an initial encfs cookbook
Usage: Add the kosmos_encfs::default recipe to the run list of a node.
Creating the encrypted directory will keep it mounted. After a reboot,
start the encfs service and enter the password:

```
$ systemctl start encfs
encfs password:
```

For now postgresql@12-main is a hardcoded dependency of the encfs
Systemd unit that is automatically started once the user inputs the
correct password. This list of dependency will need to be different for
every server, based on the services it is running
2020-06-04 19:50:20 +02:00
Greg eded62a3ec Merge branch 'master' into feature/pg_encfs 2020-06-04 15:13:53 +02:00
Greg d0daa9cee7 Add the encryption password for encfs to the data bag 2020-05-15 18:46:24 +02:00
Greg 55b1cbc1d7 Encrypt the Postgresql data dir on the replica (centaurus)
encfs always runs a configuration assistant when creating a new
volume, so this needs to be done manually:

   systemctl stop postgresql@12-main
   mv /var/lib/postgresql /var/lib/postgresql.old
   encfs /var/lib/postgresql_encrypted /var/lib/postgresql --public
Pick p (paranoia mode) and enter the password from the data bag twice

   mv /var/lib/postgresql/* /var/lib/postgresql/
   systemctl start postgresql@12-main

This is running on centaurus and is mounted automatically on boot by a
system unit

Refs #129
2020-05-15 18:41:31 +02:00