All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Andrija Panic <andrija.panic@gmail.com>
Cc: qemu-devel@nongnu.org, michael.roth@amd.com, kkostiuk@redhat.com,
	armbru@redhat.com
Subject: Re: qemu-ga: safer default command policy? (re: "Improve mechanism for configuring allowed commands", June 2024)
Date: Fri, 27 Nov 2026 09:20:27 +0000	[thread overview]
Message-ID: <awlLW-Gr30ZTIMEp@redhat.com> (raw)
In-Reply-To: <CAMvtBPPveK4wH+P9bhWtWk-i9S-xBP-nggvWppFkJ7P=++0D5g@mail.gmail.com>

On Fri, Nov 27, 2026 at 06:30:27AM +0100, Andrija Panic wrote:
> Hi Daniel, Michael, Kostiantyn, all,
> 
> I would like to revisit Daniel's series from June 2024:
> 
>   [PATCH 00/14] Improve mechanism for configuring allowed commands
>   https://patchwork.kernel.org/project/qemu-devel/cover/20240604153242.251334-1-berrange@redhat.com/
> 
> As far as I can see in the archive, it stopped after the branch
> request in July 2024, there was no v2, and current master still has
> "allow everything" as the fallback policy in ga_command_is_allowed().
> Is the idea still wanted? I would be glad to help with testing.
> 
> Why I am asking now: I work on Apache CloudStack and on VMware-to-KVM
> migration tooling. Until a few years ago qemu-ga was installed on
> relatively few guests. That is changing quickly. Management stacks
> now use it for IP reporting, boot readiness checks and quiesced
> snapshots, and migration guides tell users to install it. Many guests
> that never ran the agent are getting it now, usually from distro
> packages, with whatever the distro default is.
> 
> Those defaults differ a lot today (read from each packaging source):
> 
>   - QEMU upstream: everything allowed.
>   - Debian and Ubuntu: the unit runs plain /usr/sbin/qemu-ga and no
>     qemu-ga.conf is shipped, so everything is allowed. Debian bug
>     #1076139 (July 2024) asked for a change; it was marked wishlist,
>     with the service file taken from upstream as-is.
>   - Fedora rawhide: a block list is shipped but commented out, so
>     everything is allowed.

This is an oversight I noticed a while ago, but didn't want to
change until my new patches were merged. IMHO it should have
been following RHEL's policy all this time.

>   - openSUSE Factory: blocks guest-exec and guest-exec-status only;
>     guest-file-* stay enabled.

Pointless, as you just use guest-file-write to the qga config file
to re-enable guest-exec

>   - RHEL 9/10 and rebuilds: an --allow-rpcs list without guest-exec*
>     and guest-file-*. That list still includes guest-set-user-password
>     and guest-ssh-add-authorized-keys, i.e. the "user auth" group the
>     --no-user-auth flag was meant to cover.
> 
> So no distribution I checked blocks password and SSH-key injection,
> and only one blocks file access.
> 
> I understand the usual answer: without confidential computing the
> host can read guest RAM and disks anyway. I think that undersells two
> things:
> 
>   1. Cost and visibility. Reading secrets out of RAM or editing an
>      offline disk is deliberate, specialised work. guest-exec is one
>      JSON line, gives a root shell, and looks like routine management
>      traffic. Least privilege still matters when the attacker is a
>      stolen operator credential or a compromised management service
>      rather than a determined host admin.

Yes, I feel the same way. QGA makes it waaaaay to easy for a host
admin to compromise a guest.

>   2. Confidential guests. As Daniel's cover letter says, with SEV-SNP or
>      TDX the host is not trusted, and an agent with every command
>      enabled undoes the protection. Guest images are increasingly
>      built once and run both ways.

Any confidential guest image running the QGA today needs to have
a CVE filed against it, unless they've blocked a vast number of
APIs manually.

> Concretely:
> 
>   - Is there interest in a v2 of the series? Was there a design
>     objection, or did it run out of review time?

This is just my fault for switching priorities, but also partly
because I wasn't entirely happy with the design. I wanted to
have  it "do the right thing(tm)" out of the box when running
on a confidential VM. With my patches in v2, it required having
two separate systemd services, one confidential and one not, or
writing a bunch of preexec code to change what features were
asked for.  I was thinking about revisiting recently to try for
a v3.

>   - Would the maintainers consider changing the built-in default
>     (for example blocking the "unrestricted" and "user auth" groups
>     unless explicitly allowed), or is that seen as a distro decision?

For a confidential VM, we clearly need to strictly lock it down
out of the box, otherwise it completely undermines confidentiality.
This needs to "do the right thing", as there's way too high risk
of users or distros installing QGA in a confidental guest and not
realizing the consequences.

For non-confidential VMs, it is harder to argue what the default
behaviour is. On the one hand I think we shouldn't expose APIs to
the host admin to directly compromise a running guest. On the
other hand, any restrictions we put in place are somewhat like
snake-oil, since if they try hard enough a host admin can do
anything they like to a non-confidential guest.

On balance I feel like we shouldn't be handing over the keys on a
platter out of the box, and that we should cut out arbitrary file
read/write arbitrary exec, and password/ssh key injection by default.

> 
> I can test a v2 on Debian, Ubuntu and RHEL-family guests against
> libvirt and Apache CloudStack, and report which management features
> keep working with each group blocked. CloudStack, for example, only
> needs guest-ping, guest-sync, guest-network-get-interfaces and the
> guest-fsfreeze-* commands for its core features.



With regards,
Daniel
-- 
|: https://berrange.com       ~~        https://hachyderm.io/@berrange :|
|: https://libvirt.org          ~~          https://entangle-photo.org :|
|: https://pixelfed.art/berrange   ~~    https://fstop138.berrange.com :|



  parent reply	other threads:[~2026-11-27  9:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-27  5:30 qemu-ga: safer default command policy? (re: "Improve mechanism for configuring allowed commands", June 2024) Andrija Panic
2026-11-27  5:53 ` Andrija Panic
2026-11-27  9:20 ` Daniel P. Berrangé [this message]
2026-11-27 17:43   ` Andrija Panic

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=awlLW-Gr30ZTIMEp@redhat.com \
    --to=berrange@redhat.com \
    --cc=andrija.panic@gmail.com \
    --cc=armbru@redhat.com \
    --cc=kkostiuk@redhat.com \
    --cc=michael.roth@amd.com \
    --cc=qemu-devel@nongnu.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.