Skip to main content

Zscaler Tools

Project description

Zscaler Tools

Python Library used for interacting with Zscaler's public API

General Information

This Python Library is being devloped to provide an easily usable interface with Zscaler API.

https://help.zscaler.com/zia/api

Zscaler API Functions in this Library

  • ZIA
    • Activation
    • Admin Audit Logs
    • Admin & Role Management
    • API Authentication
    • Cloud Sandbox Report
    • Firewall Policies
    • Location Management
    • Security Policy Settings
    • SSL Inspection Settings
    • Traffic Forwarding
    • User Management
    • URL Categories
    • URL Filtering Policies
    • User Authentication Settings
  • ZPA
    • API not released by Zscaler

Features

  • Manage Request Sessions to Zscaler API
    • You do not need to explicitly call the login() function
  • Manage Auto-Retry (3 retries per call)
  • Manage 429 API Rate Limit Reponse
    • Library will read response and wait for Rate Limit before continuing

How to install:

pip install zscalertools

How to use:

import zscalertools
ztools_zia_api = zscalertools.zia('admin.zscalerbeta.net', 'test_api@user.com', 'password', 'Apikey')

ztools_zia_api.get_users()

Attributes

cloud : str
  a string containing the zscaler cloud to use
username : str
  the username of the account to connect to the zscaler cloud
password : str
  the password for the username string
apikey : str
  apikey needed to connect to zscaler cloud

Zscaler Methods

API Authentication
------------------
login()
  Attempts to create a web session to Zscaler API
logout()
  Delete's existing web session to Zscaler API

Activation
----------
get_status()
  Gets the activation status for a configuration change
activate_status()
  Activates configuration changes

User Management
---------------
get_users(name=None, dept=None, group=None, page=None, pageSize=None)
  Gets a list of all users and allows user filtering by name, department, or group
get_user(id)
  Gets the user information for the specified ID
get_groups(search=None, page=None, pageSize=None)
  Gets a list of groups
get_group(id)
  Gets the group for the specified ID
get_departments(search=None, name=None, page=None, pageSize=None)
  Gets a list of departments
get_department(id)
  Gets the department for the specified ID
add_user(user_object)
  Adds a new user
update_user(id, user_object)
  Updates the user information for the specified ID
delete_user(id)
  Deletes the user for the specified ID
bulk_delete_users(ids=[])
  Bulk delete users up to a maximum of 500 users per request

Location Management
-------------------
get_locations(search=None, sslScanEnabled=None, xffEnabled=None, authRequired=None, bwEnforced=None, page=None, pageSize=None)
  Gets information on locations
get_location(id)
  Gets the location information for the specified ID
get_sublocations(id, search=None, sslScanEnabled=None, xffEnabled=None, authRequired=None, bwEnforced=None, page=None, pageSize=None, enforceAup=None, enableFirewall=None)
  Gets the sub-location information for the location with the specified ID. These are the sub-locations associated to the parent location
add_location(location_object)
  Adds new locations and sub-locations
get_locations_lite(includeSubLocations=None, includeParentLocations=None, sslScanEnabled=None, search=None, page=None, pageSize=None)
  Gets a name and ID dictionary of locations
update_location(id, location_object)
  Updates the location and sub-location information for the specified ID
delete_location(id)
  Deletes the location or sub-location for the specified ID
buld_delete_locations(ids=[])
  Bulk delete locations up to a maximum of 100 users per request. The response returns the location IDs that were successfully deleted.

Custom Methods

pull_all_user_data()
  Pulls all users, departments and groups and returns 3 arrays (up to 999,999 entries a piece)

Contributing

Pull requests are welcome. Initial development is focused on building out the rest of the library.

Please make sure to update tests as appropriate.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zscalertools-0.0.11.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zscalertools-0.0.11-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file zscalertools-0.0.11.tar.gz.

File metadata

  • Download URL: zscalertools-0.0.11.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.2

File hashes

Hashes for zscalertools-0.0.11.tar.gz
Algorithm Hash digest
SHA256 0bf15ca4e39b88d9a01803576238d5ed5a9267518c1c1e711583e9b7710dc86e
MD5 4ba480f1e2bc898150456b835a20e06d
BLAKE2b-256 8182c953ce314199c13f20e5f8934694b7f5ed640326434dbd571fbb8794dd77

See more details on using hashes here.

File details

Details for the file zscalertools-0.0.11-py3-none-any.whl.

File metadata

  • Download URL: zscalertools-0.0.11-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.2

File hashes

Hashes for zscalertools-0.0.11-py3-none-any.whl
Algorithm Hash digest
SHA256 26cd75eea7bd953e8a609d01ec7a534774ed47e7af5c87ceddb706fdc6f6a8a7
MD5 0373039dc59409f3e944e2361893fee1
BLAKE2b-256 ebfd0a3ba91d39bc1b3207ddb0194f5c2d5ed13a7f269e06025df798b8580ffd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page