cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
401
Views
1
Helpful
2
Replies

CDO - Export All ACL policies to CSV

Westy1000
Level 1
Level 1

Using Cisco Defence Orchestrator, Is there a way to export all ACLs from all network policies to CSV in one go?

I know you can do it on a per policy (as per article below) basis but need everything in one excel with the associated hitcounts.

https://docs.defenseorchestrator.com/t-export-network-policy-rules.html

 

2 Replies 2

Exporting all ACLs from all network policies to a CSV file in one go directly from Cisco Defence Orchestrator (CDO) might not be directly supported as of my last update. However, you can achieve this by using the CDO API in combination with scripting or programming.

Here's a general outline of the steps you can take:

  • Authenticate with CDO API: Use the CDO API to authenticate and obtain an access token that allows you to interact with the CDO resources programmatically.
  • Retrieve Network Policies: Use the API to retrieve a list of all network policies in your environment.
  • Iterate Through Policies: For each network policy, retrieve the associated ACLs and their configurations.
  • Collect ACL Data: As you retrieve ACLs, collect relevant data such as source, destination, action, and hit counts.
  • Export to CSV: Write the collected data to a CSV file, ensuring that each ACL's data is properly formatted and organized.

 

By following this approach, you can automate the process of exporting ACLs from all network policies to a CSV file, including associated hit counts.

Keep in mind that implementing this solution may require some programming or scripting knowledge, as well as an understanding of the CDO API. You may also need appropriate permissions to access and retrieve data from CDO programmatically.

If you're not comfortable with programming or scripting, you could consider reaching out to Cisco support or consulting with a developer who has experience with Cisco APIs to assist you with this task.

Westy1000
Level 1
Level 1

Thanks for the advice. I ended up downloading each policy to CSV into a single folder and then running this command in terminal to join them into a single CSV with the filename in column A.

 

for file in *.csv; do awk -v filename="$file" 'BEGIN{FS=OFS=","} {print filename, $0}' "$file" >> merged.csv; done