Once the Python and pip are installed open a command prompt and run the following command line:
pip install cbapi
Cbapi will be installed in the location where you have installed python. So navigate to the python folder, For example, in windows machine the default location is: C:\Python27\Scripts
Once changed the directory to C:\Python27\Scripts, run the following command line:
python cbapi-defense configure
Once the cbapi-defense is configured, it will ask for the URL to the CB Defense API server. Please find your respective backend URL using:API URL
Once entered the API URL it will prompt for Connector ID and API Key. Please find the steps below to create an API key:
Log into the CB Cloud console
Go to settings
Go to API Access
Create an API Access key
After entering the API credentials, a credential.defense file will be created in the user location, for example: C:\Users\Administrator\.carbonblack\credential.defense
Open the credentials.defense file with notepad and save as .INI file in the same location and rename the credentials.defense to credentials.psc. There should be two files as shown below:
credentials.INI
credentials.psc
Once the changes made, you should be able to run the script to retrieve the information using cbapi.
Additional Information
Note: Make sure that python and pip should be installed on the machine before installing cbapi.