Skip to content

Commit 732d1c6

Browse files
Added new profile type "URL_FILTERING" for SecurityProfile (#13342) (#24583)
[upstream:571484033a581bd2b8289ba6b8da527012f4db95] Signed-off-by: Modular Magician <magic-modules@google.com>
1 parent 2f840e1 commit 732d1c6

File tree

5 files changed

+111
-4
lines changed

5 files changed

+111
-4
lines changed

.changelog/13342.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
```release-note:enhancement
2+
networksecurity: added `URL_FILTERING` option to enum field `type` for `google_network_security_security_profile` resource
3+
```
4+
```release-note:enhancement
5+
networksecurity: added `url_filtering_profile` field to `google_network_security_security_profile` resource (beta)
6+
```
7+
```release-note:enhancement
8+
networksecurity: added `url_filtering_profile` field to `google_network_security_security_profile_group` resource (beta)
9+
```

google/services/networksecurity/resource_network_security_security_profile.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ func ResourceNetworkSecuritySecurityProfile() *schema.Resource {
6767
Type: schema.TypeString,
6868
Required: true,
6969
ForceNew: true,
70-
ValidateFunc: verify.ValidateEnum([]string{"THREAT_PREVENTION", "CUSTOM_MIRRORING", "CUSTOM_INTERCEPT"}),
71-
Description: `The type of security profile. Possible values: ["THREAT_PREVENTION", "CUSTOM_MIRRORING", "CUSTOM_INTERCEPT"]`,
70+
ValidateFunc: verify.ValidateEnum([]string{"THREAT_PREVENTION", "URL_FILTERING", "CUSTOM_MIRRORING", "CUSTOM_INTERCEPT"}),
71+
Description: `The type of security profile. Possible values: ["THREAT_PREVENTION", "URL_FILTERING", "CUSTOM_MIRRORING", "CUSTOM_INTERCEPT"]`,
7272
},
7373
"custom_intercept_profile": {
7474
Type: schema.TypeList,

google/services/networksecurity/resource_network_security_security_profile_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
//
99
// This code is generated by Magic Modules using the following:
1010
//
11-
// Source file: https://github.com/GoogleCloudPlatform/magic-modules/tree/main/mmv1/third_party/terraform/services/networksecurity/resource_network_security_security_profile_test.go
11+
// Source file: https://github.com/GoogleCloudPlatform/magic-modules/tree/main/mmv1/third_party/terraform/services/networksecurity/resource_network_security_security_profile_test.go.tmpl
1212
//
1313
// DO NOT EDIT this file directly. Any changes made to this file will be
1414
// overwritten during the next generation cycle.

website/docs/r/network_security_security_profile.html.markdown

Lines changed: 63 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,35 @@ resource "google_network_security_security_profile" "default" {
150150
}
151151
}
152152
```
153+
## Example Usage - Network Security Security Profile Url Filtering
154+
155+
156+
```hcl
157+
resource "google_network_security_security_profile" "default" {
158+
provider = google-beta
159+
name = "my-security-profile"
160+
parent = "organizations/123456789"
161+
description = "my description"
162+
type = "URL_FILTERING"
163+
164+
url_filtering_profile {
165+
url_filters {
166+
priority = 1
167+
filtering_action = "ALLOW"
168+
urls = ["*example.com", "*about.example.com", "*help.example.com"]
169+
}
170+
url_filters {
171+
priority = 2
172+
filtering_action = "DENY"
173+
urls = ["*restricted.example.com"]
174+
}
175+
}
176+
177+
labels = {
178+
foo = "bar"
179+
}
180+
}
181+
```
153182

154183
## Argument Reference
155184

@@ -159,7 +188,7 @@ The following arguments are supported:
159188
* `type` -
160189
(Required)
161190
The type of security profile.
162-
Possible values are: `THREAT_PREVENTION`, `CUSTOM_MIRRORING`, `CUSTOM_INTERCEPT`.
191+
Possible values are: `THREAT_PREVENTION`, `URL_FILTERING`, `CUSTOM_MIRRORING`, `CUSTOM_INTERCEPT`.
163192

164193
* `name` -
165194
(Required)
@@ -182,6 +211,11 @@ The following arguments are supported:
182211
The threat prevention configuration for the security profile.
183212
Structure is [documented below](#nested_threat_prevention_profile).
184213

214+
* `url_filtering_profile` -
215+
(Optional, [Beta](https://terraform.io/docs/providers/google/guides/provider_versions.html))
216+
The url filtering configuration for the security profile.
217+
Structure is [documented below](#nested_url_filtering_profile).
218+
185219
* `custom_mirroring_profile` -
186220
(Optional)
187221
The configuration for defining the Mirroring Endpoint Group used to
@@ -265,6 +299,34 @@ The following arguments are supported:
265299
Threat action override. For some threat types, only a subset of actions applies.
266300
Possible values are: `ALERT`, `ALLOW`, `DEFAULT_ACTION`, `DENY`.
267301

302+
<a name="nested_url_filtering_profile"></a>The `url_filtering_profile` block supports:
303+
304+
* `url_filters` -
305+
(Optional)
306+
The configuration for action to take based on domain name match.
307+
A domain name would be checked for matching filters through the list in order of highest to lowest priority,
308+
and the first filter that a domain name matches with is the one whose actions gets applied.
309+
Structure is [documented below](#nested_url_filtering_profile_url_filters).
310+
311+
312+
<a name="nested_url_filtering_profile_url_filters"></a>The `url_filters` block supports:
313+
314+
* `filtering_action` -
315+
(Required)
316+
The action to take when the filter is applied.
317+
Possible values are: `ALLOW`, `DENY`.
318+
319+
* `urls` -
320+
(Optional)
321+
A list of domain matcher strings that a domain name gets compared with to determine if the filter is applicable.
322+
A domain name must match with at least one of the strings in the list for a filter to be applicable.
323+
324+
* `priority` -
325+
(Required)
326+
The priority of the filter within the URL filtering profile.
327+
Must be an integer from 0 and 2147483647, inclusive. Lower integers indicate higher priorities.
328+
The priority of a filter must be unique within a URL filtering profile.
329+
268330
<a name="nested_custom_mirroring_profile"></a>The `custom_mirroring_profile` block supports:
269331

270332
* `mirroring_endpoint_group` -

website/docs/r/network_security_security_profile_group.html.markdown

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,38 @@ resource "google_network_security_security_profile_group" "default" {
141141
custom_intercept_profile = google_network_security_security_profile.default.id
142142
}
143143
```
144+
## Example Usage - Network Security Security Profile Group Url Filtering
145+
146+
147+
```hcl
148+
resource "google_network_security_security_profile_group" "default" {
149+
provider = google-beta
150+
name = "sec-profile-group"
151+
parent = "organizations/123456789"
152+
description = "my description"
153+
url_filtering_profile = google_network_security_security_profile.security_profile.id
154+
155+
labels = {
156+
foo = "bar"
157+
}
158+
}
159+
160+
resource "google_network_security_security_profile" "security_profile" {
161+
provider = google-beta
162+
name = "sec-profile"
163+
location = "global"
164+
type = "URL_FILTERING"
165+
166+
url_filtering_profile {
167+
url_filters {
168+
priority = 1
169+
filtering_action = "ALLOW"
170+
urls = ["*example.com", "*about.example.com", "*help.example.com"]
171+
}
172+
}
173+
parent = "organizations/123456789"
174+
}
175+
```
144176

145177
## Argument Reference
146178

@@ -167,6 +199,10 @@ The following arguments are supported:
167199
(Optional)
168200
Reference to a SecurityProfile with the threat prevention configuration for the SecurityProfileGroup.
169201

202+
* `url_filtering_profile` -
203+
(Optional, [Beta](https://terraform.io/docs/providers/google/guides/provider_versions.html))
204+
Reference to a SecurityProfile with the URL filtering configuration for the SecurityProfileGroup.
205+
170206
* `custom_mirroring_profile` -
171207
(Optional)
172208
Reference to a SecurityProfile with the custom mirroring configuration for the SecurityProfileGroup.

0 commit comments

Comments
 (0)