- Products
- Learn
- Local User Groups
- Partners
-
More
Celebrate the New Year
With CheckMates!
Value of Security
Vendor Self-Awareness
Join Us for CPX 360
23-24 February 2021
Important certificate update to CloudGuard Controller, CME,
and Azure HA Security Gateways
How to Remediate Endpoint & VPN
Issues (in versions E81.10 or earlier)
Mobile Security
Buyer's Guide Out Now
Important! R80 and R80.10
End Of Support around the corner (May 2021)
Export a security policy as a standard csv file.
Supports Access, NAT and Threat policies.
A python 2.7 code that demonstrate how to use the show-access/NAT/threat-rulebase api
Run rulebasecsv.py
Use -h flag for available options.
Code version 1.0.1
R80, API version 1.0
R80.10, API version 1.1
NOTICE: By using this sample code you agree to terms and conditions in this Terms and Conditions
...
Does any one have an example working syntax for exporting different policy packages. at the moment I only seem to be able to extract the current open policy?
Quoting from above:
Run rulebasecsv.py
Use -h flag for available options.
That does not help as it does not give you the option to change the rulebase.
I have found the only working Syntax to be rulebasecsv.py -o test.4 -u XXXXX -t access -p XXXXXXXX -m XX.XX.XX.XX -i Network this will pull the Standard policy only you try and specify the rulebase name you get the following output:
C:\>rulebasecsv.py -o test -u XXXXX -t access -p XXXXXXXX -m XX.XX.XX.XX -i "Phil_Test"
|--- >>> Error occured: Requested object [Phil_Test] not found. Error type: generic_err_object_not_found.
|--- Headers: {'transfer-encoding': 'chunked', '_reason': 'Not Found', '_version': 11, 'server': 'CPWS', 'x-ua-compatible': 'IE=EmulateIE8', 'date': 'Thu, 09 Aug 2018 09:54:59 GMT', 'x-frame-options': 'SAMEORIGIN', 'x-forwarded-host-port': '443', 'content-type': 'application/json', '_status': 404}
|--- Body: {u'message': u'Requested object [Phil_Test] not found', u'code': u'generic_err_object_not_found'}
Script aborted.
All objects were restored to their previous state.
it appears you can not specify specific policy packages to extract unless I am missing the syntax
You are correct, this prints the rulebases from the Standard package.
Please note that this is only an example script from 3 years ago to show management API capabilities.
If you've some Python scripting knowledge, you can add a package parameter to make it work.
If not, I can do this for you next week.
Robert.
My python skills are 0 but I will give it a go when I get five minutes no time like the present to learn.
Check out SmartConsole Extensions platform to integrate this as a web page inside SmartConsole
About CheckMates
Learn Check Point
Advanced Learning
WELCOME TO THE FUTURE OF CYBER SECURITY