Skip to content

Commit 4658611

Browse files
authored
fix: Fixed validation error and panic issue. (#396)
1 parent 960eb62 commit 4658611

File tree

8 files changed

+212
-87
lines changed

8 files changed

+212
-87
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# Changelog
22

3+
## 4.0.6 (February, 12 2025)
4+
5+
### Notes
6+
7+
- Release date: **(February, 12 2025)**
8+
- Supported Terraform version: **v1.x**
9+
10+
### Bug Fixes
11+
12+
- [PR #396](https://github.com/zscaler/terraform-provider-zia/pull/396) - Fixed `zia_ssl_inspection_rules` validation error and panic issue.
13+
314
## 4.0.5 (February, 10 2025)
415

516
### Notes

GNUmakefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,14 +196,14 @@ test\:integration\:zscalertwo:
196196
build13: GOOS=$(shell go env GOOS)
197197
build13: GOARCH=$(shell go env GOARCH)
198198
ifeq ($(OS),Windows_NT) # is Windows_NT on XP, 2000, 7, Vista, 10...
199-
build13: DESTINATION=$(APPDATA)/terraform.d/plugins/$(ZIA_PROVIDER_NAMESPACE)/4.0.5/$(GOOS)_$(GOARCH)
199+
build13: DESTINATION=$(APPDATA)/terraform.d/plugins/$(ZIA_PROVIDER_NAMESPACE)/4.0.6/$(GOOS)_$(GOARCH)
200200
else
201-
build13: DESTINATION=$(HOME)/.terraform.d/plugins/$(ZIA_PROVIDER_NAMESPACE)/4.0.5/$(GOOS)_$(GOARCH)
201+
build13: DESTINATION=$(HOME)/.terraform.d/plugins/$(ZIA_PROVIDER_NAMESPACE)/4.0.6/$(GOOS)_$(GOARCH)
202202
endif
203203
build13: fmtcheck
204204
@echo "==> Installing plugin to $(DESTINATION)"
205205
@mkdir -p $(DESTINATION)
206-
go build -o $(DESTINATION)/terraform-provider-zia_v4.0.5
206+
go build -o $(DESTINATION)/terraform-provider-zia_v4.0.6
207207

208208
coverage: test
209209
@echo "✓ Opening coverage for unit tests ..."

docs/guides/release-notes.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,21 @@ description: |-
1212
Track all ZIA Terraform provider's releases. New resources, features, and bug fixes will be tracked here.
1313

1414
---
15-
``Last updated: v4.0.5``
15+
``Last updated: v4.0.6``
1616

1717
---
1818

19+
## 4.0.6 (February, 12 2025)
20+
21+
### Notes
22+
23+
- Release date: **(February, 12 2025)**
24+
- Supported Terraform version: **v1.x**
25+
26+
### Bug Fixes
27+
28+
- [PR #396](https://github.com/zscaler/terraform-provider-zia/pull/396) - Fixed `zia_ssl_inspection_rules` validation error and panic issue.
29+
1930
## 4.0.5 (February, 10 2025)
2031

2132
### Notes

docs/resources/zia_ssl_inspection_rules.md

Lines changed: 80 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -180,134 +180,150 @@ The following arguments are supported:
180180

181181
### Required
182182

183-
* `name` - (String) Name of the SSL Inspection
184-
* `order` - (String) Unique identifier for the SSL Inspection
183+
- `name` - (String) Name of the SSL Inspection
184+
- `order` - (String) Unique identifier for the SSL Inspection
185185

186186
## Attribute Reference
187187

188188
In addition to all arguments above, the following attributes are supported:
189189

190-
* `description` (String) - Enter additional notes or information. The description cannot exceed 10,240 characters.
191-
* `order` (String) - Policy rules are evaluated in ascending numerical order (Rule 1 before Rule 2, and so on), and the Rule Order reflects this rule's place in the order.
192-
* `state` (String) - The state of the rule indicating whether it is enabled or disabled. Supported values: `ENABLED` or `DISABLED`
193-
* `rank` (Integer) - The admin rank specified for the rule based on your assigned admin rank. Admin rank determines the rule order that can be specified for the rule. Admin rank can be configured if it is enabled in the Advanced Settings.
194-
* `access_control` (String) - The access privilege (RBA) for this rule.
195-
* `road_warrior_for_kerberos` (Boolean) - Indicates whether this rule is applied to remote users that use PAC with Kerberos authentication.
196-
* `platforms` (Set of String) - Zscaler Client Connector device platforms for which this rule is applied. Supported Values: `SCAN_IOS`, `SCAN_ANDROID`, `SCAN_MACOS`, `SCAN_WINDOWS`, `NO_CLIENT_CONNECTOR`, `SCAN_LINUX`
197-
* `cloud_applications` (Set of String) - The list of URL categories to which the DLP policy rule must be applied. For the complete list of supported file types refer to the [ZIA API documentation](https://help.zscaler.com/zia/data-loss-prevention#/webDlpRules-post)
198-
* `url_categories` (Set of String) - The list of URL categories to which the DLP policy rule must be applied.
199-
* `user_agent_types` (Set of String) - A list of user agent types the rule applies to.
200-
* `device_trust_levels` (Set of String) - List of device trust levels for which the rule must be applied. This field is applicable for devices that are managed using Zscaler Client Connector. The trust levels are assigned to the devices based on your posture configurations in the Zscaler Client Connector Portal. If no value is set, this field is ignored during the policy evaluation. Supported values: `ANY`, `UNKNOWN_DEVICETRUSTLEVEL`, `LOW_TRUST`, `MEDIUM_TRUST`, `HIGH_TRUST`
201-
* `action` (Block List) - Action taken when the traffic matches policy
202-
* `devices` (Block List) - ID pairs of devices for which the rule is applied
203-
* `device_groups` (Block List) - ID pairs of device groups for which the rule is applied.
204-
* `departments` (Block List) - ID pairs of departments for which the rule is applied.
205-
* `groups` (Block List) - ID pairs of groups for which the rule is applied. If not set, rule is applied for all groups.
206-
* `labels` (Block List) - ID pairs of labels associated with the rule.
207-
* `locations` (Block List) - ID pairs of locations to which the rule is applied. When empty, it implies applying to all locations.
208-
* `location_groups` (Block List) - ID pairs of location groups to which the rule is applied. When empty, it implies applying to all location groups.
209-
* `dest_ip_groups` (Block List) - ID pairs of destination IP address groups for which the rule is applied.
210-
* `source_ip_groups` (Block List) - ID pairs of source IP address groups for which the rule is applied.
211-
* `proxy_gateways` (Block List) - When using ZPA Gateway forwarding, name-ID pairs of ZPA Application Segments for which the rule is applicable.
212-
* `zpa_app_segments` (Block List) - The list of ZPA Application Segments for which this rule is applicable (applicable only for ZPA Gateway forwarding).
213-
* `workload_groups` (Block List) - The list of preconfigured workload groups to which the policy must be applied.
214-
* `time_windows` (Block List) - The time intervals during which the rule applies
215-
* `users` (Block List) - The list of preconfigured workload groups to which the policy must be applied.
190+
- `description` (String) - Enter additional notes or information. The description cannot exceed 10,240 characters.
191+
- `order` (String) - Policy rules are evaluated in ascending numerical order (Rule 1 before Rule 2, and so on), and the Rule Order reflects this rule's place in the order.
192+
- `state` (String) - The state of the rule indicating whether it is enabled or disabled. Supported values: `ENABLED` or `DISABLED`
193+
- `rank` (Integer) - The admin rank specified for the rule based on your assigned admin rank. Admin rank determines the rule order that can be specified for the rule. Admin rank can be configured if it is enabled in the Advanced Settings.
194+
- `access_control` (String) - The access privilege (RBA) for this rule.
195+
- `road_warrior_for_kerberos` (Boolean) - Indicates whether this rule is applied to remote users that use PAC with Kerberos authentication.
196+
- `platforms` (Set of String) - Zscaler Client Connector device platforms for which this rule is applied. Supported Values: `SCAN_IOS`, `SCAN_ANDROID`, `SCAN_MACOS`, `SCAN_WINDOWS`, `NO_CLIENT_CONNECTOR`, `SCAN_LINUX`
197+
- `cloud_applications` (Set of String) - The list of URL categories to which the DLP policy rule must be applied. For the complete list of supported file types refer to the [ZIA API documentation](https://help.zscaler.com/zia/data-loss-prevention#/webDlpRules-post)
198+
- `url_categories` (Set of String) - The list of URL categories to which the DLP policy rule must be applied.
199+
- `user_agent_types` (Set of String) - A list of user agent types the rule applies to.
200+
- `device_trust_levels` (Set of String) - List of device trust levels for which the rule must be applied. This field is applicable for devices that are managed using Zscaler Client Connector. The trust levels are assigned to the devices based on your posture configurations in the Zscaler Client Connector Portal. If no value is set, this field is ignored during the policy evaluation. Supported values: `ANY`, `UNKNOWN_DEVICETRUSTLEVEL`, `LOW_TRUST`, `MEDIUM_TRUST`, `HIGH_TRUST`
201+
- `action` (Block List) - Action taken when the traffic matches policy
202+
- `devices` (Block List) - ID pairs of devices for which the rule is applied
203+
- `device_groups` (Block List) - ID pairs of device groups for which the rule is applied.
204+
- `departments` (Block List) - ID pairs of departments for which the rule is applied.
205+
- `groups` (Block List) - ID pairs of groups for which the rule is applied. If not set, rule is applied for all groups.
206+
- `labels` (Block List) - ID pairs of labels associated with the rule.
207+
- `locations` (Block List) - ID pairs of locations to which the rule is applied. When empty, it implies applying to all locations.
208+
- `location_groups` (Block List) - ID pairs of location groups to which the rule is applied. When empty, it implies applying to all location groups.
209+
- `dest_ip_groups` (Block List) - ID pairs of destination IP address groups for which the rule is applied.
210+
- `source_ip_groups` (Block List) - ID pairs of source IP address groups for which the rule is applied.
211+
- `proxy_gateways` (Block List) - When using ZPA Gateway forwarding, name-ID pairs of ZPA Application Segments for which the rule is applicable.
212+
- `zpa_app_segments` (Block List) - The list of ZPA Application Segments for which this rule is applicable (applicable only for ZPA Gateway forwarding).
213+
- `workload_groups` (Block List) - The list of preconfigured workload groups to which the policy must be applied.
214+
- `time_windows` (Block List) - The time intervals during which the rule applies
215+
- `users` (Block List) - The list of preconfigured workload groups to which the policy must be applied.
216216

217217
### Action Attributes
218218

219219
`action` has the following attributes:
220220

221-
* `type` (String) - The action type for this rule. Possible values: `BLOCK`, `DECRYPT`, or `DO_NOT_DECRYPT`.
222-
* `show_eun` (Boolean) - Whether to show End User Notification (EUN).
223-
* `show_eunatp` (Boolean) - Whether to display the EUN ATP page.
224-
* `override_default_certificate` (Boolean) - Whether to override the default SSL interception certificate.
225-
* `ssl_interception_cert` (Block List) - The SSL interception certificate to be used. If not set it will use the default Zscaler certificate
226-
* `decrypt_sub_actions` (Block List) - Action taken when enabling SSL intercept
227-
* `do_not_decrypt_sub_actions` (Block List) - Action taken when bypassing SSL intercept
221+
- `type` (String) - The action type for this rule. Possible values: `BLOCK`, `DECRYPT`, or `DO_NOT_DECRYPT`.
222+
- `show_eun` (Boolean) - Whether to show End User Notification (EUN).
223+
- `show_eunatp` (Boolean) - Whether to display the EUN ATP page.
224+
- `override_default_certificate` (Boolean) - Whether to override the default SSL interception certificate.
225+
- `ssl_interception_cert` (Block List) - The SSL interception certificate to be used. If not set it will use the default Zscaler certificate
226+
- `decrypt_sub_actions` (Block List) - Action taken when enabling SSL intercept
227+
- `do_not_decrypt_sub_actions` (Block List) - Action taken when bypassing SSL intercept
228228

229229
### ssl_interception_cert Attributes
230230

231231
`ssl_interception_cert` has the following attributes:
232+
**NOTE** This block can only be set when `override_default_certificate` is `true`
232233

233-
* `id` (Integer) - The unique ID of the SSL interception certificate.
234-
* `name` (String) - The name of the SSL interception certificate.
235-
* `default_certificate` (Boolean) - Indicates if this certificate is the default certificate.
234+
- `id` (Integer) - The unique ID of the SSL interception certificate.
235+
236+
### action.type `BLOCK`
237+
238+
`action` has the following attributes:
239+
240+
- `type` (String) - The action type for this rule. Possible values: `BLOCK`.
241+
- `show_eun` (Boolean) - Enable this setting to display end user notifications.
242+
- `override_default_certificate` (Boolean) - Whether to override the default SSL interception certificate.
243+
- `ssl_interception_cert` has the following attributes:
244+
**NOTE** This block can only be set when `override_default_certificate` is `true`
245+
246+
- `id` (Integer) - The unique ID of the SSL interception certificate.
236247

237248
### decrypt_sub_actions Attributes
238249

239250
`decrypt_sub_actions` has the following attributes:
240251

241-
* `server_certificates` (String) - Action to take on server certificates. Valid values might include `ALLOW`, `BLOCK`, or `PASS_THRU`.
242-
* `ocsp_check` (Boolean) - Whether to enable OCSP check.
243-
* `block_ssl_traffic_with_no_sni_enabled` (Boolean) - Whether to block SSL traffic when SNI is not present.
244-
* `min_client_tls_version` (String) - The minimum TLS version allowed on the client side: Supported Values are: `CLIENT_TLS_1_0`, `CLIENT_TLS_1_1`, `CLIENT_TLS_1_2`, `CLIENT_TLS_1_3`.
245-
* `min_server_tls_version` (String) - The minimum TLS version allowed on the server side: Supported Values are: `SERVER_TLS_1_0`, `SERVER_TLS_1_1`, `SERVER_TLS_1_2`, `SERVER_TLS_1_3`.
246-
* `block_undecrypt` (Boolean) - Enable to block traffic from servers that use non-standard encryption methods or require mutual TLS authentication.
247-
* `http2_enabled` (Boolean)
252+
- `server_certificates` (String) - Action to take on server certificates. Valid values might include `ALLOW`, `BLOCK`, or `PASS_THRU`.
253+
- `ocsp_check` (Boolean) - Whether to enable OCSP check.
254+
- `block_ssl_traffic_with_no_sni_enabled` (Boolean) - Whether to block SSL traffic when SNI is not present.
255+
- `min_client_tls_version` (String) - The minimum TLS version allowed on the client side: Supported Values are: `CLIENT_TLS_1_0`, `CLIENT_TLS_1_1`, `CLIENT_TLS_1_2`, `CLIENT_TLS_1_3`.
256+
- `min_server_tls_version` (String) - The minimum TLS version allowed on the server side: Supported Values are: `SERVER_TLS_1_0`, `SERVER_TLS_1_1`, `SERVER_TLS_1_2`, `SERVER_TLS_1_3`.
257+
- `block_undecrypt` (Boolean) - Enable to block traffic from servers that use non-standard encryption methods or require mutual TLS authentication.
258+
- `http2_enabled` (Boolean)
259+
- `ssl_interception_cert` has the following attributes:
260+
**NOTE** This block can only be set when `override_default_certificate` is `true`
261+
262+
- `id` (Integer) - The unique ID of the SSL interception certificate.
248263

249264
### do_not_decrypt_sub_actions Attributes
250265

251266
`do_not_decrypt_sub_actions` has the following attributes:
252267

253-
* `bypass_other_policies` (Boolean) - Whether to bypass other policies when action is set to `DO_NOT_DECRYPT`.
254-
* `server_certificates` (String) - Action to take on server certificates. Valid values might include `ALLOW`, `BLOCK`, or `PASS_THRU`.
255-
* `ocsp_check` (Boolean) - Whether to enable OCSP check.
256-
* `block_ssl_traffic_with_no_sni_enabled` (Boolean) - Whether to block SSL traffic when SNI is not present.
257-
* `min_tls_version` (String) - The minimum TLS version allowed on the server side: Supported Values are: `SERVER_TLS_1_0`, `SERVER_TLS_1_1`, `SERVER_TLS_1_2`, `SERVER_TLS_1_3`.
268+
- `bypass_other_policies` (Boolean) - Whether to bypass other policies when action is set to `DO_NOT_DECRYPT`.
269+
- `server_certificates` (String) - Action to take on server certificates. Valid values might include `ALLOW`, `BLOCK`, or `PASS_THRU`.
270+
- `ocsp_check` (Boolean) - Whether to enable OCSP check.
271+
- `block_ssl_traffic_with_no_sni_enabled` (Boolean) - Whether to block SSL traffic when SNI is not present.
272+
- `min_tls_version` (String) - The minimum TLS version allowed on the server side: Supported Values are: `SERVER_TLS_1_0`, `SERVER_TLS_1_1`, `SERVER_TLS_1_2`, `SERVER_TLS_1_3`.
273+
**NOTE** `min_tls_version` and `server_certificates` CANNOT be set if `bypass_other_policies` is `true`
258274

259275
### Devices Attributes
260276

261-
* `id` (Integer) - A unique identifier for the device.
277+
- `id` (Integer) - A unique identifier for the device.
262278

263279
### Device Groups Attributes
264280

265-
* `id` (Integer) - A unique identifier for the device groups.
281+
- `id` (Integer) - A unique identifier for the device groups.
266282

267283
### Labels Attributes
268284

269-
* `id` (Integer) - A unique identifier for the label.
285+
- `id` (Integer) - A unique identifier for the label.
270286

271287
### Locations Attributes
272288

273-
* `id` (Integer) - A unique identifier for the locations.
289+
- `id` (Integer) - A unique identifier for the locations.
274290

275291
### Location Groups Attributes
276292

277-
* `id` (Integer) - A unique identifier for the location groups.
293+
- `id` (Integer) - A unique identifier for the location groups.
278294

279295
### Departments Attributes
280296

281-
* `id` (Integer) - A unique identifier for the departments.
297+
- `id` (Integer) - A unique identifier for the departments.
282298

283299
### Destination IP Groups Attributes
284300

285-
* `id` (Integer) - A unique identifier for the destination ip group.
301+
- `id` (Integer) - A unique identifier for the destination ip group.
286302

287303
### Groups Attributes
288304

289-
* `id` (Integer) - A unique identifier for the groups.
305+
- `id` (Integer) - A unique identifier for the groups.
290306

291307
### Source IP Groups Attributes
292308

293-
* `id` (Integer) - A unique identifier for the source ip group.
309+
- `id` (Integer) - A unique identifier for the source ip group.
294310

295311
### Users Attributes
296312

297-
* `id` (Integer) - A unique identifier for the users.
313+
- `id` (Integer) - A unique identifier for the users.
298314

299315
### Time Windows Attributes
300316

301-
* `id` (Integer) - A unique identifier for the time window.
317+
- `id` (Integer) - A unique identifier for the time window.
302318

303319
### Proxy Gateways Attributes
304320

305-
* `id` (Integer) - A unique identifier assigned to the Application Segment
321+
- `id` (Integer) - A unique identifier assigned to the Application Segment
306322

307323
### ZPA App Segments Attributes
308324

309-
* `id` (Integer) - A unique identifier assigned to the Application Segment
325+
- `id` (Integer) - A unique identifier assigned to the Application Segment
310326

311327
### Workload Groups Attributes
312328

313-
* `id` (Integer) - A unique identifier assigned to the workload group
329+
- `id` (Integer) - A unique identifier assigned to the workload group

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ require (
99
github.com/hashicorp/go-hclog v1.6.3
1010
github.com/hashicorp/terraform-plugin-sdk v1.17.2
1111
github.com/hashicorp/terraform-plugin-sdk/v2 v2.36.0
12-
github.com/zscaler/zscaler-sdk-go/v3 v3.1.4
12+
github.com/zscaler/zscaler-sdk-go/v3 v3.1.5
1313
)
1414

1515
require (

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -401,8 +401,8 @@ github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b/go.mod h1:ZRK
401401
github.com/zclconf/go-cty-debug v0.0.0-20240509010212-0d6042c53940 h1:4r45xpDWB6ZMSMNJFMOjqrGHynW3DIBuR2H9j0ug+Mo=
402402
github.com/zclconf/go-cty-debug v0.0.0-20240509010212-0d6042c53940/go.mod h1:CmBdvvj3nqzfzJ6nTCIwDTPZ56aVGvDrmztiO5g3qrM=
403403
github.com/zclconf/go-cty-yaml v1.0.2/go.mod h1:IP3Ylp0wQpYm50IHK8OZWKMu6sPJIUgKa8XhiVHura0=
404-
github.com/zscaler/zscaler-sdk-go/v3 v3.1.4 h1:1rQ3BzfsBeqczpVkdi2aQTAefhft5iUs85J+u/naaME=
405-
github.com/zscaler/zscaler-sdk-go/v3 v3.1.4/go.mod h1:2gXo+LVFYtr+/oCe+mETsXlb9sJEzRtPl6JwPhSIgWM=
404+
github.com/zscaler/zscaler-sdk-go/v3 v3.1.5 h1:h69bAs9daPFnbkX9y4n5PEukp/zr+vukeh75ncoHO/M=
405+
github.com/zscaler/zscaler-sdk-go/v3 v3.1.5/go.mod h1:2gXo+LVFYtr+/oCe+mETsXlb9sJEzRtPl6JwPhSIgWM=
406406
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
407407
go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
408408
go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=

zia/data_source_zia_ssl_inspection_rules.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -115,14 +115,14 @@ func dataSourceSSLInspectionRules() *schema.Resource {
115115
Type: schema.TypeInt,
116116
Computed: true,
117117
},
118-
"name": {
119-
Type: schema.TypeString,
120-
Computed: true,
121-
},
122-
"default_certificate": {
123-
Type: schema.TypeBool,
124-
Computed: true,
125-
},
118+
// "name": {
119+
// Type: schema.TypeString,
120+
// Computed: true,
121+
// },
122+
// "default_certificate": {
123+
// Type: schema.TypeBool,
124+
// Computed: true,
125+
// },
126126
},
127127
},
128128
},
@@ -811,7 +811,7 @@ func flattenSSLInterceptionCert(cert *sslinspection.SSLInterceptionCert) []inter
811811
}
812812
c := make(map[string]interface{})
813813
c["id"] = cert.ID
814-
c["name"] = cert.Name
814+
// c["name"] = cert.Name
815815
// c["default_certificate"] = cert.DefaultCertificate
816816
return []interface{}{c}
817817
}

0 commit comments

Comments
 (0)