From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 276B47363F for ; Fri, 28 May 2021 13:51:27 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 1D3DA8E73 for ; Fri, 28 May 2021 13:50:57 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id 9204C8E67 for ; Fri, 28 May 2021 13:50:56 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 6AD1D465C2 for ; Fri, 28 May 2021 13:50:56 +0200 (CEST) Message-ID: Date: Fri, 28 May 2021 13:50:55 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:89.0) Gecko/20100101 Thunderbird/89.0 Content-Language: en-US To: Proxmox VE development discussion , =?UTF-8?Q?Fabian_Gr=c3=bcnbichler?= References: <20210208130835.2512356-1-f.gruenbichler@proxmox.com> <20210208130835.2512356-5-f.gruenbichler@proxmox.com> From: Thomas Lamprecht In-Reply-To: <20210208130835.2512356-5-f.gruenbichler@proxmox.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-SPAM-LEVEL: Spam detection results: 0 AWL 0.016 Adjusted score from AWL reputation of From: address KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment NICE_REPLY_A -0.001 Looks like a legit reply (A) SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [qemuserver.pm] Subject: Re: [pve-devel] [PATCH qemu-server] vzdump: add master key support X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 May 2021 11:51:27 -0000 On 08.02.21 14:08, Fabian Gr=C3=BCnbichler wrote: > running outdated VMs without master key support will generate a warning= > but proceed with a backup without encrypted key upload. >=20 > Signed-off-by: Fabian Gr=C3=BCnbichler > --- >=20 > Notes: > requires libpve-storage-perl with master key support. >=20 needs a rebase > PVE/VZDump/QemuServer.pm | 13 +++++++++++++ > 1 file changed, 13 insertions(+) >=20 > diff --git a/PVE/VZDump/QemuServer.pm b/PVE/VZDump/QemuServer.pm > index b5e74d3..e3f785a 100644 > --- a/PVE/VZDump/QemuServer.pm > +++ b/PVE/VZDump/QemuServer.pm > @@ -485,6 +485,7 @@ sub archive_pbs { > my $repo =3D PVE::PBSClient::get_repository($scfg); > my $password =3D PVE::Storage::PBSPlugin::pbs_get_password($scfg, = $opts->{storage}); > my $keyfile =3D PVE::Storage::PBSPlugin::pbs_encryption_key_file_n= ame($scfg, $opts->{storage}); > + my $master_keyfile =3D PVE::Storage::PBSPlugin::pbs_master_pubkey_= file_name($scfg, $opts->{storage}); > =20 > my $diskcount =3D scalar(@{$task->{disks}}); > # proxmox-backup-client can only handle raw files and block devs > @@ -533,6 +534,12 @@ sub archive_pbs { > . "sure you've installed the latest version and the VM has been= restarted.\n"; > } > =20 > + if (!defined($qemu_support->{"pbs-masterkey"}) && -e $master_keyfile)= { > + $self->loginfo("WARNING: backup target is configured with master = key, but running QEMU version does not support master keys."); > + $self->loginfo("Please make sure you've installed the latest vers= ion and the VM has been restarted to use master key feature."); > + $master_keyfile =3D undef; # skip rest of master key handling bel= ow > + } > + > my $fs_frozen =3D $self->qga_fs_freeze($task, $vmid); > =20 > my $params =3D { > @@ -551,7 +558,13 @@ sub archive_pbs { > $self->loginfo("enabling encryption"); > $params->{keyfile} =3D $keyfile; > $params->{encrypt} =3D JSON::true; > + if (defined($master_keyfile) && -e $master_keyfile) { > + $self->loginfo("enabling master key feature"); > + $params->{"master-keyfile"} =3D $master_keyfile; > + } > } else { > + $self->loginfo("WARNING: backup target is configured with master = key, but this backup is not encrypted - master key settings will be ignor= ed!") > + if defined($master_keyfile) && -e $master_keyfile; > $params->{encrypt} =3D JSON::false; > } > =20 >=20