Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 
Joshua_Boerum
Participant
Jump to solution

Add Rule By Section Title

Im looking at add-access-rule and am a little confused on some of the documentation around position.

For position it states I can do an integer, string, or Object. Integer and string make sense as it provides examples but what is the format for Object?

Am I able to specify a section title and a position within the section?

What i'm used to:

{

  "layer" : "Network",

  "position" : "1",

  "name" : "my rule",

  "action" : "Accept",

  "source" : "User_Networks",

  "destination" : "Vendor_Networks",

  "service" : "https"

}

1 Solution

Accepted Solutions
Eugene_Grybinny
Employee Alumnus
Employee Alumnus

Hi Joshua,

Yes, you can specify the name of the rule or the section you want to add your rule relatively to. Relative position options they are: top, above, below, bottom.

Example:

{

  "position": {

    "bottom": "My section title or uid"

  }

}

Adding rule to a section specifying the number position withing the section is not supported for now.

PS Public documentation link https://sc1.checkpoint.com/documents/R80/APIs/index.html#web/add-access-rule

View solution in original post

3 Replies
Eugene_Grybinny
Employee Alumnus
Employee Alumnus

Hi Joshua,

Yes, you can specify the name of the rule or the section you want to add your rule relatively to. Relative position options they are: top, above, below, bottom.

Example:

{

  "position": {

    "bottom": "My section title or uid"

  }

}

Adding rule to a section specifying the number position withing the section is not supported for now.

PS Public documentation link https://sc1.checkpoint.com/documents/R80/APIs/index.html#web/add-access-rule

Joshua_Boerum
Participant

Hi Eugene,

Thanks for clarifying. I looked at the doc and that format was not very clear to me.

-Josh

0 Kudos
Václav_Brožík
Collaborator

By trial and error I have also figured out what is the syntax for the CLI:

mgmt add access-rule layer Network position.bottom "testsection 1"

Unfortunately the documentation lacks description how to work with lists and "sub-parameters" (like "position.bottom") in the CLI.

Edit:

Later I found that

position.bottom "testsection 1"

is just a systematic representation of this JSON code excerpt:

"position": {

    "bottom": "testsection 1"

}

This representation also handles more deeply nested structures and lists. See a useful example here: https://community.checkpoint.com/thread/4966#comment-5749

I think that this should be described in the API documentation.

0 Kudos

Leaderboard

Epsum factorial non deposit quid pro quo hic escorol.

Upcoming Events

    CheckMates Events