feat(core): restrict libvirt socket access and introduce vlctl tool #817
Merged
yaroslavborbat merged 8 commits intomainfrom Mar 31, 2025
Merged
feat(core): restrict libvirt socket access and introduce vlctl tool #817yaroslavborbat merged 8 commits intomainfrom
vlctl tool #817yaroslavborbat merged 8 commits intomainfrom
Conversation
Base automatically changed from
feat/core/disable-unnecessary-libvirt-sockets
to
main
March 3, 2025 18:44
370d96f to
4ac41ce
Compare
5185563 to
50a01e5
Compare
5262955 to
f959af4
Compare
99f022f to
27e388d
Compare
Base automatically changed from
refactor/kubevirt/set-reboot-action-in-virt-launcher
to
main
March 11, 2025 16:51
dd943c0 to
260de3f
Compare
vmx tool
f75a8c7 to
595663c
Compare
acd092c to
243377a
Compare
diafour
reviewed
Mar 27, 2025
091e079 to
61222a6
Compare
61222a6 to
f5565f8
Compare
universal-itengineer
approved these changes
Mar 27, 2025
diafour
approved these changes
Mar 27, 2025
Co-authored-by: Pavel Tishkov <pavel.tishkov@flant.com> Signed-off-by: Yaroslav Borbat <86148689+yaroslavborbat@users.noreply.github.com>
Co-authored-by: Ivan Mikheykin <ivan.mikheykin@flant.com> Signed-off-by: Yaroslav Borbat <86148689+yaroslavborbat@users.noreply.github.com>
…mu.patch Co-authored-by: Ivan Mikheykin <ivan.mikheykin@flant.com> Signed-off-by: Yaroslav Borbat <86148689+yaroslavborbat@users.noreply.github.com>
Signed-off-by: Nikita Korolev <nikita.korolev@flant.com>
Co-authored-by: Ivan Mikheykin <ivan.mikheykin@flant.com> Signed-off-by: Yaroslav Borbat <86148689+yaroslavborbat@users.noreply.github.com>
Co-authored-by: Ivan Mikheykin <ivan.mikheykin@flant.com> Signed-off-by: Yaroslav Borbat <86148689+yaroslavborbat@users.noreply.github.com>
Co-authored-by: Ivan Mikheykin <ivan.mikheykin@flant.com> Signed-off-by: Yaroslav Borbat <86148689+yaroslavborbat@users.noreply.github.com>
f5565f8 to
eb9e3de
Compare
fl64
approved these changes
Mar 28, 2025
Merged
yachmenevas
pushed a commit
that referenced
this pull request
Oct 15, 2025
…#817) Restrict libvirt socket access and introduce vlctl tool This PR enhances security in KubeVirt by restricting virtqemud socket access and introducing vlctl, a new tool to retrieve domain information without using virsh. --------- Signed-off-by: Yaroslav Borbat <yaroslav.borbat@flant.com> Signed-off-by: Nikita Korolev <nikita.korolev@flant.com> Co-authored-by: Pavel Tishkov <pavel.tishkov@flant.com> Co-authored-by: Ivan Mikheykin <ivan.mikheykin@flant.com> Co-authored-by: Nikita Korolev <nikita.korolev@flant.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Restrict libvirt socket access and introduce
vlctltoolThis PR enhances security in KubeVirt by restricting
virtqemudsocket access and introducingvlctl, a new tool to retrieve domain information without usingvirsh.Changes
1. Added libvirt patch (
002-auth-pid-restriction.patch)LIBVIRT_UNIX_SOCKET_AUTH_PIDenvironment variable for virtqemud.2. Added KubeVirt patch (
041-restrict-libvirt-socket-to-qemu.patch)virtqemudto use theLIBVIRT_UNIX_SOCKET_AUTH_PIDenvironment variable, restricting access to thevirt-launcherprocess that started it.virtqemudsocket during migration, the libvirt patch does not authorize it. To address this issue, an additionalmigration-proxyhas been introduced invirt-launcher. This proxy receives traffic fromvirt-handlerand forwards it tovirtqemud.3. Introduced
vlctltoolvirshfor retrieving domain-related information.virsh, improving efficiency and security.vlctlCommand ReferenceGeneral Commands
vlctl ping– Check connectivity withvirt-launcher.vlctl qemu version– Get the QEMU version.Domain Commands
vlctl domain– Get the domain specification.vlctl domain stats– Get domain statistics.Guest Commands
vlctl guest info– Get general guest info.vlctl guest filesystems– Get info about the guest's filesystems.vlctl guest users– Get info about logged-in guest users.vlctl guest ping– Ping guest agent.Security Commands
vlctl sev– Get SEV info.These commands allow for efficient interaction with virtual machines while improving security and reducing dependency on
virsh.Why do we need it, and what problem does it solve?
These changes strengthen the isolation of QEMU processes, minimize unnecessary socket exposure, and provide a more efficient way to query domain information.
What is the expected result?
Checklist
Changelog entries