Skip to content

Example of python script to update the L7 firewall rules of a Meraki MX

License

Notifications You must be signed in to change notification settings

xaviervalette/meraki-update-l7-firewall-rules

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Meraki Update L7 Firewall (MX) rules

What is it ?

Example of python script to update the L7 firewall rules of a Meraki MX as follow :

image

Prerequisites

  • Meraki Dashboard access
  • Meraki API key
  • Meraki network ID

Get started

  1. Clone or download this repo
git clone https://github.com/xaviervalette/meraki-update-l7-firewall-rules
  1. Install required packages
python3 -m pip install -r requirements.txt
  1. Add a config.yml file as follow:
└── meraki-update-l7-firewall-rules/
+   ├── config.yml
    ├── requirements.txt
    └── src/
         └── main.py  
  1. In the config.yml file, add the following variables:
#config.yml
---
apiKey: "<yourApiKey>"
networkId: "<yourNetworkId1>"
...
  1. Now you can run the code by using the following command:
python3 src/main.py

Output

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'}}]}

About

Example of python script to update the L7 firewall rules of a Meraki MX

Topics

Resources

License

Stars

Watchers

Forks

Languages