PAN-OS - Create Or Edit EDL Rule

Creates or edits a Panorama rule and moves it into the desired position

PAN-OS by Palo Alto Networks · 15 tasks · 9 inputs · 0 outputs

Details

IDPAN-OS - Create Or Edit EDL Rule
From Version5.0.0
Tasks15

Inputs

  • device-group — The device group to work on. Exists only in panorama!
  • rule_name — The name of the rule to update, or the name of the rule that will be created.
  • log-forwarding-object-name — The server address to which to forward logs.
  • rule-position — The position of the rule in the ruleset. Valid values are: * Top * Bottom * Before * After The default is 'Bottom'
  • relative-rule-name — If the rule-position that is chosen is before or after, specify the rule name to which it is related.
  • inbound-or-outbound-rule — Determines if the rule is inbound or outbound.
  • element-to-add — the element to add to the rule
  • action-type — The action that will be defined in the rule. Valid values are: * allow * deny * drop
  • pre-post-rulebase — Determines whether the rule is a pre-rulebase or post-rulebase rule, according to the rule structure. Exists only in panorama!

Commands used

pan-os-create-rule pan-os-edit-rule pan-os-get-edl pan-os-move-rule

Flowchart

yes Inbound Outbound Inbound Outbound IP URL yes Start Start Does the rule exist? Does the rule exist? Is the rule inbound or outbound? Is the rule inbound or ou... Is the rule inbound or outbound? Is the rule inbound or ou... Add new source to the rule - pan-os-edit-rule Add new source to the rule pan-os-edit-rule Add the new destination to the rule - pan-os-edit-rule Add the new destination t... pan-os-edit-rule Create an outbound rule - pan-os-create-rule Create an outbound rule pan-os-create-rule Move the rule into its position - pan-os-move-rule Move the rule into its po... pan-os-move-rule Done Done Create an inbound rule - pan-os-create-rule Create an inbound rule pan-os-create-rule Retrieve EDL information from PAN-OS - pan-os-get-edl Retrieve EDL information ... pan-os-get-edl Check the EDL type Check the EDL type Does the rule exist? Does the rule exist? Add the new destination to the rule - pan-os-edit-rule Add the new destination t... pan-os-edit-rule Create an outbound rule - pan-os-create-rule Create an outbound rule pan-os-create-rule
id: PAN-OS - Create Or Edit EDL Rule
version: -1
fromversion: 5.0.0
name: PAN-OS - Create Or Edit EDL Rule
description: Creates or edits a Panorama rule and moves it into the desired position
starttaskid: "0"
tasks:
  "0":
    id: "0"
    taskid: e69fbe1a-056a-4929-8dbe-d535f61246e6
    type: start
    task:
      id: e69fbe1a-056a-4929-8dbe-d535f61246e6
      version: -1
      name: ""
      description: ""
      iscommand: false
      brand: ""
    nexttasks:
      '#none#':
      - "12"
    separatecontext: false
    view: |-
      {
        "position": {
          "x": 807.5,
          "y": 50
        }
      }
    note: false
    timertriggers: []
    ignoreworker: false
  "2":
    id: "2"
    taskid: f02513b5-9cd4-435b-8bc6-d326954e50db
    type: condition
    task:
      id: f02513b5-9cd4-435b-8bc6-d326954e50db
      version: -1
      name: Does the rule exist?
      description: Checks whether the rule exists
      type: condition
      iscommand: false
      brand: ""
    nexttasks:
      '#default#':
      - "4"
      "yes":
      - "3"
    separatecontext: false
    conditions:
    - label: "yes"
      condition:
      - - operator: isEqualString
          left:
            value:
              simple: Panorama.SecurityRule.Name
            iscontext: true
          right:
            value:
              simple: inputs.rule_name
            iscontext: true
    view: |-
      {
        "position": {
          "x": -90,
          "y": 590
        }
      }
    note: false
    timertriggers: []
    ignoreworker: false
  "3":
    id: "3"
    taskid: baccdbc9-eb31-4a3f-8e18-73996824ef3e
    type: condition
    task:
      id: baccdbc9-eb31-4a3f-8e18-73996824ef3e
      version: -1
      name: Is the rule inbound or outbound?
      description: Checks whether the rule is inbound or outbound based on playbook input
      type: condition
      iscommand: false
      brand: ""
    nexttasks:
      Inbound:
      - "5"
      Outbound:
      - "6"
    separatecontext: false
    conditions:
    - label: Inbound
      condition:
      - - operator: isEqualString
          left:
            value:
              simple: inputs.inbound-or-outbound-rule
            iscontext: true
          right:
            value:
              simple: inbound
    - label: Outbound
      condition:
      - - operator: isEqualString
          left:
            value:
              simple: inputs.inbound-or-outbound-rule
            iscontext: true
          right:
            value:
              simple: outbound
    view: |-
      {
        "position": {
          "x": -560,
          "y": 785
        }
      }
    note: false
    timertriggers: []
    ignoreworker: false
  "4":
    id: "4"
    taskid: f6317490-2c98-48a3-8ff8-c87e7d441343
    type: condition
    task:
      id: f6317490-2c98-48a3-8ff8-c87e7d441343
      version: -1
      name: Is the rule inbound or outbound?
      description: Checks whether the rule is inbound or outbound based on playbook input
      type: condition
      iscommand: false
      brand: ""
    nexttasks:
      Inbound:
      - "11"
      Outbound:
      - "8"
    separatecontext: false
    conditions:
    - label: Inbound
      condition:
      - - operator: isEqualString
          left:
            value:
              simple: inputs.inbound-or-outbound-rule
            iscontext: true
          right:
            value:
              simple: inbound
    - label: Outbound
      condition:
      - - operator: isEqualString
          left:
            value:
              simple: inputs.inbound-or-outbound-rule
            iscontext: true
          right:
            value:
              simple: outbound
    view: |-
      {
        "position": {
          "x": 145,
          "y": 785
        }
      }
    note: false
    timertriggers: []
    ignoreworker: false
  "5":
    id: "5"
    taskid: c206e911-4183-40d4-8b25-957d1be68dc8
    type: regular
    task:
      id: c206e911-4183-40d4-8b25-957d1be68dc8
      version: -1
      name: Add new source to the rule
      description: Add the element in the input as the new source of the rule
      script: Panorama|||pan-os-edit-rule
      type: regular
      iscommand: true
      brand: Panorama
    nexttasks:
      '#none#':
      - "9"
    scriptarguments:
      element_to_change:
        simple: source
      element_value:
        complex:
          root: inputs.element-to-add
      pre_post:
        complex:
          root: inputs.pre-post-rulebase
      rulename:
        complex:
          root: inputs.rule_name
    separatecontext: false
    view: |-
      {
        "position": {
          "x": -830,
          "y": 980
        }
      }
    note: false
    timertriggers: []
    ignoreworker: false
  "6":
    id: "6"
    taskid: cf41bad0-14d7-4937-8ffc-052e1172fd71
    type: regular
    task:
      id: cf41bad0-14d7-4937-8ffc-052e1172fd71
      version: -1
      name: Add the new destination to the rule
      description: Add the element in the input as the new destination of the rule
      script: Panorama|||pan-os-edit-rule
      type: regular
      iscommand: true
      brand: Panorama
    nexttasks:
      '#none#':
      - "9"
    scriptarguments:
      element_to_change:
        simple: destination
      element_value:
        complex:
          root: inputs.element-to-add
      pre_post:
        complex:
          root: inputs.pre-post-rulebase
      rulename:
        complex:
          root: inputs.rule_name
    separatecontext: false
    view: |-
      {
        "position": {
          "x": -370,
          "y": 980
        }
      }
    note: false
    timertriggers: []
    ignoreworker: false
  "8":
    id: "8"
    taskid: 7cd4416d-6d93-44c1-89a0-41ecacb790dc
    type: regular
    task:
      id: 7cd4416d-6d93-44c1-89a0-41ecacb790dc
      version: -1
      name: Create an outbound rule
      description: Add the element in the input as the new destination of the rule.
      script: Panorama|||pan-os-create-rule
      type: regular
      iscommand: true
      brand: Panorama
    nexttasks:
      '#none#':
      - "9"
    scriptarguments:
      action:
        complex:
          root: inputs.action-type
      application:
        simple: any
      description: {}
      destination:
        complex:
          root: inputs.element-to-add
      device-group:
        complex:
          root: inputs.device-group
      disable: {}
      log_forwarding:
        complex:
          root: inputs.log-forwarding-object-name
      negate_destination: {}
      negate_source: {}
      pre_post:
        complex:
          root: inputs.pre-post-rulebase
      rulename:
        complex:
          root: inputs.rule_name
      service: {}
      source: {}
      source_user: {}
      tags: {}
      target: {}
    separatecontext: false
    view: |-
      {
        "position": {
          "x": 80,
          "y": 980
        }
      }
    note: false
    timertriggers: []
    ignoreworker: false
  "9":
    id: "9"
    taskid: 6459dd89-b6d0-4414-8fda-0e0f83ddfe7e
    type: regular
    task:
      id: 6459dd89-b6d0-4414-8fda-0e0f83ddfe7e
      version: -1
      name: Move the rule into its position
      description: Changes the location of a policy rule.
      script: Panorama|||pan-os-move-rule
      type: regular
      iscommand: true
      brand: Panorama
    nexttasks:
      '#none#':
      - "10"
    scriptarguments:
      device-group:
        complex:
          root: inputs.device-group
      dst:
        complex:
          root: inputs.relative-rule-name
      pre_post:
        complex:
          root: inputs.pre-post-rulebase
      rulename:
        complex:
          root: inputs.rule_name
      where:
        complex:
          root: inputs.rule-position
    separatecontext: false
    view: |-
      {
        "position": {
          "x": 1040,
          "y": 1360
        }
      }
    note: false
    timertriggers: []
    ignoreworker: false
  "10":
    id: "10"
    taskid: 4cb1e4d5-8722-4b7b-825a-9742e42f8344
    type: title
    task:
      id: 4cb1e4d5-8722-4b7b-825a-9742e42f8344
      version: -1
      name: Done
      description: ""
      type: title
      iscommand: false
      brand: ""
    separatecontext: false
    view: |-
      {
        "position": {
          "x": 830,
          "y": 1590
        }
      }
    note: false
    timertriggers: []
    ignoreworker: false
  "11":
    id: "11"
    taskid: fc061f64-4bb8-4513-8b36-e3dc0d67ec0b
    type: regular
    task:
      id: fc061f64-4bb8-4513-8b36-e3dc0d67ec0b
      version: -1
      name: Create an inbound rule
      description: Add the element in the input as the new source of the rule
      script: Panorama|||pan-os-create-rule
      type: regular
      iscommand: true
      brand: Panorama
    nexttasks:
      '#none#':
      - "9"
    scriptarguments:
      action:
        complex:
          root: inputs.action-type
      application:
        simple: any
      description: {}
      destination: {}
      device-group:
        complex:
          root: inputs.device-group
      disable: {}
      log_forwarding:
        simple: ${inputs.log-forwarding-object-name}
      negate_destination: {}
      negate_source: {}
      pre_post:
        complex:
          root: inputs.pre-post-rulebase
      rulename:
        complex:
          root: inputs.rule_name
      service: {}
      source:
        complex:
          root: inputs.element-to-add
      source_user: {}
      tags: {}
      target: {}
    separatecontext: false
    view: |-
      {
        "position": {
          "x": 525,
          "y": 980
        }
      }
    note: false
    timertriggers: []
    ignoreworker: false
  "12":
    id: "12"
    taskid: b5cd7b8e-ad90-4cf5-8c6f-858becdce280
    type: regular
    task:
      id: b5cd7b8e-ad90-4cf5-8c6f-858becdce280
      version: -1
      name: Retrieve EDL information from PAN-OS
      description: Returns information for an external dynamic list
      script: '|||pan-os-get-edl'
      type: regular
      iscommand: true
      brand: ""
    nexttasks:
      '#none#':
      - "13"
    scriptarguments:
      device-group:
        simple: ${inputs.device-group}
      name:
        simple: ${inputs.element-to-add}
    separatecontext: false
    view: |-
      {
        "position": {
          "x": 807.5,
          "y": 195
        }
      }
    note: false
    timertriggers: []
    ignoreworker: false
  "13":
    id: "13"
    taskid: 3ad7d5f4-32e0-4038-8f30-664ae059fd53
    type: condition
    task:
      id: 3ad7d5f4-32e0-4038-8f30-664ae059fd53
      version: -1
      name: Check the EDL type
      description: ""
      type: condition
      iscommand: false
      brand: ""
    nexttasks:
      '#default#':
      - "10"
      IP:
      - "2"
      URL:
      - "15"
    separatecontext: false
    conditions:
    - label: URL
      condition:
      - - operator: isEqualString
          left:
            value:
              simple: Panorama.EDL.Type
            iscontext: true
          right:
            value:
              simple: url
    - label: IP
      condition:
      - - operator: isEqualString
          left:
            value:
              simple: Panorama.EDL.Type
            iscontext: true
          right:
            value:
              simple: ip
    view: |-
      {
        "position": {
          "x": 807.5,
          "y": 370
        }
      }
    note: false
    timertriggers: []
    ignoreworker: false
  "15":
    id: "15"
    taskid: c49e6cd3-ebb6-4457-8d0a-4a75a9153642
    type: condition
    task:
      id: c49e6cd3-ebb6-4457-8d0a-4a75a9153642
      version: -1
      name: Does the rule exist?
      description: Checks whether the rule exists
      type: condition
      iscommand: false
      brand: ""
    nexttasks:
      '#default#':
      - "17"
      "yes":
      - "16"
    separatecontext: false
    conditions:
    - label: "yes"
      condition:
      - - operator: isEqualString
          left:
            value:
              simple: Panorama.SecurityRule.Name
            iscontext: true
          right:
            value:
              simple: inputs.rule_name
            iscontext: true
    view: |-
      {
        "position": {
          "x": 1380,
          "y": 580
        }
      }
    note: false
    timertriggers: []
    ignoreworker: false
  "16":
    id: "16"
    taskid: 5057ec1d-d9d1-4aef-8b8c-a67e0513518e
    type: regular
    task:
      id: 5057ec1d-d9d1-4aef-8b8c-a67e0513518e
      version: -1
      name: Add the new destination to the rule
      description: Add the element in the input as the new destination of the rule
      script: Panorama|||pan-os-edit-rule
      type: regular
      iscommand: true
      brand: Panorama
    nexttasks:
      '#none#':
      - "9"
    scriptarguments:
      behaviour: {}
      element_to_change:
        simple: category
      element_value:
        complex:
          root: inputs.element-to-add
      pre_post:
        complex:
          root: inputs.pre-post-rulebase
      rulename:
        complex:
          root: inputs.rule_name
    separatecontext: false
    view: |-
      {
        "position": {
          "x": 1040,
          "y": 785
        }
      }
    note: false
    timertriggers: []
    ignoreworker: false
  "17":
    id: "17"
    taskid: 0dcb82b1-edc6-4caf-8a3a-5a81d5e68ac7
    type: regular
    task:
      id: 0dcb82b1-edc6-4caf-8a3a-5a81d5e68ac7
      version: -1
      name: Create an outbound rule
      description: Add the element in the input as the new destination of the rule.
      script: Panorama|||pan-os-create-rule
      type: regular
      iscommand: true
      brand: Panorama
    nexttasks:
      '#none#':
      - "9"
    scriptarguments:
      action:
        complex:
          root: inputs.action-type
      application:
        simple: any
      category:
        complex:
          root: inputs.element-to-add
      description: {}
      destination: {}
      device-group:
        complex:
          root: inputs.device-group
      disable: {}
      log_forwarding:
        complex:
          root: inputs.log-forwarding-object-name
      negate_destination: {}
      negate_source: {}
      pre_post:
        complex:
          root: inputs.pre-post-rulebase
      rulename:
        complex:
          root: inputs.rule_name
      service: {}
      source: {}
      source_user: {}
      tags: {}
      target: {}
    separatecontext: false
    view: |-
      {
        "position": {
          "x": 1550,
          "y": 785
        }
      }
    note: false
    timertriggers: []
    ignoreworker: false
