Example of python script to update the L7 firewall rules of a Meraki MX as follow :
- Meraki Dashboard access
- Meraki API key
- Meraki network ID
- Clone or download this repo
git clone https://github.com/xaviervalette/meraki-update-l7-firewall-rules
- Install required packages
python3 -m pip install -r requirements.txt
- Add a
config.yml
file as follow:
└── meraki-update-l7-firewall-rules/
+ ├── config.yml
├── requirements.txt
└── src/
└── main.py
- In the
config.yml
file, add the following variables:
#config.yml
---
apiKey: "<yourApiKey>"
networkId: "<yourNetworkId1>"
...
- Now you can run the code by using the following command:
python3 src/main.py
The output should be as followed:
Request status code : 200
{'rules': [{'policy': 'deny', 'type': 'application', 'value': {'id': 'meraki:layer7/application/101', 'name': 'CBS Sports'}}, {'policy': 'deny', 'type': 'application', 'value': {'id': 'meraki:layer7/application/40', 'name': 'ESPN'}}, {'policy': 'deny', 'type': 'application', 'value': {'id': 'meraki:layer7/application/96', 'name': 'foxsports.com'}}]}