eegilbert / R8x-export-import-api-scripts

Check Point R8x Export, Import, [and more] API scripts for bash and powershell

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

R8x-export-import-api-scripts

Check Point R8x Export, Import, [and more] API scripts for bash and powershell

CLI API Example for exporting, importing, and deleting different objects using CSV files (v00.29.02)

For a complete overview, review the PDF - TBD

Overview

The export, import, set, and delete using CSV files scripts in this post, currently version 00.29.02 dated 2018-06-24, are intended to allow operations on an existing R80, R80.10, R80.20 Check Point management server (SMS or MDM) from bash on the management server or a management server (Check Point Gaia OS R8X) able to authenticate and reach the target management server.

These scripts show examples of:

  • an export of objects and services with full and standard json output, and export of hosts, networks, groups, groups-with-exclusion, address-ranges, dns-domains, hosts interfaces, and group members to csv output [future services dump to csv is pending further research]
  • an export of hosts, networks, groups, groups-with-exclusion, address-ranges, dns-domains, hosts interfaces, and group members to csv output [future services dump to csv is pending further research]
  • an import of hosts, networks, groups, groups-with-exclusion, address-ranges, dns-domains, hosts interfaces, and group members from csv output generated by the export to csv operations above.
  • a set of different objects, similar to the generic import operation, based on standard file names generated by export operation
  • a script to delete groups-with-exclusion, groups, address-ranges, dns-domains, networks, hosts, using csv files created by an object name export to csv for the respective items deleted. NOTE: DANGER!, DANGER!, DANGER! Use at own risk with extreme care!
  • MDM script to document domains and output to a domains_list.txt file for reference in calls to other scripts

For direct questions, hit me up at ericb(at)checkpoint.com or lookup information on https://community.checkpoint.com CheckMates community.

NOTE: As of version 00.29.00 all cli_api*.sh scripts require "common" folder with script to handle command line parameters! Don't forget to copy this folder also.

Description

This post includes a set of script packages, which can be used independently combined. All script files end with .sh for shell and are intended for Check Point bash implementation on R80, R80.10 and R80.20 or later. Scripts in the packages have specific purposes and some scripts call sub-scripts for extensive repeated operations. The packages also include specific expected default directory folders that are not created by the script action. Template shell is also provided to generate other scripts.

NOTE: As of version 00.29.02 all export scripts default to pulling data for System (Check Point generated) and non-System (user) generated objects by default. Parameter "--SO" will enable export of System Objects while "--NSO" {default) will ignore System Objects. This applies to CSV and full JSON dump; standard JSON dump can not be limited due to lacking data to select from on that dump type.

The packages are:

  • Export, Import, Set, Delete Object : export_import.all.v00.29.02.tgz
  • Common operations handlers : common.v00.29.02.tgz
  • template for script development with command line parameter handling for the API from bash : _templates.v00.29.02.tgz

The approach to provided compressed packages was changed to facilitate quicker implementation on the management hosts.

Development folder contains the .wip versions of work in progress folders and may be updated directly for access to WORK-IN-PROGRESS (WIP) versions. WIP versions are also provided with dedicated branches.

Operations folder contains the scripts as implemented by the author on the target management hosts

About

Check Point R8x Export, Import, [and more] API scripts for bash and powershell

License:GNU General Public License v3.0


Languages

Language:Shell 99.6%Language:Batchfile 0.4%