158 Commits

Author SHA1 Message Date
Ad Schellevis
ed7a90194c Firewall: Rules - add experimental inline shaper support 2025-01-21 19:52:50 +01:00
Ad Schellevis
0dac1d6201 Firewall: Rules - allow multiple options in source/destination address fields.
o merge src+srcmask, dst+dstmask into a single field
o remove current clunky input and re-use the same javascript hooks as in MVC
o re-use OPNsense\Firewall\Api\FilterController to list available options
2024-12-08 18:42:15 +01:00
Ad Schellevis
fed2a35269
Firewall - adhere to best practices (#8010)
* Firewall - adhere to best practices (https://www.openbsd.org/faq/pf/filter.html) and skip lo0 from processing. closes https://github.com/opnsense/core/issues/8009
2024-10-29 20:13:46 +01:00
Jason Fayre
9647df82ed
firewall: added presentation role to edit rules table (#7618)
For tables that are purely used for presentation as opposed to data, using the role="presentation" attribute prevents extra announcements from screen readers.
2024-07-14 19:45:26 +02:00
Ad Schellevis
984ffb0ff2 Firewall: Rules - add optional advanced property "State policy" to influence state creation on a per rule base. closes https://github.com/opnsense/core/issues/7294 2024-03-04 20:13:49 +01:00
Franco Fichtner
945bd66a3d system: remove the old syslog logging page #6830
New tab is still to be added to the MVC page.  Move it in place
for now and deal with nagivgation and wording later.
2024-03-01 08:26:36 +01:00
Franco Fichtner
cf4f97dd20 firewall: fix PHP warnings 2024-03-01 08:18:42 +01:00
Franco Fichtner
ac0dc0ff89 firewall: fix bootstrap-select update fallout
data-width="auto" use is probably still broken in a few places
but better fix these per user report.
2023-11-22 14:30:32 +01:00
Franco Fichtner
8b378cd4e7 ui: unify dropdown width
Fix a nasty scroll bar bug with alias proto selector, style
and adjust all manual widths accordingly.  For a strange reason
the text inputs are 2px shorter in the base forms than the modals
and the static pages so adjust the width to 346 in that case.
2023-11-16 11:29:16 +01:00
Ad Schellevis
be0b18930f Firewall: Rules: Floating - add "Interface / Invert" to the list, which will invert the "on" clause of the rule. To prevent future tickets when selecting multiple interfaces and invert, we'll add a validation to only allow single inverts.
When multiple interfaces are selected, these will render into separate rules in which case it might not be clear what the outcome would be, specifically when choosing something else than "pass" (pass lan,wan would lead to two rules which match either lan or wan, block lan, wan would lead to random behavior for example).

For https://github.com/opnsense/core/issues/6902
2023-10-02 14:36:28 +02:00
Franco Fichtner
15c0788e50 src: remove spurious ifconfig data pass 2023-08-29 11:51:13 +02:00
Franco Fichtner
84c7e49944 firewall: while here also fix most obvious warnings in edit page 2023-08-02 08:11:39 +02:00
Franco Fichtner
75227f146c firewall: typo in previous 2023-06-22 12:43:55 +02:00
Franco Fichtner
ded0b9c93e firewall: align rule validation with port forward validation
PR: https://forum.opnsense.org/index.php?topic=34548.0
2023-06-22 12:39:29 +02:00
Ad Schellevis
fc93cdb0b0 Firewall : disable related network fields to align with https://github.com/opnsense/core/issues/6617 2023-06-16 21:56:34 +02:00
Franco Fichtner
14966b5391 firewall: simplify layout and fix (unused) element ID; closes #6552 2023-05-10 08:10:01 +02:00
Franco Fichtner
c760383ca4 firewall: hide source os under advanced #6081
The OS fingerprints are no longer maintained so reduce user
exposure and keep the feature active for the time being.
It might make sense to remove it at a later point in time if
it continues to be abandoned.
2022-12-20 16:46:08 +01:00
Ad Schellevis
7c0db67577 Firewall/Rules - support tos/dscp matching. validation issue in a002251146 for https://github.com/opnsense/core/issues/6045 2022-09-22 17:12:54 +02:00
Ad Schellevis
a002251146 Firewall/Rules - support tos/dscp matching. closes https://github.com/opnsense/core/issues/6045
Add the `tos` keyword to the filter rule edit page and render in pf.conf when set.
2022-09-22 11:45:40 +02:00
Ad Schellevis
cebea865c9 Firewall/Rules - extend legacy configuration with uuid's to align with mvc code.
Since filter_rules_sort() is only called via front end pages, it should be safe to check if rules already have a uuid assigned and assign them if they don't. This prevents a migration and increases the change of fast adoption of the rule uuid's.

This commit adds generate_uuid() to config.inc and mimics the same behaviour as mvc models will do, if at a later point in time we would like to hook uuid's to xml attributes in other areas as well, we can simply reuse this.

It is likely a good idea to start using the uuid's in filter_core_rules_user() as labels too as this would prevent the use of the rule hash calculation (saves time and is a more stable id in most cases).

Impact of this change should be rather low as nothing depends on the uuids yet.
2022-09-20 11:17:29 +02:00
Franco Fichtner
77594c8b99 firewall: route-to, reply-to (and dup-to) are mutally exclusive
PR: https://forum.opnsense.org/index.php?topic=26700.0
2022-03-21 10:19:16 +01:00
Ad Schellevis
b01da7a918
Fr5487 adaptive timeouts (#5502)
* per-rule adaptive timeouts

allow per-rule adaptive timeouts. 0 is possibe to disable adaptive timeouts

* Firewall / Rules - allow per-rule adaptive timeouts, small cleanups for https://github.com/opnsense/core/pull/5492

* Firewall / Rules - allow per-rule adaptive timeouts, values may be 0 as well, so "positive" should be "non-negative" for https://github.com/opnsense/core/pull/5492

Co-authored-by: kulikov-a <36099472+kulikov-a@users.noreply.github.com>
2022-01-25 08:49:16 +01:00
Franco Fichtner
98a049a904 src: translation style issues 2022-01-03 10:29:56 +01:00
Ad Schellevis
b567ddb1f1 Firewall / Rules - drop policy based routing validation on interface rules as discussed in https://github.com/opnsense/core/issues/5329#issuecomment-968704455 2021-11-15 10:58:19 +01:00
kulikov-a
061cb006b2
Firewall / Rules allow 'any' as a port range lower bound (#5306) 2021-10-26 09:36:08 +02:00
Ad Schellevis
9da5c28f40 Firewall / Rules - specify overload table on max new connections, closes https://github.com/opnsense/core/issues/5229 2021-09-21 15:27:44 +02:00
Franco Fichtner
cee9f6a7ba firewall: tweak wording in previous 2021-09-15 09:13:12 +02:00
Franco Fichtner
d2291d21d2 firewall: fixup prio texts and enable relevant sysctl for FreeBSD 13
It only reads or writes VLAN header priority code points.

While here inline the forwarding sysctls instead of setting them all
the time.

PR: https://forum.opnsense.org/index.php?topic=24756.0
2021-09-15 09:08:12 +02:00
Ad Schellevis
b4bba863f8 Firewall - rules : add some missing curly braces in if statements (style) and prevent "allow options" from being set on non pass rules 2021-06-18 15:59:39 +02:00
Franco Fichtner
57b3cff9d4 src: more cleanups on static pages 2021-06-07 10:45:21 +02:00
Ad Schellevis
286000deab Firewall - allow manual reply-to configuration
Refactor firewall edit page to allow selection of a reply-to gateway in stead of the single "disablereplyto" option. Since underscores aren't valid for gateway names,
we should be able to use __disable__ here to mark the previous "disablereplyto" setting which we can unravel when saving settings again.

Our page saves either "disablereplyto" or "reply-to" depending on selection.
2021-05-25 17:24:45 +02:00
Greelan
19af1dc369
webgui: clarify help text for firewall rules traffic direction (#4848) 2021-04-19 13:51:22 +02:00
Ad Schellevis
bf42e6efce firewall / categories: minor regression, when returning fromt POST type isn't guaranteed. 2021-01-29 18:53:24 +01:00
Ad Schellevis
b00902e46c Firewall: add model for categories. work in progress for https://github.com/opnsense/core/issues/4587
escape category option values.
2021-01-14 17:07:17 +01:00
Ad Schellevis
fab8222aea Firewall: add model for categories. work in progress for https://github.com/opnsense/core/issues/4587
remove spacing from tokenize options, Tokenize2 doesn't seem to trim values (breakng auto-complete in this case)
2021-01-13 19:05:46 +01:00
Ad Schellevis
416fc37ee9 Firewall: add model for categories. work in progress for https://github.com/opnsense/core/issues/4587
o replace type ahead with tokenizer (mutli select) while here, since the type ahead needed fixes which we rather don't copy to the other firewall sections
o we might want to change the model serializeToConfig() and reload and send it to a separate function in config.inc later to ease migration later. Part of it could be separated with a callback, but it's not super needed
o hook categories into model for firewall rules
2021-01-12 18:14:50 +01:00
Ad Schellevis
06b1804a3d firewall rules, type in for for https://github.com/opnsense/core/issues/4493 closes https://github.com/opnsense/core/issues/4562 2020-12-31 17:31:16 +01:00
Ad Schellevis
c02155630e Firewall: minor validation issue (ipv6-icmp inet), closes https://github.com/opnsense/core/issues/4493 2020-11-30 17:10:27 +01:00
Ad Schellevis
323c2f8286 firewall: categories typeahead issue, closes https://github.com/opnsense/core/issues/4126
Although this isn't a great fix, we can prevent forking https://github.com/bassjobsen/Bootstrap-3-Typeahead for now and hope someone fixes the relative issue some day.
When Typeahead inputs aren't in relative containers, postition() returns the correct values, which is why our quick menu search likely still works.
2020-05-24 15:19:29 +02:00
Franco Fichtner
6bb03c1806 firewall: remove two sentences via IRC question raised
The default implies to leave it that way if unsure.  The ominous
warning means nothing without explanation, but the effect is
clear for people wanting to use another setting for direction:

o Egress rules filter on outbound, so half the performance passing
  traffic inwards is already wasted by not dropping it on inbound.

o Egress rules cannot set policy routes since policy routes set
  outbound interface on inbound and thus the decision was already
  made.
2019-09-30 09:28:39 +02:00
Ad Schellevis
04c1decd19 firewall, rules. make sure "tcp flags" input matches description. suggestion for https://github.com/opnsense/core/issues/3714 2019-09-23 18:48:37 +02:00
Ad Schellevis
01c16b0a86
Firewall, allow quick and direction on interface rules, closes https://github.com/opnsense/core/issues/3594
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 feature adds 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).

Policy based routing on outbound rules is not supported on the interface rules for now, since it would probably lead to confusion.
The old configuration defaults still apply, when writing an entry, both quick and direction are saved as well (default quick + in).
2019-08-01 09:37:24 +02:00
Ad Schellevis
34e942ad16 firewall_rules_edit.php, gateway validation issue (trying to validate groups). closes https://github.com/opnsense/core/issues/3511 2019-06-07 14:54:52 +02:00
Franco Fichtner
d9f70415fa firewall: translation fixes 2019-05-05 13:13:19 +02:00
Ad Schellevis
0ea621cab3 Routing, gateway groups, use new class methods in filter and filter edit page, for https://github.com/opnsense/core/issues/2279 2019-04-16 13:57:29 +02:00
Ad Schellevis
1a55473032 Filter, add ipv6-icmp type selection, closes https://github.com/opnsense/core/issues/3412 2019-04-15 14:54:19 +02:00
Ad Schellevis
49388ca2c6 Routing, gateways. ditch lookup_gateway_ip_by_name() usage from firewall_rules_edit.php, for https://github.com/opnsense/core/issues/2279 2019-04-12 15:05:07 +02:00
Ad Schellevis
c593906501 Routing, gateways, ditch another return_gateways_array() in firewall_rules_edit.php for https://github.com/opnsense/core/issues/2279 2019-04-11 20:51:44 +02:00
Ad Schellevis
0dddfd14cd missed a spot in previous, for https://github.com/opnsense/core/issues/2279 2019-04-10 17:49:29 +02:00
Ad Schellevis
1f6aac10a4 filter, edit rule. ditch validate_address_family(), cleanups for https://github.com/opnsense/core/issues/2279 2019-04-10 17:43:16 +02:00