-
Notifications
You must be signed in to change notification settings - Fork 52
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
Rafactoring ACL attributes #464
base: develop
Are you sure you want to change the base?
Conversation
netutils/acl.py
Outdated
return str(item.deny) # pylint: disable=undefined-loop-variable | ||
if item.match(rule): # mzb: bugfix | ||
return True # mzb: change to bool | ||
return False # pylint: disable=undefined-loop-variable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had this as string as most vendors have more than just permit or deny, this is Palo's
allow
deny
drop
reset client
reset server
reset client and server
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO match
method should return only True/False if the rule is/not matched by the check. This should only check if A contains B.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is reasonable to have different levels.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think, I see this in a little different way :
def match_action(action, match_action):
deny_actions = ['deny', 'drop', 'reset client', 'reset server', ...]
if action in deny_actions and match_action in deny_actions:
return True
else:
return False
I would really like to avoid putting opinionated logic into generic match
resolution while we provide easily extensible framework
None
values:src_ip': None, 'dst_ip': None, 'action': None}