view: |-
  {
    "linkLabelsPosition": {
      "13_10_#default#": 0.16,
      "15_16_yes": 0.64,
      "15_17_#default#": 0.57,
      "2_3_yes": 0.6,
      "2_4_#default#": 0.65,
      "3_5_Inbound": 0.52,
      "3_6_Outbound": 0.61,
      "4_8_Outbound": 0.6
    },
    "paper": {
      "dimensions": {
        "height": 1605,
        "width": 2760,
        "x": -830,
        "y": 50
      }
    }
  }
inputs:
- key: device-group
  value: {}
  required: false
  description: The device group to work on. Exists only in panorama!
- key: rule_name
  value: {}
  required: true
  description: The name of the rule to update, or the name of the rule that will be created.
- key: log-forwarding-object-name
  value: {}
  required: false
  description: The server address to which to forward logs.
- key: rule-position
  value:
    simple: bottom
  required: false
  description: |-
    The position of the rule in the ruleset. Valid values are:
      * Top
      * Bottom
      * Before
      * After

    The default is 'Bottom'
- key: relative-rule-name
  value: {}
  required: false
  description: If the rule-position that is chosen is before or after, specify the rule name to which it is related.
- key: inbound-or-outbound-rule
  value: {}
  required: false
  description: Determines if the rule is inbound or outbound.
- key: element-to-add
  value: {}
  required: true
  description: the element to add to the rule
- key: action-type
  value: {}
  required: true
  description: |-
    The action that will be defined in the rule. Valid values are:
    * allow
    * deny
    * drop
- key: pre-post-rulebase
  value: {}
  required: false
  description: Determines whether the rule is a pre-rulebase or post-rulebase rule, according to the rule structure. Exists only in panorama!
outputs: []
tests:
- No test

supportedModules:
- agentix
- xsiam