This tool helps in taking CSV export of policies on firepower. A CSV backup of policies is usually a requirement as part of audit/compliance. However, this is not an official backup and restore option. The utility is designed to just take CSV export.
The tool is developed to address the concern of taking a CSV backup of access control policies configured on the FMC. The FMC by design supports SFO, PDF and full backup as option to take export. However, many a times there is a need to take CSV export of the policies configured on the FMC. In the current version of the tool the support is available for single domain deployments with access control policy. More details are availabe in the usage section.
Requirements for installation:
1. pip3 install fireREST
2. pip3 install netaddr
3. pip3 install datetime
4. pip3 install ipaddress
Or alternatively you can the command below to download dependencies via the requirements.txt file, this has to be executed from the downloaded script directory.
pip3 install -r ./requirements.txt
Once the dependencies are installed and the code is pulled from GitHub, it is good to go.
Below mentioned are the steps to follow in order to execute it:
In order to execute the script, run the below command:
python3 policyCSV.py
Enter the IP Address of the FMC:
Enter the username for the FMC:
Enter the password associated with the username entered:
Once the credentials are entered, the script connects to the FMC and provides the list of Access Control Policy that are available in Global Domain.
Example:
ACP available in global domain:
Name: Default
Name: Snort3
Now, the policies listed are case sensitive. Hence, while choosing the ACP which has to be exported the user can enter one of three possibilities:
Once the user choice is entered, the script executes and you will see output as shown below:
Enter the ACP Name (case sensitive) if you want specific ACP to export(multiple values should be comma seperated). By default all the ACP would be exported, press return for default behaviour: Default
Inside ACP
Writing rule #1 to CSV...
Writing rule #2 to CSV...
Writing rule #3 to CSV...
Writing rule #4 to CSV...
Writing rule #5 to CSV...
Writing rule #6 to CSV...
Writing rule #7 to CSV...
Writing rule #8 to CSV...
Writing rule #9 to CSV...
Writing rule #10 to CSV...
Writing rule #11 to CSV...
File is at: ./E00EDAC5-CFAC-0ed3-0000-253403070825.csv
Output Generated:
Currently the tool is limited to export of ACP in CSV format.
The below fields from ACP are not supported currently:
Additionally, support for multi-domains is not available yet.
If you have questions, concerns, bug reports, etc., please create an issue against this repository.
DevNet Learning Lab
Please go to the DevNet Learning Lab for Firepower Management Center (FMC) to learn how to use these scripts:
https://developer.cisco.com/learning/modules/fmc-api
DevNet Sandbox
The Sandbox which can implement this script is at: https://devnetsandbox.cisco.com/RM/Diagram/Index/1228cb22-b2ba-48d3-a70a-86a53f4eecc0?diagramType=Topology
The next version of the tool/utility will have the following items included:
This project was written and is maintained by the following individuals:
Owner
Contributors
Categories
Products
Secure FirewallProgramming Languages
PythonLicense
Code Exchange Community
Get help, share code, and collaborate with other developers in the Code Exchange community.View Community