From a34c77ee9968d6cdd21d8816a891ba864e19f3e2 Mon Sep 17 00:00:00 2001 From: Jason Moss Date: Sat, 13 Jul 2019 23:49:37 -0700 Subject: [PATCH 01/18] Began laying out coverage documentation --- Coverage.md | 230 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 230 insertions(+) create mode 100644 Coverage.md diff --git a/Coverage.md b/Coverage.md new file mode 100644 index 00000000..99548a04 --- /dev/null +++ b/Coverage.md @@ -0,0 +1,230 @@ +# API Coverage + +## API Usage + + + +- List the API requests made by an organization + - GET: *Not implemented* + +## Action batches + + + +- Create an action batch +- Return the list of action batches in the organization +- Return an action batch +- Delete an action batch +- Update an action batch + +## Admins + + + +## Alert settings + + + +## Bluetooth clients + + + +## Cameras + + + +## Clients + + + +## Config templates + + + +## Content filtering categories + + + +## Content filtering rules + + + +## Devices + + + +## Firewalled services + + + +## Group policies + + + +## HTTP servers + + + +## Intrusion settings + + + +## MR L3 firewall + + + +## MV Sense + + + +## MX 1:1 NAT rules + + + +## MX 1:Many NAT rules + + + +## MX L3 firewall + + + +## MX L7 application categories + + + +## MX L7 firewall + + + +## MX VPN firewall + + + +## MX cellular firewall + + + +## MX port forwarding rules + + + +## Malware settings + + + +## Management interface settings + + + +## Meraki auth users + + + +## Named tag scope + + + +## NetFlow settings + + + +## Networks + + + +## OpenAPI Spec + + + +## Organizations + + + +## PII + + + +## Radio settings + + + +## SAML roles + + + +## SM + + + +## SNMP settings + + + +## SSIDs + + + +## Security events + + + +## Splash login attempts + + + +## Splash settings + + + +## Static routes + + + +## Switch port schedules + + + +## Switch ports + + + +## Switch profiles + + + +## Switch settings + + + +## Switch stacks + + + +## Syslog servers + + + +## Traffic analysis settings + + + +## Traffic shaping + + + +## Uplink settings + + + +## VLANs + + + +## Webhook logs + + + +## Wireless health + + From 959aa1a15f45a56114ec7b1642af1cb96046b106 Mon Sep 17 00:00:00 2001 From: Jason Moss Date: Sat, 13 Jul 2019 23:50:16 -0700 Subject: [PATCH 02/18] Moved links from body of each section to the header --- Coverage.md | 220 +++++++++++++--------------------------------------- 1 file changed, 55 insertions(+), 165 deletions(-) diff --git a/Coverage.md b/Coverage.md index 99548a04..dcf9487d 100644 --- a/Coverage.md +++ b/Coverage.md @@ -1,15 +1,11 @@ # API Coverage -## API Usage - - +## [API Usage](https://dashboard.meraki.com/api_docs#api-usage) - List the API requests made by an organization - GET: *Not implemented* -## Action batches - - +## [Action batches](https://dashboard.meraki.com/api_docs#action-batches) - Create an action batch - Return the list of action batches in the organization @@ -17,214 +13,108 @@ - Delete an action batch - Update an action batch -## Admins - - - -## Alert settings - - - -## Bluetooth clients - - - -## Cameras - - - -## Clients - - - -## Config templates - - - -## Content filtering categories - - - -## Content filtering rules - - - -## Devices - - - -## Firewalled services - - - -## Group policies - - - -## HTTP servers - - - -## Intrusion settings - - - -## MR L3 firewall - - - -## MV Sense - - - -## MX 1:1 NAT rules - - - -## MX 1:Many NAT rules - - - -## MX L3 firewall - - - -## MX L7 application categories - - - -## MX L7 firewall - - - -## MX VPN firewall - - - -## MX cellular firewall - - - -## MX port forwarding rules - - - -## Malware settings - - - -## Management interface settings - - - -## Meraki auth users - - - -## Named tag scope - - +## [Admins](https://dashboard.meraki.com/api_docs#admins) -## NetFlow settings +## [Alert settings](https://dashboard.meraki.com/api_docs#alert-settings) - +## [Bluetooth clients](https://dashboard.meraki.com/api_docs#bluetooth-clients) -## Networks +## [Cameras](https://dashboard.meraki.com/api_docs#cameras) - +## [Clients](https://dashboard.meraki.com/api_docs#clients) -## OpenAPI Spec +## [Config templates](https://dashboard.meraki.com/api_docs#config-templates) - +## [Content filtering categories](https://dashboard.meraki.com/api_docs#content-filtering-categories) -## Organizations +## [Content filtering rules](https://dashboard.meraki.com/api_docs#content-filtering-rules) - +## [Devices](https://dashboard.meraki.com/api_docs#devices) -## PII +## [Firewalled services](https://dashboard.meraki.com/api_docs#firewalled-services) - +## [Group policies](https://dashboard.meraki.com/api_docs#group-policies) -## Radio settings +## [HTTP servers](https://dashboard.meraki.com/api_docs#http-servers) - +## [Intrusion settings](https://dashboard.meraki.com/api_docs#intrusion-settings) -## SAML roles +## [MR L3 firewall](https://dashboard.meraki.com/api_docs#mr-l3-firewall) - +## [MV Sense](https://dashboard.meraki.com/api_docs#mv-sense) -## SM +## [MX 1:1 NAT rules](https://dashboard.meraki.com/api_docs#mx-1:1-nat-rules) - +## [MX 1:Many NAT rules](https://dashboard.meraki.com/api_docs#mx-1:many-nat-rules) -## SNMP settings +## [MX L3 firewall](https://dashboard.meraki.com/api_docs#mx-l3-firewall) - +## [MX L7 application categories](https://dashboard.meraki.com/api_docs#mx-l7-application-categories) -## SSIDs +## [MX L7 firewall](https://dashboard.meraki.com/api_docs#mx-l7-firewall) - +## [MX VPN firewall](https://dashboard.meraki.com/api_docs#mx-vpn-firewall) -## Security events +## [MX cellular firewall](https://dashboard.meraki.com/api_docs#mx-cellular-firewall) - +## [MX port forwarding rules](https://dashboard.meraki.com/api_docs#mx-port-forwarding-rules) -## Splash login attempts +## [Malware settings](https://dashboard.meraki.com/api_docs#malware-settings) - +## [Management interface settings](https://dashboard.meraki.com/api_docs#management-interface-settings) -## Splash settings +## [Meraki auth users](https://dashboard.meraki.com/api_docs#meraki-auth-users) - +## [Named tag scope](https://dashboard.meraki.com/api_docs#named-tag-scope) -## Static routes +## [NetFlow settings](https://dashboard.meraki.com/api_docs#netflow-settings) - +## [Networks](https://dashboard.meraki.com/api_docs#networks) -## Switch port schedules +## [OpenAPI Spec](https://dashboard.meraki.com/api_docs#openapi-spec) - +## [Organizations](https://dashboard.meraki.com/api_docs#organizations) -## Switch ports +## [PII](https://dashboard.meraki.com/api_docs#pii) - +## [Radio settings](https://dashboard.meraki.com/api_docs#radio-settings) -## Switch profiles +## [SAML roles](https://dashboard.meraki.com/api_docs#saml-roles) - +## [SM](https://dashboard.meraki.com/api_docs#sm) -## Switch settings +## [SNMP settings](https://dashboard.meraki.com/api_docs#snmp-settings) - +## [SSIDs](https://dashboard.meraki.com/api_docs#ssids) -## Switch stacks +## [Security events](https://dashboard.meraki.com/api_docs#security-events) - +## [Splash login attempts](https://dashboard.meraki.com/api_docs#splash-login-attempts) -## Syslog servers +## [Splash settings](https://dashboard.meraki.com/api_docs#splash-settings) - +## [Static routes](https://dashboard.meraki.com/api_docs#static-routes) -## Traffic analysis settings +## [Switch port schedules](https://dashboard.meraki.com/api_docs#switch-port-schedules) - +## [Switch ports](https://dashboard.meraki.com/api_docs#switch-ports) -## Traffic shaping +## [Switch profiles](https://dashboard.meraki.com/api_docs#switch-profiles) - +## [Switch settings](https://dashboard.meraki.com/api_docs#switch-settings) -## Uplink settings +## [Switch stacks](https://dashboard.meraki.com/api_docs#switch-stacks) - +## [Syslog servers](https://dashboard.meraki.com/api_docs#syslog-servers) -## VLANs +## [Traffic analysis settings](https://dashboard.meraki.com/api_docs#traffic-analysis-settings) - +## [Traffic shaping](https://dashboard.meraki.com/api_docs#traffic-shaping) -## Webhook logs +## [Uplink settings](https://dashboard.meraki.com/api_docs#uplink-settings) - +## [VLANs](https://dashboard.meraki.com/api_docs#vlans) -## Wireless health +## [Webhook logs](https://dashboard.meraki.com/api_docs#webhook-logs) - +## [Wireless health](https://dashboard.meraki.com/api_docs#wireless-health) From 61e082889921bec48a1bcd938896a0ca6b618158 Mon Sep 17 00:00:00 2001 From: Jason Moss Date: Sun, 14 Jul 2019 00:04:27 -0700 Subject: [PATCH 03/18] List out possible API actions --- Coverage.md | 294 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 294 insertions(+) diff --git a/Coverage.md b/Coverage.md index dcf9487d..0d1b99bd 100644 --- a/Coverage.md +++ b/Coverage.md @@ -15,106 +15,400 @@ ## [Admins](https://dashboard.meraki.com/api_docs#admins) +- List the dashboard administrators in this organization +- Create a new dashboard administrator +- Update an administrator +- Revoke all access for a dashboard administrator within this organization + ## [Alert settings](https://dashboard.meraki.com/api_docs#alert-settings) +- Return the alert configuration for this network +- Update the alert configuration for this network + ## [Bluetooth clients](https://dashboard.meraki.com/api_docs#bluetooth-clients) +- Return a Bluetooth client. Bluetooth clients can be identified by their ID or their MAC. +- List the Bluetooth clients seen by APs in this network + ## [Cameras](https://dashboard.meraki.com/api_docs#cameras) +- Returns video link for the specified camera. If a timestamp supplied, it links to that time. +- Generate a snapshot of what the camera sees at the specified time and return a link to that image. + ## [Clients](https://dashboard.meraki.com/api_docs#clients) +- Return the client associated with the given identifier. +- Provisions a client with a name and policy. +- Return the client's daily usage history. +- Return the policy assigned to a client on the network. +- Update the policy assigned to a client on the network. +- Return the splash authorization for a client, for each SSID they've associated with through splash. +- Update a client's splash authorization. +- List the clients that have used this network in the timespan +- List the clients of a device, up to a maximum of a month ago. +- Return the client's network traffic data over time. +- Return the events associated with this client. +- Return the latency history for a client. + ## [Config templates](https://dashboard.meraki.com/api_docs#config-templates) +- List the configuration templates for this organization +- Remove a configuration template + ## [Content filtering categories](https://dashboard.meraki.com/api_docs#content-filtering-categories) +- List all available content filtering categories for an MX network + ## [Content filtering rules](https://dashboard.meraki.com/api_docs#content-filtering-rules) +- Return the content filtering settings for an MX network +- Update the content filtering settings for an MX network + ## [Devices](https://dashboard.meraki.com/api_docs#devices) +- List LLDP and CDP information for a device +- List the devices in an organization +- List the devices in a network +- Return a single device +- Return the performance score for a single device. +- Return the uplink information for a device. +- Update the attributes of a device +- Claim a device into a network +- Remove a single device +- Get the uplink loss percentage and latency in milliseconds for a wired network device. +- Reboot a device +- Blink the LEDs on a device + ## [Firewalled services](https://dashboard.meraki.com/api_docs#firewalled-services) +- List the appliance services and their accessibility rules +- Return the accessibility settings of the given service ('ICMP', 'web', or 'SNMP') +- Updates the accessibility settings for the given service ('ICMP', 'web', or 'SNMP') + ## [Group policies](https://dashboard.meraki.com/api_docs#group-policies) +- List the group policies in a network +- Create a group policy +- Display a group policy +- Update a group policy +- Delete a group policy + ## [HTTP servers](https://dashboard.meraki.com/api_docs#http-servers) +- List the HTTP servers for a network +- Return an HTTP server for a network +- Update an HTTP server +- Add an HTTP server to a network +- Delete an HTTP server from a network +- Send a test webhook for a network +- Return the status of a webhook test for a network + ## [Intrusion settings](https://dashboard.meraki.com/api_docs#intrusion-settings) +- Returns all supported intrusion settings for an MX network +- Set the supported intrusion settings for an MX network +- Returns all supported intrusion settings for an organization +- Sets supported intrusion settings for an organization + ## [MR L3 firewall](https://dashboard.meraki.com/api_docs#mr-l3-firewall) +- Return the L3 firewall rules for an SSID on an MR network +- Update the L3 firewall rules of an SSID on an MR network + ## [MV Sense](https://dashboard.meraki.com/api_docs#mv-sense) +- Returns an overview of aggregate analytics data for a timespan +- Returns all configured analytic zones for this camera +- Return historical records for analytic zones +- Returns most recent record for analytics zones +- Returns live state from camera of analytics zones + ## [MX 1:1 NAT rules](https://dashboard.meraki.com/api_docs#mx-1:1-nat-rules) +- Return the 1:1 NAT mapping rules for an MX network +- Set the 1:1 NAT mapping rules for an MX network + ## [MX 1:Many NAT rules](https://dashboard.meraki.com/api_docs#mx-1:many-nat-rules) +- Return the 1:Many NAT mapping rules for an MX network +- Set the 1:Many NAT mapping rules for an MX network + ## [MX L3 firewall](https://dashboard.meraki.com/api_docs#mx-l3-firewall) +- Return the L3 firewall rules for an MX network +- Update the L3 firewall rules of an MX network + ## [MX L7 application categories](https://dashboard.meraki.com/api_docs#mx-l7-application-categories) +- Return the L7 firewall application categories and their associated applications for an MX network + ## [MX L7 firewall](https://dashboard.meraki.com/api_docs#mx-l7-firewall) +- List the MX L7 firewall rules for an MX network +- Update the MX L7 firewall rules for an MX network + ## [MX VPN firewall](https://dashboard.meraki.com/api_docs#mx-vpn-firewall) +- Return the firewall rules for an organization's site-to-site VPN +- Update the firewall rules of an organization's site-to-site VPN + ## [MX cellular firewall](https://dashboard.meraki.com/api_docs#mx-cellular-firewall) +- Return the cellular firewall rules for an MX network +- Update the cellular firewall rules of an MX network + ## [MX port forwarding rules](https://dashboard.meraki.com/api_docs#mx-port-forwarding-rules) +- Return the port forwarding rules for an MX network +- Update the port forwarding rules for an MX network + ## [Malware settings](https://dashboard.meraki.com/api_docs#malware-settings) +- Returns all supported malware settings for an MX network +- Set the supported malware settings for an MX network + ## [Management interface settings](https://dashboard.meraki.com/api_docs#management-interface-settings) +- Return the management interface settings for a device +- Update the management interface settings for a device + ## [Meraki auth users](https://dashboard.meraki.com/api_docs#meraki-auth-users) +- List the splash or RADIUS users configured under Meraki Authentication for a network +- Return the Meraki Auth splash or RADIUS user + ## [Named tag scope](https://dashboard.meraki.com/api_docs#named-tag-scope) +- List the target groups in this network +- Return a target group +- Update a target group +- Add a target group +- Delete a target group from a network + ## [NetFlow settings](https://dashboard.meraki.com/api_docs#netflow-settings) +- Return the NetFlow traffic reporting settings for a network +- Update the NetFlow traffic reporting settings for a network + ## [Networks](https://dashboard.meraki.com/api_docs#networks) +- Return the Bluetooth settings for a network. +- Update the Bluetooth settings for a network. +- List the networks in an organization +- Return a network +- Update a network +- Create a network +- Delete a network +- Bind a network to a template. +- Unbind a network from a template. +- The traffic analysis data for this network. +- List the access policies for this network. +- List Air Marshal scan results from a network +- Combine multiple networks into a single network +- Split a combined network into individual networks for each type of device +- Return the site-to-site VPN settings of a network. +- Update the site-to-site VPN settings of a network. + ## [OpenAPI Spec](https://dashboard.meraki.com/api_docs#openapi-spec) +- Return the OpenAPI 2.0 Specification of the organization's API documentation in JSON + ## [Organizations](https://dashboard.meraki.com/api_docs#organizations) +- List the organizations that the user has privileges on +- Return an organization +- Update an organization +- Create a new organization +- Create a new organization by cloning the addressed organization +- Return the license state for an organization +- Return the inventory for an organization +- List the status of every Meraki device in the organization +- Delete an organization +- Claim a device, license key, or order into an organization. +- Return the uplink loss and latency for every MX in the organization from at latest 2 minutes ago +- Return the third party VPN peers for an organization +- Update the third party VPN peers for an organization + ## [PII](https://dashboard.meraki.com/api_docs#pii) +- List the keys required to access Personally Identifiable Information (PII) for a given identifier. +- Given a piece of Personally Identifiable Information (PII), return the Systems Manager device ID(s) associated with that identifier. +- Given a piece of Personally Identifiable Information (PII), return the Systems Manager owner ID(s) associated with that identifier. +- List the PII requests for this network or organization +- Return a PII request +- Submit a new delete or restrict processing PII request +- Delete a restrict processing PII request + ## [Radio settings](https://dashboard.meraki.com/api_docs#radio-settings) +- Return the radio settings of a device +- Update the radio settings of a device +- List the non-basic RF profiles for this network + ## [SAML roles](https://dashboard.meraki.com/api_docs#saml-roles) +- List the SAML roles for this organization +- Return a SAML role +- Update a SAML role +- Create a SAML role +- Remove a SAML role + ## [SM](https://dashboard.meraki.com/api_docs#sm) +- Create a new profile containing a Cisco Clarity payload +- Update an existing profile containing a Cisco Clarity payload +- Add a Cisco Clarity payload to an existing profile +- Get details for a Cisco Clarity payload +- Delete a Cisco Clarity payload. +- Create a new profile containing a Cisco Umbrella payload +- Update an existing profile containing a Cisco Umbrella payload +- Add a Cisco Umbrella payload to an existing profile +- Get details for a Cisco Umbrella payload +- Delete a Cisco Umbrella payload. +- Create a new Polaris app +- Update an existing Polaris app +- Get details for a Cisco Polaris app if it exists +- Delete a Cisco Polaris app +- Return historical records of various Systems Manager client metrics for desktop devices. +- Return historical records of various Systems Manager network connection details for desktop devices. +- Return historical records of commands sent to Systems Manager devices. +- Returns historical connectivity data (whether a device is regularly checking in to Dashboard). +- List the devices enrolled in an SM network with various specified fields and filters +- List the owners in an SM network with various specified fields and filters +- Get the profiles associated with a user +- Get the profiles associated with a device +- Get a list of softwares associated with a user +- Get a list of softwares associated with a device +- List the network adapters of a device +- List the saved SSID names on a device +- List the security centers on a device +- List the restrictions on a device +- List the certs on a device +- Add, delete, or update the tags of a set of devices +- Modify the fields of a device +- Lock a set of devices +- Wipe a device +- Force check-in a set of devices +- Move a set of devices to a new network +- Unenroll a device +- Bypass activation lock attempt +- Bypass activation lock attempt status +- List all the profiles in the network +- Return the client's daily cellular data usage history. + ## [SNMP settings](https://dashboard.meraki.com/api_docs#snmp-settings) +- Return the SNMP settings for a network +- Update the SNMP settings for a network +- Return the SNMP settings for an organization +- Update the SNMP settings for an organization + ## [SSIDs](https://dashboard.meraki.com/api_docs#ssids) +- List the SSIDs in a network. Supports networks with access points or wireless-enabled security appliances and teleworker gateways. +- Return a single SSID +- Update the attributes of an SSID + ## [Security events](https://dashboard.meraki.com/api_docs#security-events) +- List the security events for a client. +- List the security events for a network +- List the security events for an organization + ## [Splash login attempts](https://dashboard.meraki.com/api_docs#splash-login-attempts) +- List the splash login attempts for a network + ## [Splash settings](https://dashboard.meraki.com/api_docs#splash-settings) +- Display the splash page settings for the given SSID +- Modify the splash page settings for the given SSID + ## [Static routes](https://dashboard.meraki.com/api_docs#static-routes) +- List the static routes for this network +- Return a static route +- Update a static route +- Add a static route +- Delete a static route from a network + ## [Switch port schedules](https://dashboard.meraki.com/api_docs#switch-port-schedules) +- List switch port schedules + ## [Switch ports](https://dashboard.meraki.com/api_docs#switch-ports) +- List the switch ports for a switch +- Return a switch port +- Update a switch port + ## [Switch profiles](https://dashboard.meraki.com/api_docs#switch-profiles) +- List the switch profiles for your switch template configuration + ## [Switch settings](https://dashboard.meraki.com/api_docs#switch-settings) +- Returns the switch network settings +- Update switch network settings + ## [Switch stacks](https://dashboard.meraki.com/api_docs#switch-stacks) +- List the switch stacks in a network +- Show a switch stack +- Add a switch to a stack +- Remove a switch from a stack +- Create a stack +- Delete a stack + ## [Syslog servers](https://dashboard.meraki.com/api_docs#syslog-servers) +- List the syslog servers for a network +- Update the syslog servers for a network + ## [Traffic analysis settings](https://dashboard.meraki.com/api_docs#traffic-analysis-settings) +- Return the traffic analysis settings for a network +- Update the traffic analysis settings for a network + ## [Traffic shaping](https://dashboard.meraki.com/api_docs#traffic-shaping) +- Update the traffic shaping settings for an MX network +- Display the traffic shaping settings for an MX network +- Update the traffic shaping settings for an SSID on an MR network +- Display the traffic shaping settings for a SSID on an MR network +- Returns the available DSCP tagging options for your traffic shaping rules. +- Returns the application categories for traffic shaping rules. + ## [Uplink settings](https://dashboard.meraki.com/api_docs#uplink-settings) +- Returns the uplink settings for your MX network. +- Updates the uplink settings for your MX network. + ## [VLANs](https://dashboard.meraki.com/api_docs#vlans) +- List the VLANs for an MX network +- Return a VLAN +- Update a VLAN +- Add a VLAN +- Delete a VLAN from a network +- Returns the enabled status of VLANs for the network +- Enable/Disable VLANs for the given network + ## [Webhook logs](https://dashboard.meraki.com/api_docs#webhook-logs) +- Return the log of webhook POSTs sent + ## [Wireless health](https://dashboard.meraki.com/api_docs#wireless-health) + +- Aggregated connectivity info for this network +- Aggregated connectivity info for this network, grouped by node +- Aggregated connectivity info for a given AP on this network +- Aggregated connectivity info for this network, grouped by clients +- Aggregated connectivity info for a given client on this network. +- Aggregated latency info for this network +- Aggregated latency info for this network, grouped by node +- Aggregated latency info for a given AP on this network +- Aggregated latency info for this network, grouped by clients +- Aggregated latency info for a given client on this network. +- List of all failed client connection events on this network in a given time range + \ No newline at end of file From 5e617437c871dbefeb5ee68d4ff119fea22c8191 Mon Sep 17 00:00:00 2001 From: Jason Moss Date: Sun, 14 Jul 2019 00:06:36 -0700 Subject: [PATCH 04/18] Added function mapping for Admins section --- Coverage.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Coverage.md b/Coverage.md index 0d1b99bd..d9054564 100644 --- a/Coverage.md +++ b/Coverage.md @@ -3,7 +3,7 @@ ## [API Usage](https://dashboard.meraki.com/api_docs#api-usage) - List the API requests made by an organization - - GET: *Not implemented* + - *Not implemented* ## [Action batches](https://dashboard.meraki.com/api_docs#action-batches) @@ -16,9 +16,13 @@ ## [Admins](https://dashboard.meraki.com/api_docs#admins) - List the dashboard administrators in this organization + - getorgadmins - Create a new dashboard administrator + - addadmin - Update an administrator + - updateadmin - Revoke all access for a dashboard administrator within this organization + - deladmin ## [Alert settings](https://dashboard.meraki.com/api_docs#alert-settings) From eaf74f72f66e0f0e708b9d361524a3c8bef974ee Mon Sep 17 00:00:00 2001 From: Jason Moss Date: Sun, 14 Jul 2019 00:21:49 -0700 Subject: [PATCH 05/18] Filled out the remaining function maps --- Coverage.md | 85 +++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 83 insertions(+), 2 deletions(-) diff --git a/Coverage.md b/Coverage.md index d9054564..081afe5a 100644 --- a/Coverage.md +++ b/Coverage.md @@ -42,14 +42,20 @@ ## [Clients](https://dashboard.meraki.com/api_docs#clients) - Return the client associated with the given identifier. + - getclient - Provisions a client with a name and policy. - Return the client's daily usage history. - Return the policy assigned to a client on the network. + - getclientpolicy - Update the policy assigned to a client on the network. + - updateclientpolicy - Return the splash authorization for a client, for each SSID they've associated with through splash. -- Update a client's splash authorization. + - getclientsplash +- Update a client's splash authorization. + - updateclientsplash - List the clients that have used this network in the timespan - List the clients of a device, up to a maximum of a month ago. + - getclients - Return the client's network traffic data over time. - Return the events associated with this client. - Return the latency history for a client. @@ -57,7 +63,9 @@ ## [Config templates](https://dashboard.meraki.com/api_docs#config-templates) - List the configuration templates for this organization + - gettemplates - Remove a configuration template + - deltemplate ## [Content filtering categories](https://dashboard.meraki.com/api_docs#content-filtering-categories) @@ -71,14 +79,22 @@ ## [Devices](https://dashboard.meraki.com/api_docs#devices) - List LLDP and CDP information for a device + - getlldpcdp - List the devices in an organization - List the devices in a network + - getnetworkdevices - Return a single device + - getdevicedetail - Return the performance score for a single device. + - getmxperf - Return the uplink information for a device. + - getdeviceuplink - Update the attributes of a device + - updatedevice - Claim a device into a network + - adddevtonet - Remove a single device + - removedevfromnet - Get the uplink loss percentage and latency in milliseconds for a wired network device. - Reboot a device - Blink the LEDs on a device @@ -92,6 +108,7 @@ ## [Group policies](https://dashboard.meraki.com/api_docs#group-policies) - List the group policies in a network + - getgrouppolicies - Create a group policy - Display a group policy - Update a group policy @@ -117,7 +134,9 @@ ## [MR L3 firewall](https://dashboard.meraki.com/api_docs#mr-l3-firewall) - Return the L3 firewall rules for an SSID on an MR network + - getssidl3fwrules - Update the L3 firewall rules of an SSID on an MR network + - updatessidl3fwrules ## [MV Sense](https://dashboard.meraki.com/api_docs#mv-sense) @@ -140,7 +159,9 @@ ## [MX L3 firewall](https://dashboard.meraki.com/api_docs#mx-l3-firewall) - Return the L3 firewall rules for an MX network + - getmxl3fwrules - Update the L3 firewall rules of an MX network + - updatemxl3fwrules ## [MX L7 application categories](https://dashboard.meraki.com/api_docs#mx-l7-application-categories) @@ -154,12 +175,16 @@ ## [MX VPN firewall](https://dashboard.meraki.com/api_docs#mx-vpn-firewall) - Return the firewall rules for an organization's site-to-site VPN + - getmxvpnfwrules - Update the firewall rules of an organization's site-to-site VPN + - updatemxvpnfwrules ## [MX cellular firewall](https://dashboard.meraki.com/api_docs#mx-cellular-firewall) - Return the cellular firewall rules for an MX network + - getmxcellularfwrules - Update the cellular firewall rules of an MX network + - updatemxcellularfwrules ## [MX port forwarding rules](https://dashboard.meraki.com/api_docs#mx-port-forwarding-rules) @@ -197,21 +222,35 @@ ## [Networks](https://dashboard.meraki.com/api_docs#networks) - Return the Bluetooth settings for a network. + - getbluetooth - Update the Bluetooth settings for a network. + - updatebluetooth - List the networks in an organization + - getnetworklist - Return a network + - getnetworkdetail - Update a network + - updatenetwork - Create a network + - addnetwork - Delete a network + - delnetwork - Bind a network to a template. + - bindtotemplate - Unbind a network from a template. + - unbindfromtemplate - The traffic analysis data for this network. + - getnetworktrafficstats - List the access policies for this network. + - getaccesspolicies - List Air Marshal scan results from a network + - getairmarshal - Combine multiple networks into a single network - Split a combined network into individual networks for each type of device - Return the site-to-site VPN settings of a network. + - getvpnsettings - Update the site-to-site VPN settings of a network. + - updatevpnsettings ## [OpenAPI Spec](https://dashboard.meraki.com/api_docs#openapi-spec) @@ -220,19 +259,31 @@ ## [Organizations](https://dashboard.meraki.com/api_docs#organizations) - List the organizations that the user has privileges on + - myorgaccess - Return an organization + - getorg - Update an organization + - renameorg - Create a new organization + - addorg - Create a new organization by cloning the addressed organization + - cloneorg - Return the license state for an organization + - getlicensestate - Return the inventory for an organization + - getorginventory - List the status of every Meraki device in the organization + - get_device_statuses - Delete an organization - Claim a device, license key, or order into an organization. + - claim - Return the uplink loss and latency for every MX in the organization from at latest 2 minutes ago - Return the third party VPN peers for an organization + - getnonmerakivpnpeers - Update the third party VPN peers for an organization - + - updatenonmerakivpn + - appendnonmerakivpn + ## [PII](https://dashboard.meraki.com/api_docs#pii) - List the keys required to access Personally Identifiable Information (PII) for a given identifier. @@ -252,10 +303,15 @@ ## [SAML roles](https://dashboard.meraki.com/api_docs#saml-roles) - List the SAML roles for this organization + - getsamlroles - Return a SAML role + - getsamlroledetail - Update a SAML role + - updatesamlrole - Create a SAML role + - addsamlrole - Remove a SAML role + - delsamlrole ## [SM](https://dashboard.meraki.com/api_docs#sm) @@ -278,6 +334,7 @@ - Return historical records of commands sent to Systems Manager devices. - Returns historical connectivity data (whether a device is regularly checking in to Dashboard). - List the devices enrolled in an SM network with various specified fields and filters + - getsmdevices - List the owners in an SM network with various specified fields and filters - Get the profiles associated with a user - Get the profiles associated with a device @@ -289,11 +346,17 @@ - List the restrictions on a device - List the certs on a device - Add, delete, or update the tags of a set of devices + - updatesmtags - Modify the fields of a device + - updatesmfields - Lock a set of devices + - lockdevices - Wipe a device + - wipedevices - Force check-in a set of devices + - checkindevices - Move a set of devices to a new network + - movedevices - Unenroll a device - Bypass activation lock attempt - Bypass activation lock attempt status @@ -305,13 +368,18 @@ - Return the SNMP settings for a network - Update the SNMP settings for a network - Return the SNMP settings for an organization + - getsnmpsettings - Update the SNMP settings for an organization + - updatesnmpsettings ## [SSIDs](https://dashboard.meraki.com/api_docs#ssids) - List the SSIDs in a network. Supports networks with access points or wireless-enabled security appliances and teleworker gateways. - Return a single SSID + - getssiddetail - Update the attributes of an SSID + - updatessid + - updatessidobject ## [Security events](https://dashboard.meraki.com/api_docs#security-events) @@ -331,10 +399,15 @@ ## [Static routes](https://dashboard.meraki.com/api_docs#static-routes) - List the static routes for this network + - getstaticroutes - Return a static route + - getstaticroutedetail - Update a static route + - updatestaticroute - Add a static route + - addstaticroute - Delete a static route from a network + - delstaticroute ## [Switch port schedules](https://dashboard.meraki.com/api_docs#switch-port-schedules) @@ -343,8 +416,11 @@ ## [Switch ports](https://dashboard.meraki.com/api_docs#switch-ports) - List the switch ports for a switch + - getswitchports - Return a switch port + - getswitchportdetail - Update a switch port + - updateswitchport ## [Switch profiles](https://dashboard.meraki.com/api_docs#switch-profiles) @@ -391,10 +467,15 @@ ## [VLANs](https://dashboard.meraki.com/api_docs#vlans) - List the VLANs for an MX network + - getvlans - Return a VLAN + - getvlandetail - Update a VLAN + - updatevlan - Add a VLAN + - addvlan - Delete a VLAN from a network + - delvlan - Returns the enabled status of VLANs for the network - Enable/Disable VLANs for the given network From 60735d8e24aa46c8702d0099e4ddbdacf1b9b51b Mon Sep 17 00:00:00 2001 From: Jason Moss Date: Sun, 14 Jul 2019 00:23:15 -0700 Subject: [PATCH 06/18] Fixed markdownlint warnings --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ce624f50..e4f63658 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,11 @@ +# Meraki Dashboard API + Python 3.6 module providing all current Meraki [Dashboard API](https://dashboard.meraki.com/api_docs) calls to interface with the Cisco Meraki cloud-managed IT solutions. Also available via [PIP](https://pypi.python.org/pypi/meraki/). - ## Initial Setup -* Enable APIs in your Meraki dashboard and obtain an APIKey: [Instructions](https://documentation.meraki.com/zGeneral_Administration/Other_Topics/The_Cisco_Meraki_Dashboard_API) + +* Enable APIs in your Meraki dashboard and obtain an APIKey: [Instructions](https://documentation.meraki.com/zGeneral_Administration/Other_Topics/The_Cisco_Meraki_Dashboard_API) * Keep your APIKey safe and secure. It is similar to a password for your dashboard. If publishing your Python programs to a wider audience, please research secure handling of APIKeys. * Although the Meraki API can be accessed in various ways, this module uses Python3. [Get started with Python](https://wiki.python.org/moin/BeginnersGuide/NonProgrammers) * After Python is installed, prepare your environment: From f4a3b69c48334bc46a20a3e9e567e96b3a5db2d6 Mon Sep 17 00:00:00 2001 From: Jason Moss Date: Sun, 14 Jul 2019 18:22:21 -0700 Subject: [PATCH 07/18] Network specific intrusion settings get/update --- meraki.py | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/meraki.py b/meraki.py index ff70d6aa..dc45d35b 100644 --- a/meraki.py +++ b/meraki.py @@ -1711,6 +1711,50 @@ def getlldpcdp(apikey, networkid, serial, timespan=10800, suppressprint=False): dashboard.status_code, dashboard.text, calltype, suppressprint) return result +# ### Intrusion settings ### + +# Returns all supported intrusion settings for an MX network +# https://dashboard.meraki.com/api_docs#returns-all-supported-intrusion-settings-for-an-mx-network +def getmxintrusionsettings(apikey, networkid, suppressprint=False): + calltype = 'MX Intrusion Settings' + geturl = '{0}/networks/{1}/security/intrusionSettings'.format( + str(base_url), str(networkid)) + headers = { + 'x-cisco-meraki-api-key': format(str(apikey)), + 'Content-Type': 'application/json' + } + dashboard = requests.get(geturl, headers=headers) + result = __returnhandler( + dashboard.status_code, dashboard.text, calltype, suppressprint) + return result + +# Set the supported intrusion settings for an MX network +# https://dashboard.meraki.com/api_docs#set-the-supported-intrusion-settings-for-an-mx-network +def updatemxintrusionsettings(apikey, networkid, intrusionsettings, suppressprint=False): + # intrusionsettings = { + # 'mode': 'disabled'/'detection'/prevention', + # 'idsRulesets': 'connectivity'/'balanced'/'security', + # 'protectedNetworks': { + # 'useDefault': true/false, + # 'includedCidr': ["10.0.0.0/8", "172.16.0.0/12"], + # 'excludedCidr': ["10.0.0.0/8", "172.16.0.0/12"] + # } + # } + + calltype = 'MX Intrusion Settings' + puturl = '{0}/networks/{1}/security/intrusionSettings'.format( + str(base_url), str(networkid)) + headers = { + 'x-cisco-meraki-api-key': format(str(apikey)), + 'Content-Type': 'application/json' + } + + putdata = intrusionsettings + + dashboard = requests.put(puturl, data=json.dumps(putdata), headers=headers) + result = __returnhandler( + dashboard.status_code, dashboard.text, calltype, suppressprint) + return result # ### MX cellular firewall### From 06851417a3ad4e61041e4aabcae330fdf7eeb09a Mon Sep 17 00:00:00 2001 From: Jason Moss Date: Sun, 14 Jul 2019 18:23:20 -0700 Subject: [PATCH 08/18] Ignore pycache folder --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 33e533b6..02aaef97 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .DS_Store # No PyCharm config files .idea/ -venv/ \ No newline at end of file +venv/ +__pycache__ \ No newline at end of file From 08ad168cc4f54a343a6659713f58c704c424480e Mon Sep 17 00:00:00 2001 From: Jason Moss Date: Sun, 14 Jul 2019 18:24:48 -0700 Subject: [PATCH 09/18] Correct typo in comments --- meraki.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meraki.py b/meraki.py index dc45d35b..40cd13ae 100644 --- a/meraki.py +++ b/meraki.py @@ -1732,7 +1732,7 @@ def getmxintrusionsettings(apikey, networkid, suppressprint=False): # https://dashboard.meraki.com/api_docs#set-the-supported-intrusion-settings-for-an-mx-network def updatemxintrusionsettings(apikey, networkid, intrusionsettings, suppressprint=False): # intrusionsettings = { - # 'mode': 'disabled'/'detection'/prevention', + # 'mode': 'disabled'/'detection'/'prevention', # 'idsRulesets': 'connectivity'/'balanced'/'security', # 'protectedNetworks': { # 'useDefault': true/false, From 623c87bc5976b5a09b06d303ac556400ef22756a Mon Sep 17 00:00:00 2001 From: Jason Moss Date: Sun, 14 Jul 2019 18:39:31 -0700 Subject: [PATCH 10/18] Added organization-wide intrusion settings --- meraki.py | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/meraki.py b/meraki.py index 40cd13ae..3e9bf04b 100644 --- a/meraki.py +++ b/meraki.py @@ -1756,6 +1756,44 @@ def updatemxintrusionsettings(apikey, networkid, intrusionsettings, suppressprin dashboard.status_code, dashboard.text, calltype, suppressprint) return result +# Returns all supported intrusion settings for an organization +# https://dashboard.meraki.com/api_docs#returns-all-supported-intrusion-settings-for-an-organization +def getorgintrusionsettings(apikey, orgid, suppressprint=False): + calltype = 'Organization Intrusion Settings' + geturl = '{0}/organizations/{1}/security/intrusionSettings'.format( + str(base_url), str(orgid)) + headers = { + 'x-cisco-meraki-api-key': format(str(apikey)), + 'Content-Type': 'application/json' + } + dashboard = requests.get(geturl, headers=headers) + result = __returnhandler( + dashboard.status_code, dashboard.text, calltype, suppressprint) + return result + +# Sets supported intrusion settings for an organization +# https://dashboard.meraki.com/api_docs#sets-supported-intrusion-settings-for-an-organization +def updateorgintrusionsettings(apikey, orgid, whitelistedrules, suppressprint=False): + # whitelistedrules = [ + # {'ruleId': 'meraki:intrusion/snort/GID/01/SID/688', 'message': 'SQL sa login failed'}, + # {'ruleId': 'meraki:intrusion/snort/GID/01/SID/5805', 'message': 'MALWARE-OTHER Trackware myway speedbar runtime detection - switch engines'} + # ] + + calltype = 'MX Intrusion Settings' + puturl = '{0}/networks/{1}/security/intrusionSettings'.format( + str(base_url), str(orgid)) + headers = { + 'x-cisco-meraki-api-key': format(str(apikey)), + 'Content-Type': 'application/json' + } + + putdata = {'whitelistedRules': whitelistedrules} + + dashboard = requests.put(puturl, data=json.dumps(putdata), headers=headers) + result = __returnhandler( + dashboard.status_code, dashboard.text, calltype, suppressprint) + return result + # ### MX cellular firewall### # Return the cellular firewall rules for an MX network From 4dffb7b8d174c863c7f72bd26943ad7d9e5d0366 Mon Sep 17 00:00:00 2001 From: Jason Moss Date: Sun, 14 Jul 2019 21:39:03 -0700 Subject: [PATCH 11/18] Added docstrings --- meraki.py | 102 +++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 89 insertions(+), 13 deletions(-) diff --git a/meraki.py b/meraki.py index 3e9bf04b..82197c91 100644 --- a/meraki.py +++ b/meraki.py @@ -1716,6 +1716,24 @@ def getlldpcdp(apikey, networkid, serial, timespan=10800, suppressprint=False): # Returns all supported intrusion settings for an MX network # https://dashboard.meraki.com/api_docs#returns-all-supported-intrusion-settings-for-an-mx-network def getmxintrusionsettings(apikey, networkid, suppressprint=False): + """Returns all supported intrusion settings for an MX network + + Args: + apikey: User's Meraki API Key + networkid: ID of target network to list intrusion settings from + suppressprint: True to disable result output, false to enable + + Returns: + { + "mode": "prevention", + "idsRulesets": "balanced", + "protectedNetworks": { + "useDefault": false, + "includedCidr": ["10.0.0.0/8", "127.0.0.0/8"], + "excludedCidr": ["10.0.0.0/8", "127.0.0.0/8"] + } + } + """ calltype = 'MX Intrusion Settings' geturl = '{0}/networks/{1}/security/intrusionSettings'.format( str(base_url), str(networkid)) @@ -1731,16 +1749,33 @@ def getmxintrusionsettings(apikey, networkid, suppressprint=False): # Set the supported intrusion settings for an MX network # https://dashboard.meraki.com/api_docs#set-the-supported-intrusion-settings-for-an-mx-network def updatemxintrusionsettings(apikey, networkid, intrusionsettings, suppressprint=False): - # intrusionsettings = { - # 'mode': 'disabled'/'detection'/'prevention', - # 'idsRulesets': 'connectivity'/'balanced'/'security', - # 'protectedNetworks': { - # 'useDefault': true/false, - # 'includedCidr': ["10.0.0.0/8", "172.16.0.0/12"], - # 'excludedCidr': ["10.0.0.0/8", "172.16.0.0/12"] - # } - # } + """Set the supported intrusion settings for an MX network + Args: + apikey: User's Meraki API Key + networkid: ID of target network to update intrusion settings on + intrusionsettings: { + 'mode': 'disabled'/'detection'/'prevention', + 'idsRulesets': 'connectivity'/'balanced'/'security', + 'protectedNetworks': { + 'useDefault': true/false, + 'includedCidr': ["10.0.0.0/8", "172.16.0.0/12"], + 'excludedCidr': ["10.0.0.0/8", "172.16.0.0/12"] + } + } + suppressprint: True to disable result output, false to enable + + Returns: + { + "mode": "prevention", + "idsRulesets": "balanced", + "protectedNetworks": { + "useDefault": false, + "includedCidr": ["10.0.0.0/8", "127.0.0.0/8"], + "excludedCidr": ["10.0.0.0/8", "127.0.0.0/8"] + } + } + """ calltype = 'MX Intrusion Settings' puturl = '{0}/networks/{1}/security/intrusionSettings'.format( str(base_url), str(networkid)) @@ -1759,6 +1794,27 @@ def updatemxintrusionsettings(apikey, networkid, intrusionsettings, suppressprin # Returns all supported intrusion settings for an organization # https://dashboard.meraki.com/api_docs#returns-all-supported-intrusion-settings-for-an-organization def getorgintrusionsettings(apikey, orgid, suppressprint=False): + """Returns all supported intrusion settings for an organization + + Args: + apikey: User's Meraki API Key + orgid: ID of target organization to list intrusion settings from + suppressprint: True to disable result output, false to enable + + Returns: + { + "whitelistedRules": [ + { + "ruleId": "meraki:intrusion/snort/GID/01/SID/688", + "message": "SQL sa login failed" + }, + { + "ruleId": "meraki:intrusion/snort/GID/01/SID/5805", + "message": "MALWARE-OTHER Trackware myway speedbar runtime detection - switch engines" + } + ] + } + """ calltype = 'Organization Intrusion Settings' geturl = '{0}/organizations/{1}/security/intrusionSettings'.format( str(base_url), str(orgid)) @@ -1774,11 +1830,31 @@ def getorgintrusionsettings(apikey, orgid, suppressprint=False): # Sets supported intrusion settings for an organization # https://dashboard.meraki.com/api_docs#sets-supported-intrusion-settings-for-an-organization def updateorgintrusionsettings(apikey, orgid, whitelistedrules, suppressprint=False): - # whitelistedrules = [ - # {'ruleId': 'meraki:intrusion/snort/GID/01/SID/688', 'message': 'SQL sa login failed'}, - # {'ruleId': 'meraki:intrusion/snort/GID/01/SID/5805', 'message': 'MALWARE-OTHER Trackware myway speedbar runtime detection - switch engines'} - # ] + """Set the supported intrusion settings for an organization + + Args: + apikey: User's Meraki API Key + orgid: ID of target organization to update intrusion settings on + whitelistedrules: [ + {'ruleId': 'meraki:intrusion/snort/GID/01/SID/688', 'message': 'SQL sa login failed'}, + {'ruleId': 'meraki:intrusion/snort/GID/01/SID/5805', 'message': 'MALWARE-OTHER Trackware myway speedbar runtime detection - switch engines'} + ] + suppressprint: True to disable result output, false to enable + Returns: + { + "whitelistedRules": [ + { + "ruleId": "meraki:intrusion/snort/GID/01/SID/688", + "message": "SQL sa login failed" + }, + { + "ruleId": "meraki:intrusion/snort/GID/01/SID/5805", + "message": "MALWARE-OTHER Trackware myway speedbar runtime detection - switch engines" + } + ] + } + """ calltype = 'MX Intrusion Settings' puturl = '{0}/networks/{1}/security/intrusionSettings'.format( str(base_url), str(orgid)) From a92bc9685376325b7b5646d9ad56160ae3df3113 Mon Sep 17 00:00:00 2001 From: Jason Date: Sun, 14 Jul 2019 23:28:25 -0700 Subject: [PATCH 12/18] Made capitalization more consistent --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e4f63658..b6aa0a9c 100644 --- a/README.md +++ b/README.md @@ -12,9 +12,9 @@ Also available via [PIP](https://pypi.python.org/pypi/meraki/). * Use pip (or alternative such as easy_install) to install required packages: * pip install requests meraki * You are now ready to create your first script: - * create a new file and name it with python extension, e.g., meraki_hello_world.py - * import the meraki api into your script, e.g., from meraki import meraki - * use the meraki API to interact with your dashboard + * Create a new file and name it with python extension, e.g., meraki_hello_world.py + * Import the Meraki API into your script, e.g., from meraki import meraki + * Use the Meraki API to interact with your Dashboard ## Example From 84b1096250528b2dc263e6af710810c346db0403 Mon Sep 17 00:00:00 2001 From: Jason Date: Sun, 14 Jul 2019 23:19:57 -0700 Subject: [PATCH 13/18] Added malware settings functions --- meraki.py | 91 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) diff --git a/meraki.py b/meraki.py index 82197c91..17ecd9ed 100644 --- a/meraki.py +++ b/meraki.py @@ -2060,6 +2060,97 @@ def updatessidl3fwrules(apikey, networkid, ssidnum, fwrules, dashboard.status_code, dashboard.text, calltype, suppressprint) return result +# ### Malware Settings ### + +# Returns all supported malware settings for an MX network +# https://api.meraki.com/api_docs#returns-all-supported-malware-settings-for-an-mx-network +def getmalwaresettings(apikey, networkid, suppressprint=False): + """Returns all supported malware settings for an MX network + + Args: + apikey: User's Meraki API Key + networkid: ID of target network to list intrusion settings from + suppressprint: True to disable result output, false to enable + + Returns: + { + "mode": "enabled", + "allowedUrls": [ + { "url": "example.org", "comment": "allow example.org" }, + { "url": "help.com.au", "comment": "allow help.com.au" } + ], + "allowedFiles": [ + { + "sha256": "e82c5f7d75004727e1f3b94426b9a11c8bc4c312a9170ac9a73abace40aef503", + "comment": "allow ZIP file" + } + ] + } + """ + calltype = 'Malware Settings' + geturl = '{0}/networks/{1}/security/malwareSettings'.format( + str(base_url), str(networkid)) + headers = { + 'x-cisco-meraki-api-key': format(str(apikey)), + 'Content-Type': 'application/json' + } + dashboard = requests.get(geturl, headers=headers) + result = __returnhandler( + dashboard.status_code, dashboard.text, calltype, suppressprint) + return result + +# Set the supported malware settings for an MX network +# https://api.meraki.com/api_docs#set-the-supported-malware-settings-for-an-mx-network +def updatemalwaresettings(apikey, networkid, malwaresettings, suppressprint=False): + """Set the supported malware settings for an MX network + + Args: + apikey: User's Meraki API Key + networkid: ID of target network to update malware settings on + malwaresettings: { + 'mode': 'disabled'/'enabled', + 'allowedUrls': [ + {'url': 'example.org', 'comment': 'Allow example.org'}, + {'url': 'help.com.au', 'comment': 'Allow help.com.au'} + ] + 'allowedFiles': [ + { + "sha256":"e82c5f7d75004727e1f3b94426b9a11c8bc4c312a9170ac9a73abace40aef503", + "comment":"allow ZIP file" + } + ] + } + suppressprint: True to disable result output, false to enable + + Returns: + { + "mode": "enabled", + "allowedUrls": [ + { "url": "example.org", "comment": "allow example.org" }, + { "url": "help.com.au", "comment": "allow help.com.au" } + ], + "allowedFiles": [ + { + "sha256": "e82c5f7d75004727e1f3b94426b9a11c8bc4c312a9170ac9a73abace40aef503", + "comment": "allow ZIP file" + } + ] + } + """ + calltype = 'Malware Settings' + puturl = '{0}/networks/{1}/security/malwareSettings'.format( + str(base_url), str(networkid)) + headers = { + 'x-cisco-meraki-api-key': format(str(apikey)), + 'Content-Type': 'application/json' + } + + putdata = malwaresettings + + dashboard = requests.put(puturl, data=json.dumps(putdata), headers=headers) + result = __returnhandler( + dashboard.status_code, dashboard.text, calltype, suppressprint) + return result # ### GROUP POLICIES ### From 54a7f531373484a4867a09ee1b51876e74559ee8 Mon Sep 17 00:00:00 2001 From: Jason Date: Sun, 14 Jul 2019 23:22:39 -0700 Subject: [PATCH 14/18] Updated coverage document with Intrusion Settings --- Coverage.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Coverage.md b/Coverage.md index 081afe5a..424b5b7a 100644 --- a/Coverage.md +++ b/Coverage.md @@ -127,9 +127,13 @@ ## [Intrusion settings](https://dashboard.meraki.com/api_docs#intrusion-settings) - Returns all supported intrusion settings for an MX network + - getmxintrusionsettings - Set the supported intrusion settings for an MX network + - updatemxintrusionsettings - Returns all supported intrusion settings for an organization + - getorgintrusionsettings - Sets supported intrusion settings for an organization + - updateorgintrusionsettings ## [MR L3 firewall](https://dashboard.meraki.com/api_docs#mr-l3-firewall) From 7772aeb8880106c82460663f10c42ddb8fec0eb1 Mon Sep 17 00:00:00 2001 From: Jason Date: Sun, 14 Jul 2019 23:21:40 -0700 Subject: [PATCH 15/18] Updated coverage document for Malware Settings --- Coverage.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Coverage.md b/Coverage.md index 424b5b7a..f2ae55b1 100644 --- a/Coverage.md +++ b/Coverage.md @@ -198,7 +198,9 @@ ## [Malware settings](https://dashboard.meraki.com/api_docs#malware-settings) - Returns all supported malware settings for an MX network + - getmalwaresettings - Set the supported malware settings for an MX network + - updatemalwaresettings ## [Management interface settings](https://dashboard.meraki.com/api_docs#management-interface-settings) From ecaeac15538a6365faba6ec3ea3c924e492af8eb Mon Sep 17 00:00:00 2001 From: Jason Date: Sun, 14 Jul 2019 23:46:24 -0700 Subject: [PATCH 16/18] Added Content Filtering Categories --- meraki.py | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/meraki.py b/meraki.py index 17ecd9ed..d861492a 100644 --- a/meraki.py +++ b/meraki.py @@ -1522,6 +1522,48 @@ def deltemplate(apikey, orgid, templateid, suppressprint=False): dashboard.status_code, dashboard.text, calltype, suppressprint) return result +# ### Content Filtering Categories ### + +# List all available content filtering categories for an MX network +# https://api.meraki.com/api_docs#list-all-available-content-filtering-categories-for-an-mx-network +def getcontentcategories(apikey, networkid, suppressprint=False): + """List all available content filtering categories for an MX network + + Args: + apikey: User's Meraki API Key + networkid: ID of target network to list intrusion settings from + suppressprint: True to disable result output, false to enable + + Returns: + { + "categories": [ + { + "id": "meraki:contentFiltering/category/1", + "name": "Real Estate" + }, + { + "id": "meraki:contentFiltering/category/3", + "name": "Financial Services" + }, + "...", + { + "id": "meraki:contentFiltering/category/11", + "name": "Adult and Pornography" + } + ] + } + """ + calltype = 'Content Filtering Categories' + geturl = '{0}/networks/{1}/contentFiltering/categories'.format(str(base_url), str(networkid)) + headers = { + 'x-cisco-meraki-api-key': format(str(apikey)), + 'Content-Type': 'application/json' + } + dashboard = requests.get(geturl, headers=headers) + + result = __returnhandler( + dashboard.status_code, dashboard.text, calltype, suppressprint) + return result # ### DEVICES ### # List the devices in a network From 963309ceb92323cd08c366eba554313559c97400 Mon Sep 17 00:00:00 2001 From: Jason Date: Mon, 15 Jul 2019 00:02:59 -0700 Subject: [PATCH 17/18] Added content filtering rules --- meraki.py | 119 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 118 insertions(+), 1 deletion(-) diff --git a/meraki.py b/meraki.py index d861492a..5f0d64af 100644 --- a/meraki.py +++ b/meraki.py @@ -1531,7 +1531,7 @@ def getcontentcategories(apikey, networkid, suppressprint=False): Args: apikey: User's Meraki API Key - networkid: ID of target network to list intrusion settings from + networkid: ID of target network to list content filtering categories from suppressprint: True to disable result output, false to enable Returns: @@ -1565,6 +1565,123 @@ def getcontentcategories(apikey, networkid, suppressprint=False): dashboard.status_code, dashboard.text, calltype, suppressprint) return result +# ### Content Filtering Rules ### + +# Return the content filtering settings for an MX network +# https://api.meraki.com/api_docs#return-the-content-filtering-settings-for-an-mx-network +def getcontentfiltering(apikey, networkid, suppressprint=False): + """Return the content filtering settings for an MX network + + Args: + apikey: User's Meraki API Key + networkid: ID of target network to list content filtering rules from + suppressprint: True to disable result output, false to enable + + Returns: + { + "allowedUrlPatterns": [ + "http://www.example.org", + "http://help.com.au" + ], + "blockedUrlPatterns": [ + "http://www.example.com", + "http://www.betting.com" + ], + "blockedUrlCategories": [ + { + "id": "meraki:contentFiltering/category/1", + "name": "Real Estate" + }, + { + "id": "meraki:contentFiltering/category/7", + "name": "Shopping" + } + ], + "urlCategoryListSize": "topSites" + } + """ + calltype = 'Content Filtering Rules' + geturl = '{0}/networks/{1}/contentFiltering'.format(str(base_url), str(networkid)) + headers = { + 'x-cisco-meraki-api-key': format(str(apikey)), + 'Content-Type': 'application/json' + } + dashboard = requests.get(geturl, headers=headers) + + result = __returnhandler( + dashboard.status_code, dashboard.text, calltype, suppressprint) + return result + +# Update the content filtering settings for an MX network +# https://api.meraki.com/api_docs#update-the-content-filtering-settings-for-an-mx-network +def updatecontentfiltering(apikey, networkid, contentfilteringsettings, suppressprint=False): + """Update the content filtering settings for an MX network + + Args: + apikey: User's Meraki API Key + networkid: ID of target network to list content filtering rules from + contentfilteringsettings: + { + "allowedUrlPatterns": [ + "http://www.example.org", + "http://help.com.au" + ], + "blockedUrlPatterns": [ + "http://www.example.com", + "http://www.betting.com" + ], + "blockedUrlCategories": [ + { + "id": "meraki:contentFiltering/category/1", + "name": "Real Estate" + }, + { + "id": "meraki:contentFiltering/category/7", + "name": "Shopping" + } + ], + "urlCategoryListSize": "topSites"/"fullList" + } + suppressprint: True to disable result output, false to enable + + Returns: + { + "allowedUrlPatterns": [ + "http://www.example.org", + "http://help.com.au" + ], + "blockedUrlPatterns": [ + "http://www.example.com", + "http://www.betting.com" + ], + "blockedUrlCategories": [ + { + "id": "meraki:contentFiltering/category/1", + "name": "Real Estate" + }, + { + "id": "meraki:contentFiltering/category/7", + "name": "Shopping" + } + ], + "urlCategoryListSize": "topSites" + } + """ + calltype = 'Content Filtering Rules' + puturl = '{0}/networks/{1}/contentFiltering'.format( + str(base_url), str(networkid)) + headers = { + 'x-cisco-meraki-api-key': format(str(apikey)), + 'Content-Type': 'application/json' + } + + putdata = contentfilteringsettings + + dashboard = requests.put(puturl, data=json.dumps(putdata), headers=headers) + result = __returnhandler( + dashboard.status_code, dashboard.text, calltype, suppressprint) + return result + # ### DEVICES ### # List the devices in a network # https://api.meraki.com/api_docs#list-the-devices-in-a-network From 76204243064d546a6ca6768395cbf86b01c35a30 Mon Sep 17 00:00:00 2001 From: Jason Date: Mon, 15 Jul 2019 00:03:46 -0700 Subject: [PATCH 18/18] Updated coverage document for content filtering --- Coverage.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Coverage.md b/Coverage.md index f2ae55b1..8d3d3271 100644 --- a/Coverage.md +++ b/Coverage.md @@ -70,11 +70,14 @@ ## [Content filtering categories](https://dashboard.meraki.com/api_docs#content-filtering-categories) - List all available content filtering categories for an MX network + - getcontentcategories ## [Content filtering rules](https://dashboard.meraki.com/api_docs#content-filtering-rules) - Return the content filtering settings for an MX network + - getcontentfiltering - Update the content filtering settings for an MX network + - updatecontentfiltering ## [Devices](https://dashboard.meraki.com/api_docs#devices)