Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 
Julie_Paul
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
Julie_Paul
Employee
Employee

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"
Netmagic_SOC
Participant

Thanks 

0 Kudos

Leaderboard

Epsum factorial non deposit quid pro quo hic escorol.

Upcoming Events

    CheckMates Events