also looking at this
Harden encrypted mail storage, recovery, and forwarding
#8
50 files
+1701
-9001
| @@ -70,6 +70,7 @@ const mailConfig = { | ||
| 70 | 70 | 'python3', |
| 71 | 71 | 'python3-pip', |
| 72 | 72 | 'openssl', |
| 73 | 'cryptsetup', | |
| 73 | 74 | 'sqlite', |
| 74 | 75 | 'fail2ban', |
| 75 | 76 | 'bind-utils', |
| @@ -327,6 +328,14 @@ chown -R mail-server:mail-server ${cfg.paths.logDir} | ||
| 327 | 328 | chown -R mail-server:mail-server ${cfg.paths.mailDir} |
| 328 | 329 | chown -R mail-server:mail-server ${cfg.paths.installDir}/mail |
| 329 | 330 | |
| 331 | # Encrypt every persistent mail path by default. The LUKS2 volume key is | |
| 332 | # machine-bound in systemd's encrypted credential store and is never exposed | |
| 333 | # to the mail-server service as a persistent plaintext file. | |
| 334 | chmod +x ${cfg.paths.installDir}/scripts/setup-encrypted-storage.sh | |
| 335 | MAIL_ROOT=${cfg.paths.installDir} \ | |
| 336 | MAIL_ENCRYPTED_IMAGE_SIZE="\${MAIL_ENCRYPTED_IMAGE_SIZE:-4G}" \ | |
| 337 | ${cfg.paths.installDir}/scripts/setup-encrypted-storage.sh | |
| 338 | ||
| 330 | 339 | # Get instance metadata |
| 331 | 340 | echo "Getting instance metadata..." |
| 332 | 341 | TOKEN=\$(curl -s -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600") |