check_point.mgmt.cp_mgmt_firewall_best_practice module – Manages firewall-best-practice objects on Checkpoint over Web Services API

Note

This module is part of the check_point.mgmt collection (version 7.0.0).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install check_point.mgmt.

To use it in a playbook, specify: check_point.mgmt.cp_mgmt_firewall_best_practice.

New in check_point.mgmt 7.0.0

Synopsis

  • Manages firewall-best-practice objects on Checkpoint devices including creating, updating and removing objects.

  • All operations are performed over Web Services API.

  • Available from R82.20 management version.

Parameters

Parameter

Comments

action_item

string

To comply with Best Practice, do this action item.

auto_publish_session

boolean

Publish the current session if changes have been performed after task completes.

Choices:

  • false ← (default)

  • true

best_practice_id

string

Best Practice ID.

description

string

Description of the Best Practice.

details_level

string

The level of detail for some of the fields in the response can vary from showing only the UID value of the object to a fully detailed representation of the object.

Choices:

  • "uid"

  • "standard"

  • "full"

enabled

boolean

The activation status of the best practice.

Choices:

  • false

  • true

expiration

dictionary

Deactivation expiration settings.<br><font color=”red”>Required only if</font> enabled is set to false.

comment

string

The reason for deactivating the best practice.

expire_on

string

When the deactivation expires. Date and time represented in international ISO 8601 format. Relevant only if mode is set to ‘expire-on’.

mode

string

Whether the deactivation never expires or expires on a specific date.

Choices:

  • "never"

  • "expire-on"

ignore_errors

boolean

Apply changes ignoring errors. You won’t be able to publish such a changes. If ignore-warnings flag was omitted - warnings will also be ignored.

Choices:

  • false

  • true

ignore_warnings

boolean

Apply changes ignoring warnings.

Choices:

  • false

  • true

name

string

Best Practice Name.

policy_range_percentage

integer

The percentage of the Rule Base to scan (0-100).

policy_range_position

string

The direction of the scan.

Choices:

  • "top"

  • "bottom"

poor_condition

string

Visibility of poor-result rules in the Relevant Objects pane.

Choices:

  • "display rules that match"

  • "display rules that don't match"

  • "don't display rules"

rule

dictionary

The rule criteria the firewall best practice evaluates against the rule base. Multi-set semantics on all match-list fields except name and comment.

action

list / elements=string

Rule actions to match.

comment_condition

dictionary

Match the rule comment against a text condition.

condition_type

string

The condition type.

Choices:

  • "any"

  • "blank"

  • "not blank"

  • "starts with"

  • "equals"

  • "ends with"

  • "contains"

value

string

The condition match string. Relevant only when the value of the ‘condition-type’ parameter is, ‘Equals’, ‘Starts with’, ‘Ends with’, ‘Contains’.

destination

list / elements=string

Network objects to match in the rule Destination column. Identified by name or UID.

hit_count

list / elements=string

Hit-count levels to match.

install_on

list / elements=string

Security Gateways or Clusters the rule applies to. Identified by name or UID.

name_condition

dictionary

Match the rule name against a text condition.

condition_type

string

The condition type.

Choices:

  • "any"

  • "blank"

  • "not blank"

  • "starts with"

  • "equals"

  • "ends with"

  • "contains"

value

string

The condition match string. Relevant only when the value of the ‘condition-type’ parameter is, ‘Equals’, ‘Starts with’, ‘Ends with’, ‘Contains’.

negate_action

boolean

Shows if the action values are negated.

Choices:

  • false

  • true

negate_destination

boolean

Shows if the destination values are negated.

Choices:

  • false

  • true

negate_hit_count

boolean

Shows if the hit-count values are negated.

Choices:

  • false

  • true

negate_install_on

boolean

Shows if the install-on values are negated.

Choices:

  • false

  • true

negate_services_and_applications

boolean

Shows if the services and applications values are negated.

Choices:

  • false

  • true

negate_source

boolean

Shows if the source values are negated.

Choices:

  • false

  • true

negate_time

boolean

Shows if the time values are negated.

Choices:

  • false

  • true

negate_track

boolean

Shows if the track values are negated.

Choices:

  • false

  • true

negate_vpn

boolean

Shows if the vpn values are negated.

Choices:

  • false

  • true

services_and_applications

list / elements=string

Services, applications, categories or sites to match. Identified by name or UID.

source

list / elements=string

Network objects to match in the rule Source column. Identified by name or UID.

time

list / elements=string

Time objects the rule applies to. Identified by name or UID.

track

list / elements=string

Tracking methods to match.

vpn

list / elements=string

VPN communities to match. Identified by name or UID.

secure_condition

string

Visibility of secure-result rules in the Relevant Objects pane.

Choices:

  • "display rules that match"

  • "display rules that don't match"

  • "don't display rules"

state

string

State of the access rule (present or absent).

Choices:

  • "present" ← (default)

  • "absent"

tolerance

integer

Number of matches allowed before a violation is created. Valid values, between 0 and 100.<br><font color=”red”>Required only if</font> violation-condition is set to ‘Rule found’.

version

string

Version of checkpoint. If not given one, the latest version taken.

violation_condition

string

Define when a violation occurs, ‘Rule found’ means the criteria match a rule; ‘Rule not found’ means no rule matches.

Choices:

  • "rule found"

  • "rule not found"

wait_for_task

boolean

Wait for the task to end. Such as publish task.

Choices:

  • false

  • true ← (default)

wait_for_task_timeout

integer

How many minutes to wait until throwing a timeout error.

Default: 30

Examples

- name: add-firewall-best-practice
  cp_mgmt_firewall_best_practice:
    action_item: Define a clean-up rule at the end of the policy.
    description: Checks that the rule base ends with a clean-up rule.
    enabled: true
    name: Clean-up rule defined in Access Policy
    rule:
      action:
      - drop
      destination:
      - Any
      hit_count:
      - low
      name_condition:
        condition_type: contains
        value: cleanup
      source:
      - Any
      track:
      - log
    state: present

- name: set-firewall-best-practice
  cp_mgmt_firewall_best_practice:
    best_practice_id: FW001
    enabled: false
    expiration:
      comment: Temporarily disabled pending policy review.
      expire_on: '2026-12-31T14:30:00'
      mode: expire-on
    state: present

- name: delete-firewall-best-practice
  cp_mgmt_firewall_best_practice:
    best_practice_id: FW001
    state: absent

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

cp_mgmt_firewall_best_practice

dictionary

The checkpoint object created or updated.

Returned: always, except when deleting the object.

Authors

  • Dor Berenstein (@chkp-dorbe)