Skip to main content

Check Point REST API abstraction

Project description

Check Point API



  • pip install checkpoint-api

Basic usage

  • get object
from checkpoint_api.checkpoint import CheckpointSession

with CheckpointSession("", "api", "CGx3IjUSd47TrXKh6zJ7") as cps:
    data = {'name': 'IP_10.14.1.2_xlsrv02', 'details-level': 'standard'}
    response_json ="show-host", json=data)


{'color': 'black',
 'comments': '',
 'domain': {'domain-type': 'domain',
            'name': 'SMC User',
            'uid': '41e821a0-3720-11e3-aa6e-0800200c9fde'},
 'groups': [],
 'icon': 'Objects/host',
 'interfaces': [],
 'ipv4-address': '',
 'meta-info': {'creation-time': {'iso-8601': '2020-05-27T10:26+0200',
                                 'posix': 1590567969972},
               'creator': 'user01',
               'last-modifier': 'user01',
               'last-modify-time': {'iso-8601': '2020-05-27T10:26+0200',
                                    'posix': 1590567969972},
               'lock': 'unlocked',
               'validation-state': 'ok'},
 'name': 'IP_10.14.1.2_xlsrv02',
 'nat-settings': {'auto-rule': False},
 'read-only': False,
 'tags': [],
 'type': 'host',
 'uid': '8874eceb-e217-476e-a16c-b1ec2926b921'}
  • get gateways and servers for MDS
from checkpoint_api.checkpoint import CheckpointSession
from pprint import pprint

checkpoint_username = "user01"
checkpoint_password = "toosecret"

with CheckpointSession(
) as cps:
    pprint("show-gateways-and-servers", json={"details-level": "full"}))
  • Authenticate via api_key and add new access rule
from checkpoint_api.checkpoint import CheckpointSession
import logging
from datetime import datetime

cp_firewall_policy = "PoC Network"

source_zone = "TRUST"
destination_zone = "UNTRUST"
now =
user = "userxyz"

with CheckpointSession(
    "", api_key="hc9emRAB+fECy7VJkLEIeg==", read_only=False
) as cps:
                "layer": cp_firewall_policy,
                "position": {"above": "Cleanup rule"},
                "name": f"Drop_zone_from_{source_zone}_to_{destination_zone}",
                "source": f"GRP_ZONE_{source_zone}",
                "destination": f"GRP_ZONE_{destination_zone}",
                "track": {"type": "Log"},
                "action": "Reject",
                "comments": f"{now}-{user}",

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

checkpoint_api-0.1.6-py3-none-any.whl (10.2 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page