This is a sample script that shows the art of possible with the SecureX Dashboard API. It is meant as a sample for people who would like to create custom reports based on the SecureX dashboard tile data. This can be handy for executive reports and customer reports of Managed Security Services Partners (MSSP) for example.
Note: this is far from complete, but it merely shows how the Cisco SecureX Dashboard API works. If you make any progress with this sample, please let me know or submit a pull request.
- The script leverages the SecureX Dashboard API.
- It will grab all available tile and module information first.
- After this it will list all modules fot he user.
- It will then ask if the user wants to see the tiles for a specific module.
- After this the user is queried to see data from a specific tile.
- Clone this repository or download the ZIP file.
- Log in to https://securex.us.security.cisco.com/settings/apiClients with your Cisco Security credentials.
- Create new API keys clicking on Add API Credentials.
- Give the API Credentials a name (e.g., Dashboard Tiles Sample Script).
- Select Select All.
- Add an optional description if needed.
- Click on Add New Client.
- The Client ID and Client Secret are now shown to you. Do NOT click on close until you have copy-pasted these credentials to the config.json file in the repository.
- Make sure that the config.json file looks like this (with the right keys and IDs filled in between the quotes):
{
"client_id": "<your_client_id>",
"client_secret": "<your_client_secret>"
}
- You are now ready to execute the script. Go to a terminal and change directory to the folder that contains your dashboard_tiles.py and config.json file.
- Make sure you have the correct libraries installed by executing the requirements.txt file (use a Python virtual environment if preferred):
python3.8 -m venv securex_venv
source securex_venv/bin/activate
pip install -r requirements.txt
- Now execute the dashboard_tiles.py script:
python dashboard_tiles.py
- Follow the "CLI" that the script has built in. This is pure to show you what the SecureX Dashboard API Endpoint can do. Obviously this is not that useful in production environments. When you do make your required changes, please test well before putting into production!
- Christopher van der Made - chrivand@cisco.com (Cisco)