security#

The following methods allow for interaction with the ZIA Security Policy Settings API endpoints.

Methods are accessible via zia.security

class SecurityPolicyAPI#
add_urls_to_blacklist(url_list)#

Adds the provided URLs to the blacklist.

Parameters:

url_list (list of str) – The list of URLs to be added.

Returns:

The complete and updated blacklist.

Return type:

BoxList

Examples

>>> zia.security.add_urls_to_blacklist(['example.com', 'web.example.com'])
add_urls_to_whitelist(url_list)#

Adds the provided URLs to the whitelist.

Parameters:

url_list (list of str) – The list of URLs to be added.

Returns:

The complete and updated whitelist.

Return type:

BoxList

Examples

>>> zia.security.add_urls_to_whitelist(['example.com', 'web.example.com'])
delete_urls_from_blacklist(url_list)#

Deletes the provided URLs from the blacklist.

Parameters:

url_list (list of str) – The list of URLs to be deleted.

Returns:

The status code for the operation.

Return type:

int

Examples

>>> zia.security.delete_urls_from_blacklist(['example.com', 'web.example.com'])
delete_urls_from_whitelist(url_list)#

Deletes the provided URLs from the whitelist.

Parameters:

url_list (list of str) – The list of URLs to be deleted.

Returns:

The complete and updated whitelist.

Return type:

BoxList

Examples

>>> zia.security.delete_urls_from_whitelist(['example.com', 'web.example.com'])
erase_blacklist()#

Erases all URLs in the blacklist.

Returns:

The status code for the operation.

Return type:

int

Examples

>>> zia.security.erase_blacklist()
erase_whitelist()#

Erases all URLs in the whitelist.

Returns:

The status code for the operation.

Return type:

int

Examples

>>> zia.security.erase_whitelist()
get_blacklist()#

Returns a list of blacklisted URLs.

Returns:

A list of blacklisted URLs

Return type:

BoxList

Examples

>>> for url in zia.security.get_blacklist():
...    pprint(url)
get_whitelist()#

Returns a list of whitelisted URLs.

Returns:

A list of whitelisted URLs

Return type:

BoxList

Examples

>>> for url in zia.security.get_whitelist():
...    pprint(url)
replace_blacklist(url_list)#

Replaces the existing blacklist with the URLs provided.

Parameters:

url_list (list of str) – The list of URLs for the new blacklist.

Returns:

The complete and updated blacklist.

Return type:

BoxList

Examples

>>> zia.security.replace_blacklist(['example.com'])
replace_whitelist(url_list)#

Replaces the existing whitelist with the URLs provided.

Parameters:

url_list (list of str) – The list of URLs for the new whitelist.

Returns:

The complete and updated whitelist.

Return type:

BoxList

Examples

>>> zia.security.replace_whitelist(['example.com'])