web_dlp#
The following methods allow for interaction with the ZIA User Management API endpoints.
Methods are accessible via zia.web_dlp
- class WebDLPAPI#
- add_rule(payload)#
Adds a new DLP policy rule.
- Parameters:
payload (dict) – Dictionary containing the Web DLP Policy rule to be added.
- Returns:
The newly added Web DLP Policy Rule resource record.
- Return type:
Box
- Payload:
Minimum items required in payload:
payload = { 'order': 1, # A number greater than 0. 'rank': 0, 'name': "Dax testing pyZscaler post.", 'protocols': ["ANY_RULE"], 'action': "ALLOW", }
Examples
Add a Web DLP Policy rule with the minimum required parameters:
payload = { 'order': 1, 'rank': 0, 'name': "Dax testing pyZscaler post.", 'protocols': ["ANY_RULE"], 'action': "ALLOW", } # Add new Web DLP item print(zia.web_dlp.add_rule(payload=payload))
- delete_rule(rule_id)#
Deletes a DLP policy rule. This endpoint is not applicable to SaaS Security API DLP policy rules.
- Parameters:
rule_id (str) – Unique id of the Web DLP Policy Rule that will be deleted.
- Returns:
Response message from the ZIA API endpoint.
- Return type:
Box
Examples
Delete a rule with an id of 9999.
>>> results = zia.web_dlp.delete_rule(rule_id=9999) ... print(results)
- get_rule(rule_id)#
Returns a DLP policy rule, excluding SaaS Security API DLP policy rules.
- Parameters:
rule_id (str) – The unique id for the Web DLP rule.
- Returns:
The Web DLP Rule resource record.
- Return type:
Box
Examples
Get information on a Web DLP item by ID
>>> results = zia.web_dlp.get_rule(rule_id='9999') ... print(results)
- list_rules(**kwargs)#
Returns a list of DLP policy rules, excluding SaaS Security API DLP policy rules.
- Returns:
List of Web DLP items.
- Return type:
BoxList
Examples
Get a list of all Web DLP Items
>>> results = zia.web_dlp.list_rules() ... for item in results: ... print(item)
- list_rules_lite()#
Returns the name and ID for all DLP policy rules, excluding SaaS Security API DLP policy rules.
- Returns:
List of Web DLP name/ids.
- Return type:
BoxList
Examples
Get Web DLP Lite results
>>> results = zia.web_dlp.list_rules_lite() ... for item in results: ... print(item)
- update_rule(rule_id, payload)#
Updates a DLP policy rule. This endpoint is not applicable to SaaS Security API DLP policy rules.
- Parameters:
- Returns:
The updated Web DLP Policy Rule resource record.
- Return type:
Box
Examples
Update a Web DLP Policy Rule:
payload = zia.web_dlp.get_rule('9999') payload['name'] = "daxm updated name." results = zia.web_dlp.update_rule(rule_id=9999, payload=payload) print(results)