Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation to expose a port externally is unreliable #9680

Open
ben-grande opened this issue Jan 2, 2025 · 0 comments
Open

Documentation to expose a port externally is unreliable #9680

ben-grande opened this issue Jan 2, 2025 · 0 comments
Labels
affects-4.2 This issue affects Qubes OS 4.2. C: doc P: default Priority: default. Default priority for new issues, to be replaced given sufficient information. T: bug Type: bug report. A problem or defect resulting in unintended behavior in something that exists.

Comments

@ben-grande
Copy link

Qubes OS release

For Qubes documentation, I'm on R4.2.3

Brief summary

Qubes doesn't have a good way to expose a port from a qube down the chain to the external interface of sys-net using only firewall rules (NFTables).

Issues with the current method:

  • only works with qubes that have a netvm
  • unreliable in case of internal qubes ip change, netvm only knows clients by vif, not by name, happens when renaming a qube as it is a clone method
  • unreliable in case any netvm is disposable, writing rules to the disposable template instead of loading and updating on runtime is not flexible to change the rules
  • unreliable in case a netvm does not provide a shell such as unikernels

Wouldn't it be better if opening a single tcp port to other qube was documented as the preferred way of exposing a port?

Sure, pure nftables avoids Qrexec and socat or systemd sockets, but it seems like provided nftables rules as the preferred way to expose a port to the external interface a hackers note of the possibilities rather than being actually a good implementation.

Could be argued that qubes without Qrexec but network connected will not work using this method.

Without native qubes implementation with qube features and network-hooks in the Qubes codebase, wouldn't it be better if the documentation warned about the problems of the current implementation and suggested using Qrexec when available until Qubes supports exposing a port natively?

The situation is that everybody tries to script it:

But it is still not reliable for most of the error cases, it can only update to the new internal IP on demand (manual or Qubes Events possibly), but the rest of the issues are not solved.

Steps to reproduce

Expected behavior

Connection keeps working.

Actual behavior

Connection stops working, firewall rules are not present or outdated.


@DemiMarie has commented on Matrix:

A big problem with using qrexec is that it really isn't safe for anything exposed to the public Internet. There are no protections against denial of service attacks.

I replied:

There still the possibility of sys-net firewall and rate limiting, although I see your point that the initial design of Qrexec didn't consider the network, maybe some part of the development of Qubes Air will fix this.

@ben-grande ben-grande added P: default Priority: default. Default priority for new issues, to be replaced given sufficient information. T: bug Type: bug report. A problem or defect resulting in unintended behavior in something that exists. labels Jan 2, 2025
@andrewdavidwong andrewdavidwong added C: doc affects-4.2 This issue affects Qubes OS 4.2. labels Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-4.2 This issue affects Qubes OS 4.2. C: doc P: default Priority: default. Default priority for new issues, to be replaced given sufficient information. T: bug Type: bug report. A problem or defect resulting in unintended behavior in something that exists.
Projects
None yet
Development

No branches or pull requests

2 participants