Skip to content

Retrieve application segments and global policies in one go. This may be helpful for internal auditing of rules or if you just want to have a quick copy of all the applications published on your tenant.

Notifications You must be signed in to change notification settings

clarencesubia/zsaler_private_csv_export

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

csvExportZPA

This tool helps in taking all the application segments and global policies in your ZPA and saves it in CSV format.

Use Case

This tool is developed to help administrators to export a copy of all application segments and global policies published in Zscaler Private Access.

Installation

Requirements for installation:

1. pip3 install requests
2. ZPA API Key
3. ZPA Customer ID

Environment Variables, ZPA Tenant, and ZPA Customer ID

To run this project, you will need to add the following environment variables to your .env file or to your ~/.profile.

export ZPA_CL_ID='Zscaler Client ID'

export ZPA_SC='Zscaler Secret Key'

Replace the tenant and customer id.

base_path = "https://config.beta.zscaler.com"
customer_id = "72064120XXXXXXXXX"

Usage/Examples

git clone [email protected]:meliodaaf/csvAppSegExportZPA.git
./appsegments.py

Sample run. As you can see, it does support pagination. This helps when you organization has a lot of application segments published.

[*] Authentication successful!
[*] Retrieving apps from page 1.
[*] Retrieving apps from page 2.
[*] Retrieving apps from page 3.
[*] Retrieving apps from page 4.
[*] Retrieving apps from page 5.
[*] Retrieving apps from page 6.
[*] Retrieving apps from page 7.
Reached last page.
[*] Retrieving Global Policies

After successful run, CSV file should be generated.

API Reference

Get all items

  GET /mgmtconfig/v1/admin/customers/{customerId}/application
Parameter Type Description
api_key string Required. Your API key

Pagination

  GET /mgmtconfig/v1/admin/customers/{customerId}/application?page=1&pagesize=500
Parameter Type Description
page string Default value: 1
pagesize string Value is up to 500

Global Policies

  GET /mgmtconfig/v1/admin/customers/{customerId}/policySet/global

Roadmap

1. Add export for Policies - Done
2. Correlate Application Segments and Policies

Links:

ZPA API Reference

About

Retrieve application segments and global policies in one go. This may be helpful for internal auditing of rules or if you just want to have a quick copy of all the applications published on your tenant.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages