From 09c84d7ceb4b2726d3f6eff651bea0ab41c1fc86 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Fri, 28 Feb 2020 16:14:29 +0100 Subject: [PATCH] firewall: add fields to model and mark todo's for https://github.com/opnsense/plugins/issues/1720 --- .../Firewall/forms/dialogFilterRule.xml | 90 ++++++++++++++++++ .../app/models/OPNsense/Firewall/Filter.xml | 95 +++++++++++++++++++ 2 files changed, 185 insertions(+) diff --git a/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/forms/dialogFilterRule.xml b/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/forms/dialogFilterRule.xml index 8f9b87057..6dfcb8ab1 100644 --- a/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/forms/dialogFilterRule.xml +++ b/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/forms/dialogFilterRule.xml @@ -10,6 +10,96 @@ text + + rule.action + + dropdown + Choose what to do with packets that match the criteria specified below. + Hint: the difference between block and reject is that with reject, a packet (TCP RST or ICMP port unreachable for UDP) is returned to the sender, whereas with block the packet is dropped silently. In either case, the original packet is discarded. + + + + rule.quick + + checkbox + + If a packet matches a rule specifying quick, then that rule is considered the last matching rule and the specified action is taken. + When a rule does not have quick enabled, the last matching rule wins. + + + + rule.interface + + select_multiple + + + rule.direction + + dropdown + + Direction of the traffic. The default policy is to filter inbound traffic, which sets the policy to the interface originally receiving the traffic. + + + + rule.ipprotocol + + dropdown + + + rule.protocol + + dropdown + + + rule.source_net + + text + + + rule.source_port + + text + true + Source port number or well known name (imap, imaps, http, https, ...), for ranges use a dash + + + rule.source_not + + checkbox + Use this option to invert the sense of the match. + + + rule.destination_net + + text + + + rule.destination_not + + checkbox + Use this option to invert the sense of the match. + + + rule.destination_port + + text + Destination port number or well known name (imap, imaps, http, https, ...), for ranges use a dash + + + rule.gateway + + dropdown + + Leave as 'default' to use the system routing table. Or choose a gateway to utilize policy based routing. + + + + rule.log + + checkbox + Log packets that are handled by this rule + + rule.description diff --git a/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.xml b/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.xml index ac824f219..73469f9e5 100644 --- a/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.xml +++ b/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.xml @@ -17,6 +17,101 @@ Y 1 + + Y + pass + + Pass + Block + Reject + + + + 1 + Y + + + Y + Y + lan + + + Y + in + + In + Out + + + + Y + inet + + IPv4 + IPv6 + + + + + Y + any + + any + TCP + UDP + + + + + any + Y + + + 0 + Y + + + + N + Y + Y + Please specify a valid port number, range or known service name + + + + any + Y + + + 0 + Y + + + + N + Y + Y + Please specify a valid port number, range or known service name + + + N + interface gateways list + /tmp/gateway_list.json + 20 + Specify a valid gateway from the list matching the networks ip protocol. + + + 0 + Y + N /^([\t\n\v\f\r 0-9a-zA-Z.\-,_\x{00A0}-\x{FFFF}]){0,255}$/u