Site-to-site outbound firewall Rules Export

Solved
Zbeggy
New here

Site-to-site outbound firewall Rules Export

I need to export a large list of Site-to-site outbound firewall rules.  After spending some time doing research on the API calls I cannot locate what I'm looking for.  Is it possible to export a list of these rules using the API via postman?

1 Accepted Solution
alemabrahao
Kind of a big deal
Kind of a big deal

Yes, it is.

 

https://api.meraki.com/api/v1/organizations/:organizationId/appliance/vpn/vpnFirewallRules

 

 

https://developer.cisco.com/meraki/api-v1/get-organization-appliance-vpn-vpn-firewall-rules/

I am not a Cisco Meraki employee. My suggestions are based on documentation of Meraki best practices and day-to-day experience.

Please, if this post was useful, leave your kudos and mark it as solved.

View solution in original post

25 Replies 25
alemabrahao
Kind of a big deal
Kind of a big deal

Yes, it is.

 

https://api.meraki.com/api/v1/organizations/:organizationId/appliance/vpn/vpnFirewallRules

 

 

https://developer.cisco.com/meraki/api-v1/get-organization-appliance-vpn-vpn-firewall-rules/

I am not a Cisco Meraki employee. My suggestions are based on documentation of Meraki best practices and day-to-day experience.

Please, if this post was useful, leave your kudos and mark it as solved.
Zbeggy
New here

That first link appears to be broken,  I tried the second one and I'm getting a 404 Not Found.

alemabrahao
Kind of a big deal
Kind of a big deal

The first one is the API and it doesn't load at all, the second one is working as expected.

 

alemabrahao_0-1760636306687.png

 

I am not a Cisco Meraki employee. My suggestions are based on documentation of Meraki best practices and day-to-day experience.

Please, if this post was useful, leave your kudos and mark it as solved.
Zbeggy
New here

The second link works yes, but when I run that Get command it returns a 404 not found. 

Get          {{baseUrl}}/networks/{organizationId}/appliance/vpn/vpnFirewallRules

alemabrahao
Kind of a big deal
Kind of a big deal

You need your organization ID and in addition you need to create an API key in your dashboard.

 

https://developer.cisco.com/meraki/api-v1/get-organizations/

 

http://documentation.meraki.com/General_Administration/Other_Topics/Cisco_Meraki_Dashboard_API

 

I am not a Cisco Meraki employee. My suggestions are based on documentation of Meraki best practices and day-to-day experience.

Please, if this post was useful, leave your kudos and mark it as solved.
Zbeggy
New here

I have my Org ID and I was able to set my API key as a variable.

alemabrahao
Kind of a big deal
Kind of a big deal

Did you add the correct headers?

 

alemabrahao_0-1760637194173.png

 

I am not a Cisco Meraki employee. My suggestions are based on documentation of Meraki best practices and day-to-day experience.

Please, if this post was useful, leave your kudos and mark it as solved.
Zbeggy
New here

I believe so yes.

 

Zbeggy_0-1760637281004.png

 

 

Zbeggy_1-1760637297651.png

 

alemabrahao
Kind of a big deal
Kind of a big deal

Is the Scanning API enabled? Network-wide > General

 

 

alemabrahao_0-1760637645663.png

 

I am not a Cisco Meraki employee. My suggestions are based on documentation of Meraki best practices and day-to-day experience.

Please, if this post was useful, leave your kudos and mark it as solved.
Zbeggy
New here

I do not seem to have a location and scanning section under network-wide>General.

alemabrahao
Kind of a big deal
Kind of a big deal

You can try it via Powershell

 

$headers = @{
"Authorization" = "Bearer YOUR_API_KEY"
"Accept" = "application/json"
}

$url = "https://api.meraki.com/api/v1/organizations/YOUR_ORG_ID/appliance/vpn/vpnFirewallRules"

$response = Invoke-RestMethod -Uri $url -Method Get -Headers $headers

$response

