Skip to content

Instantly share code, notes, and snippets.

@ivanbojer
Created April 24, 2018 00:02
Show Gist options
  • Save ivanbojer/8ec347d530570018b14923d56841cc4c to your computer and use it in GitHub Desktop.
Save ivanbojer/8ec347d530570018b14923d56841cc4c to your computer and use it in GitHub Desktop.
rulebase = pandevice.policies.Rulebase()
policies.SecurityRule.refreshall(rulebase)
def add_rule(rulebase, sec_rule, position):
if rulebase:
if not position:
rulebase.add(sec_rule)
else:
rulebase.insert(position, sec_rule)
sec_rule.create()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment