mikrotik-audit 1.1
Takes Mikrotik config and dumps to SmartSheet, you need a SS API and a Workspace ID
Requires Python: >=3.6

# Mikrotik Audit to Smart Sheet

## Installation

Clone the project and run the following to install to your local workstation in the same directory as the project source files.

``pip install --editable .``

This will call the setup.py file and install all the required packages as well as the CLI utility.

#### requirements

This script needs the following to run properly

* Python 3
* Webair VPN Connection

### Configuration

Once you have cloned the project and installed it to your workstation you must fill out the .env file.
Included in the project is a  file called ```.env.example.``` Rename the file as ```.env```. 

It should look similar to this

```buildoutcfg
SMARTSHEET_ACCESS_TOKEN = "{YOUR SMARTSHEET API TOKEN}"
MIKROTIK_USERNAME = "admin"
MIKROTIK_PASSWORD = "{MIKROTIK PASSWORD}"
WORKSPACE_ID = "2974111275214724"
TEMPLATE_ID = "6764832113354628"
```

The script points to a specific workspace called "Mikrotik Audit" which has a workspace ID of ``2974111275214724``, however
you can change this workspace ID to be whatever you wish. The script also points to a specific template folder with an ID of ``6764832113354628`` that houses the
reports and dashboards that are required for each client. This folder is copied each time into the new firewall folder that is being audited. Much like the workspace ID, this value can be changed.



## Running the script

Once your ``.env`` is configured, you can now run the script. You should have acccess to the following command

``mikrotik-audit``

#### Usage

basic usage of the script is as follows

``mikrotik-audit audit --firewall {FIREWALL FQDN Or IP} --client {CIDXXXX}``

The script will check to see if the workspace is empty, if it is it will create the first client folder along with the folder and
sheets for the firewall you are auditing. If the specified client matches what is already in the workspace, it will simply 
check to see if the firewall has been previously audited. If it has been, it will delete all the current sheets and create
new sheets with fresh data.

### Example Run

Here is an example of a new firewall not in the workspace

```buildoutcfg
%mikrotik-audit audit --client cid890 --firewall gns3-fw.gsc.webair.net
New Client; Creating folder.
no firewall folders for this client; creating new folder & sheets
No sheets found in folder; creating new sheets.
Dumping Interfaces and IP Addresses
Dumping Routes
Dumping Filter Rules
Dumping NAT Rules
Dumping Address lists
Dumping IPsec Phase 1
Dumping IPsec Phase 1 Profiles
Dumping IPsec phase 2
Dump has completed
----------
Client: CID890
Firwall Audited: gns3-fw.gsc.webair.net
Link: https://app.smartsheet.com/folders/HQrGmVRv7fhg9PppPXMRw5pcVFvPhX85j9vMcmM1
Total run time: 0:01:02.888635
----------
```

here is an example run of an audit run if we audit the same firewall again

```buildoutcfg
%mikrotik-audit audit --client cid890 --firewall gns3-fw.gsc.webair.net
found old firewall folder
Old sheets found; purging and creating new ones.
Dumping Interfaces and IP Addresses
Dumping Routes
Dumping Filter Rules
Dumping NAT Rules
Dumping Address lists
Dumping IPsec Phase 1
Dumping IPsec Phase 1 Profiles
Dumping IPsec phase 2
Dump has completed
----------
Client: CID890
Firwall Audited: gns3-fw.gsc.webair.net
Link: https://app.smartsheet.com/folders/HQrGmVRv7fhg9PppPXMRw5pcVFvPhX85j9vMcmM1
Total run time: 0:01:04.766957
----------
```