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

Add support for Qubes firewall profiles/rulesets #9205

Open
apparatius opened this issue May 9, 2024 · 2 comments
Open

Add support for Qubes firewall profiles/rulesets #9205

apparatius opened this issue May 9, 2024 · 2 comments
Labels
C: networking P: default Priority: default. Default priority for new issues, to be replaced given sufficient information. T: enhancement Type: enhancement. A new feature that does not yet exist or improvement of existing functionality.

Comments

@apparatius
Copy link

The problem you're addressing (if any)

It's a common situation where you'll have multiple qubes that should have the same firewall rules.
For example:

  • allow local connections and block all other connections
  • block local connections and allow all other connections

Right now we have two options:

  1. Set firewall rules for each qube separately.
sys-net
└─sys-firewall
  └─vm1 (rules: no lan)
  └─vm2 (rules: no lan)
  └─vm3 (rules: no lan)
  └─vm6 (rules: only lan)
  └─vm7 (rules: only lan)

This way you can have a single sys-firewall to enforce the rules for all qubes.
But if you'll have a need to change the firewall rules later, e.g. add another local subnet to the allowed connections, then you'll have to manually edit all the qube's firewall rules to add this new rule change.
This is cumbersome.

  1. Add second sys-firewall qube that'll be used to set the common firewall rules for all the qubes connected to it.
sys-net
└─sys-firewall
  └─sys-firewall-no-lan
    └─vm1
    └─vm2
    └─vm3
  └─sys-firewall-only-lan
    └─vm4
    └─vm5

This way you'll have two sys-firewall qubes so it'll consume more system resources compared with first option.
But this way editing firewall rules will be more convenient.

The solution you'd like

I suggest to add a feature to Qubes firewall so it'll be possible to create profiles/rulesets and use them to to set the qube's firewall rules.
E.g. create profile allow-lan-ruleset with these rules:

NO  ACTION  HOST            PROTOCOL  PORT(S)  SPECIAL TARGET    ICMP TYPE  EXPIRE  COMMENT
0   accept  192.168.1.0/24  -         -        -                 -          -       -
1   drop    -               -         -        -                 -          -       -

And then select this profile for the qube to use.
This way you can edit this profile later and the changes will be propagated to all the qubes automatically.

Maybe also consider to not only select the firewall rules profile but also use these rulesets as parts of qube's firewall rules e.g. to be able to set qube firewall rules to be:

NO  ACTION  HOST        PROTOCOL  PORT(S)  SPECIAL TARGET    ICMP TYPE  EXPIRE  COMMENT
0   accept  1.2.3.4/32  udp       12345    -                 -          -       -
1   import  -           -         -        github-ruleset    -          -       import rules to allow connections to github
2   import  -           -         -        allow-lan-ruleset -          -       import rules to allow connections to LAN
3   drop    -           -         -        -                 -          -       -

The value to a user, and who that user might be

User can easily and more flexibly manage the qubes firewall rules.
Related forum topic:
https://forum.qubes-os.org/t/chaining-sys-firewalls-vs-duplicating-firewalling-rules-on-many-qubes/26351

Completion criteria checklist

(This section is for developer use only. Please do not modify it.)

@apparatius apparatius added P: default Priority: default. Default priority for new issues, to be replaced given sufficient information. T: enhancement Type: enhancement. A new feature that does not yet exist or improvement of existing functionality. labels May 9, 2024
@unman
Copy link
Member

unman commented May 10, 2024 via email

@marmarek
Copy link
Member

The firewall chain approach should be much cheaper (in terms of RAM) if you use mirage qubes firewall

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: networking P: default Priority: default. Default priority for new issues, to be replaced given sufficient information. T: enhancement Type: enhancement. A new feature that does not yet exist or improvement of existing functionality.
Projects
None yet
Development

No branches or pull requests

4 participants