I was looking for a tool to export Checkpoint Management Server database to a readable format in Excel or Html format. Checkpoint already has a great tool and KB to present a solution for this purpose:
1. Installation the Web Visualization Tool cpdb2html
Download it from the link.
Extract the file cpdb2web_B983000003_1.tgz into a folder. You will get these files in the folder:
2. Command line
C:Toolscpdb2web_B983000003_1>cpdb2html.bat ?Check Point Web Visualization Tool
Usage: cpdb2html cpdb2html_path output_directory security_management (admin_name
or certificate_file) password [-o output_file_name] [-m gateway] [-gr] [-go]
Where:
cpdb2html_path – Web Visualization Tool’s root directory.
output_directory – Path to place the result html file.
security_management – Name or IP address of the Security Management.
(for Multi-Domain Security Management the IP associated
with a Domain).
admin_name /
certificate_file – User name of a Security Management administrator, or full
path of a certificate file.
password – Administrator’s password, or certificate’s password.
-o output_file_name – HTML output file name to use
(default file name is ‘1.html’).
-m gateway_name – A specific gateway for which to generate the policy.
-gr – For Check Point Multi-Domain Security Management only.
When the -gr option is set the output will include
customer rules only (no global rules).
-go – For Check Point Multi-Domain Security Management only.
When the -go option is set the output will include
customer objects only (no global objects).
C:Toolscpdb2web_B983000003_1>cpdb2html.bat c:toolscpdb2web_B983000003_1 c:toolsoutput 192.168.2.37 admin Password1234
CUR_PATH = c:toolscpdb2web_B983000003_1
TARGET_DIR = c:toolsoutputHOST = 192.168.2.37
USERNAME = adminPASSWORD = Password1234
TEMP_DIR = “c:toolsoutputtemp”
XSLDIR = c:toolscpdb2web_B983000003_1xsl
XSLFILE = stripped_html.xsl
BASE_XML_FILE = stripped_html.xml
OUTPUT_FILE = 1.html
POLICY_NAME = standard
Connected to Security Management version 9.9.0.
Querying tables…
Processing table Communities …FinishedProcessing table FireWall Policies …FinishedProcessing table Network Objects …FinishedProcessing table Services …FinishedProcessing table Users and Administrators …Finished
0 1 file(s) copied. 1 file(s) copied.C:Toolscpdb2web_B983000003_1>
cd D:Downloadcpdb2webcpdb2html.bat d:Downloadcpdb2web d:Downloadcpdb2weboutput 10.9.2.7 admin Password1234 -o %date:~0,2%_%date:~3,2%_%date:~6,4%_%date:~11,2%_%date:~14,2%policy.html
I got output file name “10_09_2014__policy.html” when ran on Sep 10 2014. If you run this .bat file in a windows schedule task weekly as shown below, you will get an automatically backup of your policies.
3. Output in HTML and Excel
Html page will include Security Policy, Address Translation Policy, Network Objects, Users and Services.
The policy can be imported / copied into Excel for further editing.
Notes:
cpdb2html.bat d:Downloadcpdb2web d:Downloadcpdb2weboutput 10.4.2.3 admin password1234 -o %date:~0,2%_%date:~3,2%_%date:~6,4%_%date:~11,2%_%date:~14,2%TEST-Internet.html -m CP-Internet
mkdir outputtempset output_dir=D:Downloadcpdb2weboutput%date:~0,2%_%date:~3,2%_%date:~6,4%_%date:~11,2%_%date:~14,2%mkdir %output_dir%echo %output_dir%
cpdb2web -s 10.4.2.3 -u admin -p passwoed -o d:Downloadcpdb2weboutputtemp
copy D:Downloadcpdb2webxslstrip*.* D:Downloadcpdb2weboutputtempstrip*.*
cd D:Downloadcpdb2weboutputtempcopy ECOMM_Security_Policy.xml Security_Policy.xmlcopy ECOMM_Nat_Policy.xml Nat_Policy.xmlcd D:Downloadcpdb2webXalan.exe -o %output_dir%Brazil-DMZ.html “D:Downloadcpdb2weboutputtempstripped_html.xml” “D:Downloadcpdb2weboutputtempstripped_html.xsl”
cd D:Downloadcpdb2weboutputtempcopy DMZ_Security_Policy.xml Security_Policy.xmlcopy DMZ_Nat_Policy.xml Nat_Policy.xmlcd D:Downloadcpdb2webXalan.exe -o %output_dir%TEST-RAS.html “D:Downloadcpdb2weboutputtempstripped_html.xml” “D:Downloadcpdb2weboutputtempstripped_html.xsl”
copy D:Downloadcpdb2weboutputtemp*.* D:Downloadcpdb2webxslxml*.*
————————————————————————————————————
Checkpoint Management Portal Screenshots:
It can show gateways status, logs, policies and objects.