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

Multiple interaces for floating rule #260

Closed
VIKMSTR opened this issue Jul 11, 2022 · 3 comments · Fixed by #243
Closed

Multiple interaces for floating rule #260

VIKMSTR opened this issue Jul 11, 2022 · 3 comments · Fixed by #243
Labels
feature request New feature or request

Comments

@VIKMSTR
Copy link

VIKMSTR commented Jul 11, 2022

Since version 1.4.0 there is a possibility to manage floating firewall rules.
But the meaning of floating rules is, that they can be related to multiple interfaces.
When you open a firewall rule edit page, you can see "multiselect" text area to pick multiple interfaces.
image

This is not possible to achieve with API.

Solution proposal:

  1. an interface string attribute in the request body can consume multiple values separated by "," delimiter (so we can set it up via existing attribute)
    or
  2. Duplicating the /firewall_rules endpoint to firewall_floating_rules and handling the floating rules completely separate

Cheers,
Viktor

@VIKMSTR VIKMSTR added backlog Issues backlogged for inclusion in future releases feature request New feature or request labels Jul 11, 2022
@VIKMSTR
Copy link
Author

VIKMSTR commented Jul 11, 2022

Asked here while ago on the relevant PR btw:
#188 (comment)

@VIKMSTR
Copy link
Author

VIKMSTR commented Jul 11, 2022

I took a look into the config xml, and it seems, that the interfaces are indeed saved as a "," separated value.
Screenshot 2022-07-11 at 10 21 18

So if I'm looking correctly on the APIFirewallRuleCreate, only the validation should be adapted to make it work?

@VIKMSTR
Copy link
Author

VIKMSTR commented Jul 11, 2022

And actually, the values from already existing floating rules are also returned in "opt1,opt9" format in interface attribute.

{
  "id": "",
  "tracker": "1656335395",
  "type": "pass",
  "interface": "opt1,opt9",
  "ipprotocol": "inet",
  "tag": "",
  "tagged": "",
  "direction": "any",
  "floating": "yes",
  "max": "",
  "max-src-nodes": "",
  "max-src-conn": "",
  "max-src-states": "",
  "statetimeout": "",
  "statetype": "keep state",
  "os": "",
  "protocol": "tcp",
  "source": {
    "any": ""
  },
  "destination": {
    "any": ""
  },
  "disabled": "",
  "descr": "",
  "updated": {
    "time": "1656335395",
    "username": "admin@172.16.18.2 (Local Database)"
  },
  "created": {
    "time": "1656335395",
    "username": "admin@172.16.18.2 (Local Database)"
  }
}

Is there any reason why not enable multiple interfaces separated by "," (without spaces) - like backwards compatibility reasons etc?

@jaredhendrickson13 jaredhendrickson13 removed the backlog Issues backlogged for inclusion in future releases label Sep 1, 2022
@jaredhendrickson13 jaredhendrickson13 linked a pull request Sep 3, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants