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

Firewall: manage egress rules per interface #3594

Closed
AdSchellevis opened this issue Jul 24, 2019 · 6 comments
Closed

Firewall: manage egress rules per interface #3594

AdSchellevis opened this issue Jul 24, 2019 · 6 comments
Assignees
Labels
feature Adding new functionality
Milestone

Comments

@AdSchellevis
Copy link
Member

AdSchellevis commented Jul 24, 2019

Currently the direction of the traffic can only be chosen in floating rules, but in some scenario's it's much easier to create outbound rules (only inbound is supported now).

When using a lot of interfaces, which should all be allowed to access devices on one specific interface, this would save quite some rules and is easier to track for the administrator.

This FR should add direction as on option and while already changing these pages, also allow to create "non quick" rules on interfaces.
Functionally the "regular" rules would be more aligned with the "floating" rules as we have now, with the exception that you can't add multiple interfaces in a normal rule due to the inability to reorder a single rule in multiple rulesets (rules are positional).

Considerations while adding this:

  • Validate if "policy based routing" is used for outbound rules, since this is not compatible
  • Mark outbound rules in the overview grid
  • Mark non-quick rules in the overview grid

Test current status (including relevant commits in master) on 19.7.1:

pkg install -f opnsense
opnsense-patch f8d5c01 534f3c8 4d9026e 649e7b1 179798d f11da62
@AdSchellevis AdSchellevis added the feature Adding new functionality label Jul 24, 2019
@AdSchellevis AdSchellevis added this to the 20.1 milestone Jul 24, 2019
@AdSchellevis AdSchellevis self-assigned this Jul 24, 2019
@mimugmail
Copy link
Member

So for a LAN rule you have a dropdown for outgoing interface and rule logic is still inbound? Outbound should be multi select for multi wan setups. Just a quick thought

@AdSchellevis
Copy link
Member Author

@mimugmail no, this is just about the in/out part of the rule, pf doesn't support in / out interfaces per rule (as ipfw does)

Specifically, these will become available in per interface rules:
image
image

@fichtner
Copy link
Member

I would like to see in/out, but not any for the same policy routing fail reason. People won't understand this worst case.

@mimugmail
Copy link
Member

mimugmail commented Jul 25, 2019

This issue is based on the wishes from wowas in IRC, correct?

@AdSchellevis
Copy link
Member Author

no, one of our clients. For traceability I made sure there's an issue to refer in future commits.

AdSchellevis added a commit that referenced this issue Jul 29, 2019
* unlock quick and direction on regular interface rules
* only support in/out for direction on interfaces (not any)
* when using policy based routing on interfaces, validate for [in] usage. Although technically you can specify out policy rules, we choose not to support this at the moment to avoid confusion.
* make sure "quick" setting respects previous defaults (unset on floating -> unchecked, unset on interface -> checked)

Since quick is already properly applied in the plugin code (https://github.com/opnsense/core/blob/eeae08415038e80285c100c5e4c425830adc40b3/src/opnsense/mvc/app/library/OPNsense/Firewall/FilterRule.php#L171-L174), we shouldn't need additional logic for writing out the rules.
AdSchellevis added a commit that referenced this issue Jul 30, 2019
@AdSchellevis
Copy link
Member Author

note to self: missed a rule in our overview while debugging this (f8d5c01)

AdSchellevis added a commit that referenced this issue Jul 30, 2019
AdSchellevis added a commit that referenced this issue Jul 30, 2019
* unlock quick and direction on regular interface rules
* only support in/out for direction on interfaces (not any)
* when using policy based routing on interfaces, validate for [in] usage. Although technically you can specify out policy rules, we choose not to support this at the moment to avoid confusion.
* make sure "quick" setting respects previous defaults (unset on floating -> unchecked, unset on interface -> checked)

Since quick is already properly applied in the plugin code (https://github.com/opnsense/core/blob/eeae08415038e80285c100c5e4c425830adc40b3/src/opnsense/mvc/app/library/OPNsense/Firewall/FilterRule.php#L171-L174), we shouldn't need additional logic for writing out the rules.
AdSchellevis added a commit that referenced this issue Jul 30, 2019
fichtner pushed a commit that referenced this issue Aug 2, 2019
… in Floating section (slightly related to #3594)

(cherry picked from commit 534f3c8)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Adding new functionality
Development

No branches or pull requests

3 participants