|
| 1 | +--- |
| 2 | +subcategory: "Traffic Capture Policy" |
| 3 | +layout: "zscaler" |
| 4 | +page_title: "ZIA: traffic_capture_rules" |
| 5 | +description: |- |
| 6 | + Official documentation https://help.zscaler.com/zia/about-traffic-capture-policy |
| 7 | + API documentation https://help.zscaler.com/zia/traffic-capture-policy#/trafficCaptureRules-get |
| 8 | + Get information about traffic capture rules |
| 9 | +--- |
| 10 | + |
| 11 | +# zia_traffic_capture_rules (Data Source) |
| 12 | + |
| 13 | +* [Official documentation](https://help.zscaler.com/zia/about-traffic-capture-policy) |
| 14 | +* [API documentation](https://help.zscaler.com/zia/traffic-capture-policy#/trafficCaptureRules-get) |
| 15 | + |
| 16 | +Use the **zia_traffic_capture_rules** data source to get information about a traffic capture rules available in the Zscaler Internet Access cloud firewall. |
| 17 | + |
| 18 | +## Example Usage - Retrieve by Name |
| 19 | + |
| 20 | +```hcl |
| 21 | +data "zia_traffic_capture_rules" "example" { |
| 22 | + name = "Capture_Rule01" |
| 23 | +} |
| 24 | +``` |
| 25 | + |
| 26 | +## Example Usage - Retrieve by ID |
| 27 | + |
| 28 | +```hcl |
| 29 | +data "zia_traffic_capture_rules" "example" { |
| 30 | + id = 1254674585 |
| 31 | +} |
| 32 | +``` |
| 33 | + |
| 34 | +## Argument Reference |
| 35 | + |
| 36 | +The following arguments are supported: |
| 37 | + |
| 38 | +### Required |
| 39 | + |
| 40 | +At least one of the following must be provided: |
| 41 | + |
| 42 | +* `id` - (Integer) Unique identifier for the Traffic Capture policy rule |
| 43 | +* `name` - (String) Name of the Traffic Capture policy rule |
| 44 | + |
| 45 | +## Attribute Reference |
| 46 | + |
| 47 | +In addition to all arguments above, the following attributes are exported: |
| 48 | + |
| 49 | +* `description` - (String) Additional information about the rule. Cannot exceed 10,240 characters. |
| 50 | +* `order` - (Integer) Rule order number. Policy rules are evaluated in ascending numerical order. |
| 51 | +* `rank` - (Integer) Admin rank of the Traffic Capture policy rule. Default value is `7`. |
| 52 | +* `state` - (String) Rule state. An enabled rule is actively enforced. Values: `ENABLED`, `DISABLED` |
| 53 | +* `action` - (String) The action the rule takes when packets match. Values: `CAPTURE`, `SKIP` |
| 54 | +* `access_control` - (String) The admin's access privilege to this rule based on the assigned role |
| 55 | +* `default_rule` - (Boolean) Indicates if this is a default rule |
| 56 | +* `predefined` - (Boolean) Indicates if this is a predefined rule |
| 57 | +* `txn_size_limit` - (String) The maximum size of traffic to capture per connection. Supported Values: `NONE`, `UNLIMITED`, `THIRTY_TWO_KB`, `TWO_FIFTY_SIX_KB`, `TWO_MB`, `FOUR_MB`, `THIRTY_TWO_MB`, `SIXTY_FOUR_MB` |
| 58 | + |
| 59 | +* `txn_sampling` - (String) The percentage of connections sampled for capturing each time the rule is triggered. Supported Values: `NONE`, `ONE_PERCENT`, `TWO_PERCENT`, `FIVE_PERCENT`, `TEN_PERCENT`, `TWENTY_FIVE_PERCENT`, `HUNDRED_PERCENT` |
| 60 | + |
| 61 | +* `last_modified_time` - (Integer) Timestamp when the rule was last modified |
| 62 | + |
| 63 | +### Last Modified By |
| 64 | + |
| 65 | +* `last_modified_by` - (List) User who last modified the rule |
| 66 | + * `id` - (Integer) Identifier of the user |
| 67 | + * `name` - (String) Name of the user |
| 68 | + * `extensions` - (Map of String) Additional user extensions |
| 69 | + |
| 70 | +### Who, Where and When |
| 71 | + |
| 72 | +* `locations` - (List) Locations for which the rule applies. You can manually select up to `8` locations. |
| 73 | + * `id` - (Integer) Identifier that uniquely identifies an entity |
| 74 | + * `name` - (String) The configured name of the entity |
| 75 | + * `extensions` - (Map of String) Additional location extensions |
| 76 | + |
| 77 | +* `location_groups` - (List) Location groups for which the rule applies. You can manually select up to `32` location groups. |
| 78 | + * `id` - (Integer) Identifier that uniquely identifies an entity |
| 79 | + * `name` - (String) The configured name of the entity |
| 80 | + * `extensions` - (Map of String) Additional location group extensions |
| 81 | + |
| 82 | +* `users` - (List) Users for which the rule applies. You can manually select up to `4` general and/or special users. |
| 83 | + * `id` - (Integer) Identifier that uniquely identifies an entity |
| 84 | + * `name` - (String) The configured name of the entity |
| 85 | + * `extensions` - (Map of String) Additional user extensions |
| 86 | + |
| 87 | +* `groups` - (List) Groups for which the rule applies. You can manually select up to `8` groups. |
| 88 | + * `id` - (Integer) Identifier that uniquely identifies an entity |
| 89 | + * `name` - (String) The configured name of the entity |
| 90 | + * `extensions` - (Map of String) Additional group extensions |
| 91 | + |
| 92 | +* `departments` - (List) Departments for which the rule applies. You can apply to any number of departments. |
| 93 | + * `id` - (Integer) Identifier that uniquely identifies an entity |
| 94 | + * `name` - (String) The configured name of the entity |
| 95 | + * `extensions` - (Map of String) Additional department extensions |
| 96 | + |
| 97 | +* `time_windows` - (List) Time intervals in which the rule applies. You can manually select up to `2` time intervals. |
| 98 | + * `id` - (Integer) Identifier that uniquely identifies an entity |
| 99 | + * `name` - (String) The configured name of the entity |
| 100 | + * `extensions` - (Map of String) Additional time window extensions |
| 101 | + |
| 102 | +### Network Services |
| 103 | + |
| 104 | +* `nw_services` - (List) Network services for which the rule applies. The Zscaler firewall has predefined services and you can configure up to `1,024` additional custom services. |
| 105 | + * `id` - (Integer) Identifier that uniquely identifies an entity |
| 106 | + * `name` - (String) The configured name of the entity |
| 107 | + * `extensions` - (Map of String) Additional network service extensions |
| 108 | + |
| 109 | +* `nw_service_groups` - (List) Network service groups for which the rule applies. |
| 110 | + * `id` - (Integer) Identifier that uniquely identifies an entity |
| 111 | + * `name` - (String) The configured name of the entity |
| 112 | + * `extensions` - (Map of String) Additional network service group extensions |
| 113 | + |
| 114 | +### Network Applications |
| 115 | + |
| 116 | +* `nw_applications` - (List of String) Network service applications. The service provides predefined applications. |
| 117 | + |
| 118 | +* `nw_application_groups` - (List) Network application groups for which the rule applies. |
| 119 | + * `id` - (Integer) Identifier that uniquely identifies an entity |
| 120 | + * `name` - (String) The configured name of the entity |
| 121 | + * `extensions` - (Map of String) Additional network application group extensions |
| 122 | + |
| 123 | +### Source IP |
| 124 | + |
| 125 | +* `src_ip_groups` - (Optional) Any number of source IP address groups that you want to control with this rule. |
| 126 | + - `id` - (String) Identifier that uniquely identifies an entity |
| 127 | + - `name` - (String) The configured name of the entity |
| 128 | + - `extensions` - (Map of String) |
| 129 | + |
| 130 | +* `src_ips` - (Optional) You can enter individual IP addresses, subnets, or address ranges. |
| 131 | + |
| 132 | +* `source_countries`** - (List of String) Identify destinations based on the location of a server. Provide a 2 letter [ISO3166 Alpha2 Country code](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes). i.e ``"US"``, ``"CA"`` |
| 133 | + |
| 134 | +* `exclude_src_countries` - (Boolean) Indicates whether the countries specified in the sourceCountries field are included or excluded from the rule. A true value denotes that the specified source countries are excluded from the rule. A false value denotes that the rule is applied to the source countries if there is a match. |
| 135 | + |
| 136 | +### Destination IP |
| 137 | + |
| 138 | +* `dest_ip_groups`** - (Optional) Any number of destination IP address groups that you want to control with this rule. |
| 139 | + - `id` - (String) Identifier that uniquely identifies an entity |
| 140 | + - `name` - (String) The configured name of the entity |
| 141 | + - `extensions` - (Map of String) |
| 142 | + |
| 143 | +* `dest_addresses`** - (List of String) - IP addresses and fully qualified domain names (FQDNs), if the domain has multiple destination IP addresses or if its IP addresses may change. For IP addresses, you can enter individual IP addresses, subnets, or address ranges. If adding multiple items, hit Enter after each entry. |
| 144 | +* `dest_countries`** - (List of String) Identify destinations based on the location of a server. Provide a 2 letter [ISO3166 Alpha2 Country code](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes). i.e ``"US"``, ``"CA"`` |
| 145 | + |
| 146 | +### Workload Group |
| 147 | + |
| 148 | +* `workload_groups` (List) The list of preconfigured workload groups to which the policy must be applied |
| 149 | + * `id` - (Number) A unique identifier assigned to the workload group |
| 150 | + * `name` - (String) The name of the workload group |
0 commit comments