This script searches network containers on an Infoblox Grid for networks with a given pattern in the comment, exports network addresses and comment to a csv file and creates the corresponding network objects in the Check Point database.
It can be run on any (Linux) system that is authorized to use REST API calls on both Infoblox and Check Point side.
The code is at Github:
https://github.com/dj0nz/cptools/blob/main/grid-import.sh
Usage:
- Read the documentation in the header section of the script to understand its requirements and function.
- Create text files with Check Point API key and Infoblox credentials (.netrc format). Encrypt them with gpg -c and delete unencrypted versions. Adjust $CP_API_KEY_ENC and $GRID_CREDS in the script accordingly.
- Set these parameters within the script according to your needs:
$PATTERN, $GRID_IP, $GRID_CONTAINERS, $CP_MGMT, $NET_GROUP
See comments in the script for explanation. - Run (the script)
Note: This program has been developed for a very special use case where source networks are always /24 and comment fields start with a country code. However, this can be reprogrammed with little effort.