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

[ACL] Expanded rules do not work for same networks #392

Open
mzbroch opened this issue Oct 13, 2023 · 2 comments
Open

[ACL] Expanded rules do not work for same networks #392

mzbroch opened this issue Oct 13, 2023 · 2 comments

Comments

@mzbroch
Copy link
Contributor

mzbroch commented Oct 13, 2023

>>> input_rule = dict(
...     name="Allow to internal web",
...     src_ip=["192.0.2.0/24"],
...     dst_ip=["192.0.2.0/24"],
...     dst_port=["tcp/80", "tcp/433"],
...     action="permit",
... )
>>>
>>>
>>> acl.ACLRule(input_rule).expanded_rules
[]
>>> input_rule = dict(
...     name="Allow to internal web",
...     src_ip=["192.0.2.1"],
...     dst_ip=["192.0.2.10"],
...     dst_port=["tcp/80", "tcp/433"],
...     action="permit",
... )
>>>
>>> acl.ACLRule(input_rule).expanded_rules
[{'name': 'Allow to internal web', 'src_ip': '192.0.2.1', 'dst_ip': '192.0.2.10', 'dst_port': '6/80', 'action': 'permit'}, {'name': 'Allow to internal web', 'src_ip': '192.0.2.1', 'dst_ip': '192.0.2.10', 'dst_port': '6/433', 'action': 'permit'}]
>>>
@mzbroch
Copy link
Contributor Author

mzbroch commented Oct 13, 2023

This is a bit of unfortunate test case - only if src_ip matches dst_ip, however still applicable for 0.0.0.0/0 to .0.0.0.0/0 or in-vlan firewalls.

@itdependsnetworks
Copy link
Contributor

Can you look at self.filter_same_ip? I think this is to be expected as currently coded, but perhaps shouldn't be?

https://netutils.readthedocs.io/en/latest/user/lib_use_cases_acl/?h=self.filter_same_ip#initialization-loading-data

@mzbroch mzbroch changed the title [ACL] Expanded rules do not work for networks [ACL] Expanded rules do not work for same networks Oct 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants