* qemu-ga: safer default command policy? (re: "Improve mechanism for configuring allowed commands", June 2024)
@ 2026-11-27 5:30 Andrija Panic
2026-11-27 5:53 ` Andrija Panic
2026-11-27 9:20 ` Daniel P. Berrangé
0 siblings, 2 replies; 4+ messages in thread
From: Andrija Panic @ 2026-11-27 5:30 UTC (permalink / raw)
To: qemu-devel; +Cc: berrange, michael.roth, kkostiuk, armbru
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.
- openSUSE Factory: blocks guest-exec and guest-exec-status only;
guest-file-* stay enabled.
- 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.
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.
Concretely:
- Is there interest in a v2 of the series? Was there a design
objection, or did it run out of review time?
- 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?
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.
Thanks,
Andrija Panić
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: qemu-ga: safer default command policy? (re: "Improve mechanism for configuring allowed commands", June 2024) 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é 1 sibling, 0 replies; 4+ messages in thread From: Andrija Panic @ 2026-11-27 5:53 UTC (permalink / raw) To: qemu-devel; +Cc: berrange, michael.roth, kkostiuk, armbru One addition I missed: the Windows agent is in the same state. On a Windows Server 2019 VM migrated to KVM, with qemu-ga 110.2.3 installed from the virtio-win package in the AlmaLinux 9 (EL9) repositories, the service runs as LocalSystem with no allow or block list and there is no qemu-ga.conf. guest-info shows all 37 commands enabled, and guest-exec runs as NT AUTHORITY\SYSTEM. So the same RHEL-family distribution that restricts its Linux agent ships a Windows agent with everything enabled. Thanks, Andrija On Fri, Nov 27, 2026 at 6:30 AM Andrija Panic <andrija.panic@gmail.com> 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. > - openSUSE Factory: blocks guest-exec and guest-exec-status only; > guest-file-* stay enabled. > - 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. > > 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. > > Concretely: > > - Is there interest in a v2 of the series? Was there a design > objection, or did it run out of review time? > - 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? > > 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. > > Thanks, > Andrija Panić ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: qemu-ga: safer default command policy? (re: "Improve mechanism for configuring allowed commands", June 2024) 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é 2026-11-27 17:43 ` Andrija Panic 1 sibling, 1 reply; 4+ messages in thread From: Daniel P. Berrangé @ 2026-11-27 9:20 UTC (permalink / raw) To: Andrija Panic; +Cc: qemu-devel, michael.roth, kkostiuk, armbru 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 :| ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: qemu-ga: safer default command policy? (re: "Improve mechanism for configuring allowed commands", June 2024) 2026-11-27 9:20 ` Daniel P. Berrangé @ 2026-11-27 17:43 ` Andrija Panic 0 siblings, 0 replies; 4+ messages in thread From: Andrija Panic @ 2026-11-27 17:43 UTC (permalink / raw) To: berrange; +Cc: qemu-devel, michael.roth, kkostiuk, armbru [-- Attachment #1: Type: text/plain, Size: 8344 bytes --] Hi Daniel, Thanks for the quick and detailed reply, and for the background on the series. > 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. Agreed, and I would like to help make that the upstream default rather than leave it to each distribution. The packaging survey shows why: where a distro made a deliberate choice (RHEL), guests are reasonably protected; where the package follows upstream as-is (Debian and Ubuntu, and Fedora by the oversight you mention), everything is open. Those are also the guests that most cloud images, templates and migration tools hand to end users who never look at qemu-ga at all. A safe built-in default protects exactly the people who don't know they need to configure it. A proposal for discussion: - Built-in default: an allow list of what management stacks actually use (guest-ping, guest-sync*, guest-info, guest-network-get-interfaces, guest-get-osinfo, guest-get-host-name, guest-fsfreeze-*, guest-fstrim, guest-shutdown, and similar read-only status commands). Everything else, including exec, file access and the user auth commands, off unless explicitly enabled. - An allow list rather than a block list, so a command added in a future release stays off until someone decides it is safe. - Confidential VMs get your stricter profile on top of that. Two more points that I think make the case: - In-guest disk encryption (LUKS, BitLocker) protects data at rest from the host, but with today's default the host can still read the decrypted files of the running guest through guest-file-read or guest-exec. The guest owner did everything right and the agent undoes it. I expect that to surprise security auditors. - It puts the responsibility in the right place. A cloud operator cannot realistically ask every unmanaged tenant to harden an in-guest agent; a sane default in the package can. I am happy to test a v3 on Debian, Ubuntu and RHEL-family guests with libvirt and Apache CloudStack, and to report which management features keep working under each profile. If it helps, I can also collect the list of agent commands the common management stacks depend on. Thanks, Andrija On Fri, Nov 27, 2026 10:20 AM, "Daniel P. Berrangé" <berrange@redhat.com> wrote: > 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 :| > > [-- Attachment #2: Type: text/html, Size: 10087 bytes --] ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-11-27 17:44 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 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é 2026-11-27 17:43 ` Andrija Panic
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.