Skip to content

microVM: keep guests from reaching loopback-TCP console listeners through host loopback #551

Closed

Description

Summary

A microVM boot console can listen on loopback TCP (--virtio-console listen=tcp:127.0.0.1:PORT). OpenVMM requires a loopback address for microVM console TCP endpoints (openvmm/openvmm_entry/src/microvm/console.rs), but the boot console does not authenticate its client. Unless host loopback is denied, the guest gateway maps guest TCP flows onto host 127.0.0.1 (see the host-loopback section of doc/run.md), so a guest whose egress policy permits the port can connect to a loopback-TCP console listener: its own, or another VM's on the same host. When that console carries an interactive shell, the connecting guest drives the shell.

Where it applies

  • Host loopback is mapped by default: the OpenVMM CLI, nvx.py run, and nvx.py sandbox keep the mapping unless --host-loopback deny is given. nvx-rs passes --host-loopback deny whenever it attaches a network.
  • In this repository, only the test-microvm harness opens loopback-TCP boot consoles (scripts/nvx_tools/microvm_tests.py).
  • The separately supplied agent library captures guest boot consoles; its endpoint kind should be checked.

Options

  • Reject a loopback-TCP console unless host loopback is denied.
  • Remove TCP from the microVM console endpoint kinds, keeping Unix sockets and named pipes.
  • Exclude the VMM's own listener ports from the gateway's host-loopback mapping.

Tasks

  • Choose an option and implement it in OpenVMM's microVM console validation or in Consomme.
  • Move the test-microvm loopback-TCP consoles to Unix sockets or named pipes, or deny host loopback where they remain.
  • Check the agent library's boot-console endpoint.
  • Update the console and network documentation.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions