Skip to content

Creating security rules in a specific location within the rulebase #312

Answered by shinmog
utami1511 asked this question in Q&A
Discussion options

You must be logged in to vote

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")

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@RyanMBess
Comment options

Answer selected by utami1511
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants