This project provides a python wrapper for interacting with the ISE database using the Data Connect feature
- Ensure your ISE deployment is greater than 3.2, and you have appropriate licensing
- Enable the Data Connect feature, see Enable Data Connect
- Follow the appropriate process for obtaining required certificates
- For ISE 3.2, see Export Data Connect Certificate
- For ISE 3.3, see Using Admin Certificate with Data Connect
- Add the Data Connect Certificate to local Trust Store
keytool -import -alias <Name> -file <Data Connect certificate file path and name> -storetype JKS -keystore <trust store name>
- Install appropriate JDBC Runtime JAR, OJDBC11
- Install all required dependencies
pip install -r requirements.txt
- Update config.yaml file with the following
- Hostname of ISE
- Data Connect Password
- Projects Log File Directory
- Path to JAR file
- Path to Trust Store
- Trust Store Password
Config.yaml example:
ise:
hostname: 'ISE-Hostname'
port: 2484
dataconnect_password: 'dataconnect-password'
log_path: '/Absolute/File/Path'
jar_file_path: '/Absolute/JRE/Path'
trust_store_path: '/Absolute/Trust_Store/Path'
trust_store_password: 'trust-store-password'
Use by creating importing the package and creating an ISEDB object
from data_connect import ISEDB
ise = ISEDB('config.yaml')
Upon initialization the ISE DB schema will be generated
The ISE object natively provides methods for pulling data from all data connect views
For example calling the get_endpoints_data() returns:
Additionally, the query_db() method allows for any SQL query to be run against the ISE DB such as:
SELECT ENDPOINT_POLICY, MAC_ADDRESS FROM ENDPOINTS_DATA WHERE ENDPOINT_IP = '192.168.200.50'
Will return the following:
import pprint
import json
from data_connect import ISEDB
ise = ISEDB('config.yaml')
endpoints = ise.get_endpoints_data()
pprint.pprint(json.dumps(endpoints))