zscaler.ziacloud.zia_traffic_capture_rules module – Manages ZIA Traffic Capture policy rules
Note
This module is part of the zscaler.ziacloud collection (version 2.2.3).
It is not included in ansible-core.
To check whether it is installed, run ansible-galaxy collection list.
To install it, use: ansible-galaxy collection install zscaler.ziacloud.
You need further requirements to be able to use this module,
see Requirements for details.
To use it in a playbook, specify: zscaler.ziacloud.zia_traffic_capture_rules.
New in zscaler.ziacloud 1.0.0
Synopsis
Creates, updates, or deletes Traffic Capture policy rules.
Traffic Capture rules control which traffic is captured for inspection.
Requirements
The below requirements are needed on the host that executes this module.
Zscaler SDK Python can be obtained from PyPI https://pypi.org/project/zscaler-sdk-python/
Parameters
Parameter |
Comments |
|---|---|
The action to be enforced when the traffic matches the rule criteria. Choices:
|
|
A string that contains the obfuscated API key. |
|
List of application service group IDs. |
|
The client ID for OAuth2 authentication. |
|
The client secret for OAuth2 authentication. |
|
The Zscaler cloud name provisioned for your organization. Choices:
|
|
If set to true, the default rule is applied. Choices:
|
|
List of department IDs for which the rule must be applied. |
|
Additional information about the rule. Maximum 10240 characters. |
|
Destination addresses. Supports IPv4, FQDNs, or wildcard FQDNs. |
|
Destination countries. Provide ISO3166 Alpha2 codes (e.g., US, BR). |
|
IP address categories of destination. |
|
List of destination IP group IDs. |
|
List of device group IDs (for Zscaler Client Connector managed devices). |
|
Device trust levels for the rule application. Choices:
|
|
List of device IDs for which the rule must be applied. |
|
Indicates whether source countries are excluded from the rule. Choices:
|
|
List of group IDs for which the rule must be applied. |
|
The unique identifier for the Traffic Capture rule. Used to reference an existing rule for update or delete. |
|
List of label IDs applicable to the rule. |
|
List of location group IDs. |
|
List of location IDs for which the rule must be applied. |
|
Name of the Traffic Capture policy rule. Required for create. |
|
List of network application group IDs. |
|
Network application names. |
|
List of network service group IDs. |
|
List of network service IDs. |
|
Rule order number. If omitted, the rule will be added to the end of the rule set. |
|
A string that contains the password for the API admin. |
|
If set to true, a predefined rule is applied. Choices:
|
|
The private key for JWT-based OAuth2 authentication. |
|
A dict containing authentication credentials. |
|
Obfuscated API key. |
|
OAuth2 client ID. |
|
OAuth2 client secret. |
|
Zscaler cloud name. Choices:
|
|
Password for the API admin. |
|
Private key for OAuth2 JWT. |
|
Sandbox Cloud environment. |
|
Sandbox API Key. |
|
Whether to use the legacy Zscaler API client. Choices:
|
|
Email ID of the API admin. |
|
Vanity domain for OAuth2. |
|
Admin rank of the rule (0-7). Default: |
|
Determines whether the rule is enabled or disabled. Choices:
|
|
The Sandbox cloud environment for API access. |
|
A string that contains the Sandbox API Key. |
|
Source countries. Provide ISO3166 Alpha2 codes. |
|
List of source IP group IDs. |
|
User-defined source IP addresses for which the rule is applicable. |
|
Specifies the desired state of the resource. Choices:
|
|
The time interval in which the rule applies. |
|
The percentage of connections sampled for capturing each time the rule is triggered. Choices:
|
|
The maximum size of traffic to capture per connection. Choices:
|
|
Whether to use the legacy Zscaler API client. Choices:
|
|
A string that contains the email ID of the API admin. |
|
List of user IDs for which the rule must be applied. |
|
The vanity domain provisioned by Zscaler for OAuth2 flows. |
|
List of preconfigured workload group IDs. |
Notes
Note
Check mode is supported.
Use
idornameto reference an existing rule for update/delete.Deletion of predefined rules is not allowed.
Examples
- name: Create a Traffic Capture rule
zscaler.ziacloud.zia_traffic_capture_rules:
provider: '{{ provider }}'
name: "Capture Rule 01"
description: "Captures traffic for inspection"
order: 1
action: CAPTURE
rule_state: ENABLED
src_ips:
- "192.168.1.0/24"
dest_addresses:
- "*.example.com"
txn_sampling: TEN_PERCENT
- name: Update a Traffic Capture rule by ID
zscaler.ziacloud.zia_traffic_capture_rules:
provider: '{{ provider }}'
id: 1254654
name: "Capture Rule 01 Updated"
description: "Updated description"
- name: Delete a Traffic Capture rule
zscaler.ziacloud.zia_traffic_capture_rules:
provider: '{{ provider }}'
id: 1254654
state: absent
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
|---|---|
The Traffic Capture rule resource record. Returned: on success |