I am not a Cisco Meraki employee. My suggestions are based on documentation of Meraki best practices and day-to-day experience.

Please, if this post was useful, leave your kudos and mark it as solved.
Zbeggy
New here

Using PS I get this...


Invoke-RestMethod : The remote server returned an error: (401) Unauthorized.
At line:6 char:13
+ $response = Invoke-RestMethod -Uri $url -Method Get -Headers $headers
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand

alemabrahao
Kind of a big deal
Kind of a big deal

Either your API key is incorrect or you don't have API scanning enabled. I believe it's the latter, as I validated it here and it worked perfectly.

I am not a Cisco Meraki employee. My suggestions are based on documentation of Meraki best practices and day-to-day experience.

Please, if this post was useful, leave your kudos and mark it as solved.
Zbeggy
New here

API key works for other tests like getOrganizationID and Get l3FirewallRules.

I do not seem to have a location & scanning section either in general or under org>location anaylytics.


For Meraki dashboard users
  • Enable Location Analytics:
    • Go to Organization > Location Analytics and verify analytics are enabled. 
       
    • Navigate to Network-wide > Configure > General and ensure "Location and scanning > Analytics" is enabled for the specific network. 
alemabrahao
Kind of a big deal
Kind of a big deal

This is the correct path Network-wide > Configure > General and ensure "Location and scanning .

Are you full admin? If you don't enable this it won't work.

I am not a Cisco Meraki employee. My suggestions are based on documentation of Meraki best practices and day-to-day experience.

Please, if this post was useful, leave your kudos and mark it as solved.
Zbeggy
New here

I am a full admin, double and triple checked that page and found nothing.  I'll have to reach out to support to confirm.

I appreciate your help!!

alemabrahao
Kind of a big deal
Kind of a big deal

Last question: Does Analytics appear to you? It needs to be enabled to enable API scanning.

alemabrahao_0-1760641831258.png

 

I am not a Cisco Meraki employee. My suggestions are based on documentation of Meraki best practices and day-to-day experience.

Please, if this post was useful, leave your kudos and mark it as solved.
Zbeggy
New here

It must be enabled because it worked and I got analytics but the objects aren't showing up as the names or IPs, its all just a string of random numbers.  

Is that for security reasons or is there a way I can get this to show the actual objects/IPs?

alemabrahao
Kind of a big deal
Kind of a big deal

I don't know the reason, I believe what is displayed is the object code in Meraki, but I can't explain why the name isn't displayed.

I am not a Cisco Meraki employee. My suggestions are based on documentation of Meraki best practices and day-to-day experience.

Please, if this post was useful, leave your kudos and mark it as solved.
alemabrahao
Kind of a big deal
Kind of a big deal

It's a little further down in Location and scanning.

I am not a Cisco Meraki employee. My suggestions are based on documentation of Meraki best practices and day-to-day experience.

Please, if this post was useful, leave your kudos and mark it as solved.
PhilipDAth
Kind of a big deal
Kind of a big deal

If you use the link that @alemabrahao gave you:
https://developer.cisco.com/meraki/api-v1/get-organization-appliance-vpn-vpn-firewall-rules/
It has come code you can copy and paste.

 

PhilipDAth_0-1760639858568.png

 

Zbeggy
New here

When I use that site, instead of postman, I get this.

Failed to execute 'fetch' on 'Window': Invalid name

Zbeggy
New here

I also tried to copy/paste it into postman, but I'm just now using Postman for the first time and I don't know where to past it.  I tried putting it under Scripts (pre & post-scripts)

srajiwate
Getting noticed

https://github.com/srajiwate/SR-Meraki-Mate   you can get your bulk export of firewall rules inbound as well outbound from this python tool 

As well can append, delete Or add rules as well there is option to overide rules

Zbeggy
New here

I managed to get it to work!  Apparently I had the wrong URL.  After looking at the first link again I realized mine said networks/orgid instead of organizations/orgid.


Thank you so much for all of your help!!

Get notified when there are additional replies to this discussion.