Skip to content

Maneck-UK/FMC-API-Scripts

Repository files navigation

FMC-API-Scripts

Cisco Firepower Manager API Python Scripts

This repository contains scripts written in python that interact with the Cisco Firepower Manager (FMC) API to do stuff. I am making the scripts available to say thanks to all those that helped me gain the knowledge required to get them to work.

I built and ran the scripts in notepad++ using python 3.8.2. I have used these scripts on a production environment, firstly on FMC 6.4.x and then on 6.5.x. So they work as I intended for my use, this may not always be ideal for everyone. Please test them before they are used on a production environment.

Use of these scripts is entirely at your own risk.

Scripts post-csv-hosts-070620.py creates network host objects for use in FMC policies via API POST operation set up to call the csv filename during script input e.g.:py post-csv-hosts-070620.py .csv. see sample csv file hosts2post.csv.

get-hosts-for-csv-070620.py collects all network host objects in FMC via API GET operation option 1 places the GET data in a text file and includes the Object ID which is required to delete an object .

delete-hosts-from-csv-070620.py This script deletes hosts from FMC via API DELETE operation. You need to ID the hosts by UUID, use get hosts for csv script above to collect the UUID. After removing any hosts you do not want to delete from the GET hosts file and changing the file name to .csv you will have the prerequisite file to delete all the host objects in the csv .