--
--
You received this message because you are subscribed to the "Barman for PostgreSQL" group.
To post to this group, send email to pgba...@googlegroups.com
To unsubscribe from this group, send email to
pgbarman+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/pgbarman?hl=en?hl=en-GB
--- You received this message because you are subscribed to the Google Groups "Barman, Backup and Recovery Manager for PostgreSQL" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pgbarman+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi, Same here, I'm working on it...
Barman don't have crypt functions at this moment.
My workaround is:
- at this moment, I'm using LUKS over the
barman data folder via OS
- and gpg to the files exported to glacier (a tar workaround)
Diego,
Hello, i am trying to find a way to encrypt the Barman backups, seems this thread is about three years back, no sure if Barman has build-in encryption feature already ? Or still have to use the other file encryption solution to encrypt barman backups ? Thanks.
LUKS, basically encrypt the partition where is the barman home/work folder.
Pros: have a very low impact in the performance (about 5%). Cons is you need to open and mount the partition on every reboot.
You can see:
Super resume of lunks intall:
yum install cryptsetup-luks
cryptsetup -y -v luksFormat /dev/sdb
yourVerySecurePWD!
cryptsetup luksOpen /dev/sdb BARMAN
ls -l /dev/mapper/BARMAN
dd if=/dev/zero of=/dev/mapper/BARMAN status=progress bs=4MB --> think about this before procede.
mkfs.xfs /dev/mapper/BARMAN
# lsblkFor - and gpg to the files exported to glacier (a tar workaround)
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
fd0 2:0 1 4K 0 disk
sda 8:0 0 25G 0 disk
├─sda1 8:1 0 1G 0 part /boot
└─sda2 8:2 0 24G 0 part
├─centos-root 253:0 0 7G 0 lvm /
├─centos-swap 253:1 0 2G 0 lvm [SWAP]
├─centos-var 253:2 0 10G 0 lvm
│ └─luks-4dc4da9f-2bca-46a8-9d3d-1b8976a82eef 253:4 0 10G 0 crypt /var
└─centos-home 253:3 0 5G 0 lvm /home
sdb 8:16 0 120G 0 disk
└─BARMAN 253:5 0 120G 0 crypt /home/barman
sr0 11:0 1 55.2M 0 rom
# df -hP
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/centos-root 7.0G 1.8G 5.3G 25% /
devtmpfs 3.9G 0 3.9G 0% /dev
tmpfs 3.9G 0 3.9G 0% /dev/shm
tmpfs 3.9G 17M 3.9G 1% /run
tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
/dev/sda1 1014M 171M 843M 17% /boot
/dev/mapper/centos-home 5.0G 33M 5.0G 1% /home
/dev/dm-4 10G 297M 9.7G 3% /var
/dev/mapper/BARMAN 12T 330G 12T 1% /home/barman
tmpfs 783M 0 783M 0% /run/user/0
config barman to "save my files inside of /home/barman" ;P
and at this moment, you have all local data secured.
We work with "pre_delete" hook, to run a bash.I'm here now, and this is my idea working on alpha , I will have change this in the future, but is a point to start
barman have a 30 days of retention in my default config.
I called it "hot recovery", after, I need to restore glacier called it "cold recovery" every with his own SLA.
this bash works, in a alpha version, this way:
1. identifico el backup
barman list-files TestBKP 20180702T200002 (oldest)
2. lo tareo
tar czf TestBKP-20180702T200002.tar.gz $(barman list-files TestBKP 20180702T200002)
3. lo encripto
cat ~/.ssh/barman.gpg.priv | gpg -c --passphrase-fd 0 --batch --yes --symmetric TestBKP-20180702T200002.tar.gz
4. Lo subo a glacier
aws glacier upload-archive --vault-name Barman --account-id 0000000000039 --archive-description '2018-07-03 DAF TestBKP-20180702T200002' --body TestBKP-20180702T200002.tar.gz.gpg
5. Save the output in a db for future recoverys, is more easy searh in your system instead wait the times of glacier
The recover part is manual:
$ aws glacier initiate-job --vault-name CxBarman --account-id 0000000000039 --job-parameters '{"Type": "archive-retrieval", "ArchiveId": "IXD--TdcQSeClHDJgWssz-aw4A"}'
ouput:
{
"location": "/0000000000039/vaults/Barman/jobs/NuTRbWypRqiocw5ElNetAcCtlnKl5R7C1N",
"jobId": "NuTRbWypRqiocw5ElNetAcCtlnKl5R7C1N"
This may take 6 hs...
$ aws glacier list-jobs --account-id - --vault-name Barman
use this command to check if the retrieval job is complete.
$ aws glacier get-job-output --vault-name CxBarman --account-id 051195520539 --job-id NuTRbWypRqiocw5ElNetAcCtlnKl5R7C1N TestBKP-20180702T200002.tar.gz.gpg.restored
now you have the restore.
Very helpful info Diego, especially sounds like you also running Barman in AWS, can you share more details ? Appreciate !