diff --git a/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Models/FirewallRule.inc b/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Models/FirewallRule.inc index 45f6f3a9..bd3c3cd3 100644 --- a/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Models/FirewallRule.inc +++ b/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Models/FirewallRule.inc @@ -74,6 +74,7 @@ class FirewallRule extends Model { allow_interface_groups: true, allow_ipsec_interface: true, allow_openvpn_interface: true, + allow_custom: ['any'], many: true, help_text: 'The interface where packets must originate to match this rule.', ); diff --git a/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Tests/APIModelsFirewallRuleTestCase.inc b/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Tests/APIModelsFirewallRuleTestCase.inc index 5135ec1a..e0d7d922 100644 --- a/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Tests/APIModelsFirewallRuleTestCase.inc +++ b/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Tests/APIModelsFirewallRuleTestCase.inc @@ -993,4 +993,21 @@ class APIModelsFirewallRuleTestCase extends TestCase { $this->assert_equals($rule->updated_by->value, "$client->username@$client->ip_address (API)"); } } + + /** + * Checks that we can create a floating firewall rule with the 'any' interface + */ + public function test_floating_rule_with_any_interface(): void { + # Create a firewall rule to test with + $rule = new FirewallRule( + type: 'pass', + interface: ['any'], + ipprotocol: 'inet', + protocol: 'tcp', + source: 'any', + destination: 'any', + floating: true, + ); + $rule->validate(); + } }