public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Fabian Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com,
	"Fabian Grünbichler" <f.gruenbichler@proxmox.com>
Subject: Re: [pve-devel] [PATCH-SERIES 0/4] PBS master key integration
Date: Wed, 12 May 2021 11:54:53 +0200	[thread overview]
Message-ID: <d1ba76c3-5ef1-8a1e-769c-a3dd29ee2f2c@proxmox.com> (raw)
In-Reply-To: <20210208130835.2512356-1-f.gruenbichler@proxmox.com>

Am 08.02.21 um 14:08 schrieb Fabian Grünbichler:
> this series enables master key integration for PVE->PBS, by allowing the
> configuration of a per-storage master key which is used for (encrypted)
> VM and CT backups.
> 
> while the diffs are small, the following bumps/dependencies/.. are required:
> 
> proxmox-backup needs a bump (commits from other series)
> pve-storage needs a bump + a versioned-dep on proxmox-backup-client (new
> CLI parameters)
> qemu-server needs a versioned-dependency on bumped pve-storage (new
> storage plugin methods)
> 
> qemu needs a bump + a versioned-dependency (build + RT) on
> libproxmox-backup-qemu (API change)
> libproxmox-backup-qemu needs a bump + breaks on pre-bump qemu (API
> change)
> 
> it might make sense to queue the libproxmox-backup-qemu and
> proxmox-backup bumps together (the former directly references git of the
> latter at the moment, instead of a tag).
> 
> 
> 
> _______________________________________________
> pve-devel mailing list
> pve-devel@lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
> 
> 

Tried out the series and works as advertised. Test log with a few nits 
(one of them not even about this series, but the PBS docs):


For the storage parameter in the man page:

--master-pubkey a file containing a PEM-formatted master public key 
     Base64-encoded, PEM-formatted public RSA key. Used tp encrypt a 
copy of the encryption-key which will be added to each encrypted backup.

The description might be confusing, as one might wrongly think the file 
has to be base64 encoded. Also, there's a typo: "Used tp encrypt".


Tested storage adding/update/removal with master-pubkey. The update hook 
does not check if there's an encryption key, but the add hook does. 
Maybe we can also check that the file's contents are actually a PEM 
public key?


Tested backup+restore of a VM, with
1) downgraded pve-qemu-kvm=5.1.0-8 libproxmox-backup-qemu0=1.0.2-1
2) storage with master-pubkey but no encryption key
Warnings show up in the log and master key is not used as expected.


Tested backup+restore of a VM and a CT with correctly configured 
storage, also worked as expected.


Removed the encryption key on the storage, restore fails.

Restored the key from the backup with a master key as described in the 
PBS docs. Well, except for using '--kdf none' in the command below, so I 
could actually upload the keyfile to the storage again without running 
into an "Error: no password input mechanism available". From the PBS docs:

6. Then, use the previously generated master key to decrypt the file:

# proxmox-backup-client key import-with-master-key /path/to/target 
--master-keyfile /path/to/master-private.pem --encrypted-keyfile 
/path/to/rsa-encrypted.key

7. The target file will now contain the encryption key information in 
plain text. The success of this can be confirmed by passing the 
resulting json file, with the --keyfile parameter, when decrypting files 
from the backup.

Maybe we should mention something about the kdf, as the "file will now 
contain the encryption key information in plain text" is a bit 
misleading. Technically true, the information about the key is in plain 
text, but not the key itself ;)

Now, restoring worked again. Also recovered the key from the CT backup 
and checked that it matched.




      parent reply	other threads:[~2021-05-12  9:55 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-08 13:08 Fabian Grünbichler
2021-02-08 13:08 ` [pve-devel] [PATCH proxmox-backup-qemu] api: add master key support Fabian Grünbichler
2021-02-12 14:38   ` [pve-devel] applied: " Thomas Lamprecht
2021-02-08 13:08 ` [pve-devel] [PATCH qemu] pbs: " Fabian Grünbichler
2021-02-10 11:05   ` Stefan Reiter
2021-02-10 12:52     ` Fabian Grünbichler
2021-02-08 13:08 ` [pve-devel] [PATCH v2 storage] pbs: allow setting up a master key Fabian Grünbichler
2021-04-22 20:00   ` [pve-devel] applied: " Thomas Lamprecht
2021-02-08 13:08 ` [pve-devel] [PATCH qemu-server] vzdump: add master key support Fabian Grünbichler
2021-05-28 11:50   ` Thomas Lamprecht
2021-05-28 12:09     ` [pve-devel] [PATCH REBASE " Fabian Grünbichler
2021-06-02 14:51       ` [pve-devel] applied: " Thomas Lamprecht
2021-05-12  9:54 ` Fabian Ebner [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d1ba76c3-5ef1-8a1e-769c-a3dd29ee2f2c@proxmox.com \
    --to=f.ebner@proxmox.com \
    --cc=f.gruenbichler@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal