cancel
Showing results for 
Search instead for 
Did you mean: 
Post a Question
Employee+
Employee+

How do I add a specific rule to a specific package and section in the package via the api?

I am trying to create an automatic script that Creates the package  Example: 

  • add package name test1 access true threat-prevention true comments testcase

After that I want to create a section title in this package, I tried as an example 

  • add access-section layer "Network" package "test1" position top name "DHCP"
    • errored out on the package name

My next step was going to add a rule to the specific package in that specific section.  I was going to try the following: 

  • add access-rule package "test1" access-section "DHCP" layer "Network" position top name "rule 1" action "Accept" source "Home.123" destination "Spock" service "dhcp

I

2 Replies
Employee+
Employee+

Re: How do I add a specific rule to a specific package and section in the package via the api?

Never mind I figured it out, below is the right way to do this just in case anyone else wants to know. 

  • Create a new policy package
    • add package name test1 access true threat-prevention true comments testcase
  • Figured out what the name was of the layer in the policy package with a
    • show package "test1"
      • identified the layer name was "test1 Network"
  • Create a new section title "Dhcp" in the new policy package "test1"
    • add access-section layer "test1 Network" position top name "DHCP"
  • Add a rule at the top of the "test1" package in the section "DHCP"
    • add access-rule layer "test1 Network" position.top "DHCP" name "rule 1" action "Accept" source "Home.123" destination "Spock" service "dhcp-request"

Re: How do I add a specific rule to a specific package and section in the package via the api?

Thanks 

0 Kudos