From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: Maximiliano Sandoval <m.sandoval@proxmox.com>
Cc: Wolfgang Bumiller <w.bumiller@proxmox.com>,
Proxmox VE development discussion <pve-devel@lists.proxmox.com>
Subject: Re: [pve-devel] [PATCH qemu-server] config: add system and service credentials support
Date: Thu, 3 Apr 2025 11:04:51 +0200 [thread overview]
Message-ID: <b67a1dbb-1737-4d7f-9487-85ec5d4432e5@proxmox.com> (raw)
In-Reply-To: <s8oa58x3a2r.fsf@proxmox.com>
Am 03.04.25 um 10:34 schrieb Maximiliano Sandoval:
> Thomas Lamprecht <t.lamprecht@proxmox.com> writes:
>
>> Am 02.04.25 um 16:36 schrieb Maximiliano Sandoval:
>>> Allows to pass system and service credentials to a VM. See [1] for a
>>> description of credentials. This can be potentially used to provision a
>>> VM as per [2]. Values can be passed either as plain text or as a base64
>>> encoded string when the base64 flag is set.
>>
>> Would this also make sense for Containers?
>
> Absolutely, this would be a followup. The mechanism to pass them down to
> containers is not via smbios 11 though.
yeah sure, the transport is just a virtualization-specific
implementation detail.
>
>> If it's something we can expose for all guests, we could also (later) look
>> into implementing some simple registry (like a mappings type) fulfilling
>> what the snippets approach would provide one while having it nicely
>> integrated into our access control system.
>
> As per systemd-exec's man page, in total one can pass up to 1MB in
> system credentials. A VM config file is certainly not the vehicle for
> such an amount of data and I am also not fully comfortable with putting
> potentially sensitive data as plain-text inside config files or the
> cluster filesystem. I am not fully sure how to approach this long term.
>
>
> There is also the more-secure possibility to pass down system
> credentials from the host to the guest (e.g. ImportCredential= or
> LoadCredential=) but that would have the drawback that there is no
> mechanism to sync them acros a cluster.
A mapping could abstract most of that away and also use a flag to denote
if a credential is confidential and then safe it in the root-only
/etc/pve/priv path, IIRC we do something similar for notifications
targets like webhooks.
anyway, the more I think about this the surer I am that having this
centralized would be much nicer compared to inlining this for every VM
directly in the config; also with the 16 being rather low limit from my
other response.
>>> +my $systemd_cred_fmt = {
>>> + value => {
>>> + description => 'The credential\'s value. This is a Base64 encoded string.'
>>
>> But it isn't if the base64 flag is not set?
>
> I discussed this off-list a bit with Wolfgang and Fabian and I decided
> for the time being to only accept the character set of base64, if a user
> needs more control, they can encode the string as base64. But yes, the
> description should be improved.
>
> An alternative would be to require the string to be either a base64
> string or match a hand-picked format, e.g. [a-zA-Z0-9\-\.], but that
> would require studying what are the possible use-cases.
Then it might be best to drop the base64 flag for now and enforce that
everywhere. If we want to support anything else in the future we can add
an encoding sub-property enum that defaults to base64 once its actually
required, or deemed useful.
>>> @@ -1955,6 +1991,16 @@ sub parse_guest_agent {
>>> return $res;
>>> }
>>>
>>> +sub parse_systemd_credential {
>>> + my ($value) = @_;
>>> +
>>> + return {} if !$value;
>>> +
>>> + my $res = eval { parse_property_string($systemd_cred_fmt, $value) };
>>> + warn $@ if $@;
>> Should we really just ignore the error and warn here in a generic parser?
>> Isn't that the callers job to decide?
>
> Here I just copied what the other parsers in this file do. I am not sure
> how to implement something else.
>
Alright, so an existing deficiency then; so lets keep that approach for
now.
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
next prev parent reply other threads:[~2025-04-03 9:05 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-02 14:36 Maximiliano Sandoval
2025-04-03 7:49 ` Thomas Lamprecht
2025-04-03 7:56 ` Thomas Lamprecht
2025-04-03 8:48 ` Maximiliano Sandoval
2025-04-03 8:34 ` Maximiliano Sandoval
2025-04-03 9:04 ` Thomas Lamprecht [this message]
2025-04-03 9:42 ` Lukas Wagner
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=b67a1dbb-1737-4d7f-9487-85ec5d4432e5@proxmox.com \
--to=t.lamprecht@proxmox.com \
--cc=m.sandoval@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
--cc=w.bumiller@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