Skip to content

CiscoDevNet/cisco-cyber-vision-api-scripts

Repository files navigation

Cisco Cyber Vision API Scripts

This directory includes several API based scripts for Cyber Vision 4.0

It includes:

  • device.py: export devices to a CSV file ; update devices group and custom name based on the CSV data ; export list of vulnerabilities ; export list of credentials
  • group.py: export groups to a CSV file ; update groups based on the CSV data
  • preset.py: export custom presets to a CSV file ; (update is non working for the moment)
  • custom-networks.py: create, export and delete custom networks; create custom networks based on the CSV data
  • group_automation will automate things and could automatically or with several steps: - export devices to a CSV file "devices.csv" and a list of Subnets "subnet.csv"
    • create groups: automatically with group name as subnet name or manually with manual edition of the subnet.csv file
    • upload all components or devices from a csv file to update group names

All scripts are using the API v3

Nota Bene: device.py / group.py are made to be replacement for the cmdb.py script from 2017 (4 years old). First, they are expecting the user to define the groups and create them as first step. Then in a second step they can use device.py to update the groups of the device. Secondly, as the device are made of several components with various addresses, the device are updated using their ID. So the initial CSV file must be first built using a CSV export and then use device.py to update the devices.

  1. cvconfig.py file [Common] part -

1.1. the API token of the Cyber Vision center needs to be changed
1.2. if the script is not running on the center, the IP address field need to be updated to reflect the center IP address.

In order to add devices to the groups, please follow these steps :

  1. Add groups

Groups can be added manually or using the group.py script

2.1 use group.py with export option to get the csv file python3 group.py -export 2.2 Add needed groups to the CSV file then use the import option of group.py scrypt

  1. Add devices to a group

3.1 Export device list using the option export of the device.py script 3.2 Update devices group on the .csv file generated and use update option with the modified file so devices will be added to groups

  1. Update custom name on Devices

4.1 Export device list using the option export of the device.py script 4.2 On the generated file update the custom name and use update option of device.py scrypt to upload the updated file

  1. Auto-groupping options:

5.1 --export : Export subnets and devices into CSV files 5.2 --import : Push to CyberVision Center custom groups and associate devices / xomponents to subnets based on "subnet.csv" (result of the export option which could be edited by the user.) 5.3 --auto : Export subnets and devices into CSV files and push to center new group names, based on subnet names

Requirements

requirements.txt

License

This project is licensed under the Cisco Sample Code License 1.1 - see the LICENSE.md file for details

Further Links

About

Useful sample scripts for the Cisco Cyber Vision API

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages