-
Hello, I am new to pan-os-python and I would like to do create security rules within a specific location within the rulebase. rulebase = policies.Rulebase() rule_name = 'rule_1c' security_rule = policies.SecurityRule(name=rule_name, fromzone=source_zone, source=source_ip, tozone=destination_zone, destination=destination_ip, application=application, service=service, action=action, tag=tag, location=location) rulebase.add(security_rule) But it's complaining that the parameter does not exist; |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
When you create a security rule, PAN-OS is going to put it where it puts it (I think typically at the end). So you just move it into place after creating it: from panos.firewall import Firewall
from panos.policies import Rulebase, SecurityRule
fw = Firewall(host, user, passwd)
rb = Rulebase()
rule = SecurityRule(....)
fw.add(rb)
rb.add(rule)
rule.create()
rule.move("before", "other rule name here") |
Beta Was this translation helpful? Give feedback.
When you create a security rule, PAN-OS is going to put it where it puts it (I think typically at the end). So you just move it into place after creating it: