superadm1n / CiscoConfigAudits

Each of the files in this repository is a script that will preform a specific audit on the configuration from a Cisco device

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CiscoConfigAudits

Each of the files in this repository is a script that will preform a specific audit on the configuration from a Cisco device. These scripts are written in python and at this point leverage the CiscoConfParse library, Cisco Automation Framework and OrionSDK as a dependencies.

All of the scripts in this repository are created with the Unix philosophy in mind to do one thing and do it well, and work together well with other programs. With that in mind that is why I created a base.py module so all of the scripts can inherit from the Base class within and that will automatically take care of some base command line arguments and handling input from a pipe.

Examples

List number of access ports on a switch:

cat config.txt | python list_access_ports.py | wc -l

Check if telnet is configured to listen on a Cisco device:

cat config.txt | python check_for_telnet.py

List out configured local users on a Cisco device

python list_local_users --config_file config.txt

Using the Scripts

Download the repository

git clone https://github.com/superadm1n/CiscoConfigAudits

Create a virtual environment

cd CiscoConfigAudits
virtuanenv -p python3 env

Install dependancies

env/bin/pip install ciscoconfparse orionsdk CiscoAutomationFramework

OPTIONAL - Activate Virtual Environment

source /env/bin/activate

Run Scripts

cd audits
python get_running_config.py 192.168.1.1 username password enablePassword | python list_local_users.py

About

Each of the files in this repository is a script that will preform a specific audit on the configuration from a Cisco device

License:MIT License


Languages

Language:Python 100.0%