Skip to content

Commit ca05687

Browse files
authored
Support the new Broker type of custom mirroring security profile. (#15758)
1 parent 80d47ff commit ca05687

File tree

2 files changed

+66
-1
lines changed

2 files changed

+66
-1
lines changed

mmv1/products/networksecurity/SecurityProfile.yaml

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,16 @@ examples:
8686
test_env_vars:
8787
org_id: 'ORG_ID'
8888
tgc_skip_test: The ENUM value URL_FILTERING in type field is transformed to UNKNOWN_ENUM_VALUE_ProfileType_5 in CAI asset. The reason could be that URL_FILTERING is not supported in CAI yet. Will check if the value in CAI assets will be correct later.
89+
- name: network_security_security_profile_broker
90+
min_version: 'beta'
91+
primary_resource_id: 'default'
92+
vars:
93+
resource_name: 'my-security-profile'
94+
network_name: 'my-network'
95+
deployment_group_id: 'my-dg'
96+
endpoint_group_id: 'my-eg'
97+
test_env_vars:
98+
org_id: 'ORG_ID'
8999
parameters:
90100
- name: 'name'
91101
type: String
@@ -285,9 +295,31 @@ properties:
285295
- name: mirroringEndpointGroup
286296
type: String
287297
description: |
288-
The Mirroring Endpoint Group to which matching traffic should be mirrored.
298+
The target Mirroring Endpoint Group.
299+
When a mirroring rule with this security profile attached matches a packet,
300+
a replica will be mirrored to the location-local target in this group.
289301
Format: projects/{project_id}/locations/global/mirroringEndpointGroups/{endpoint_group_id}
290302
required: true
303+
- name: mirroringDeploymentGroups
304+
type: Array
305+
item_type:
306+
type: String
307+
description: |
308+
The target downstream Mirroring Deployment Groups.
309+
This field is used for Packet Broker mirroring endpoint groups to specify
310+
the deployment groups that the packet should be mirrored to by the broker.
311+
Format: projects/{project_id}/locations/global/mirroringDeploymentGroups/{deployment_group_id}
312+
immutable: true
313+
min_version: 'beta'
314+
- name: 'mirroringEndpointGroupType'
315+
type: String
316+
description: |-
317+
The type of the mirroring endpoint group this profile is attached to.
318+
Possible values:
319+
DIRECT
320+
BROKER
321+
output: true
322+
min_version: 'beta'
291323
conflicts:
292324
- 'threatPreventionProfile'
293325
- 'urlFilteringProfile'
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
resource "google_compute_network" "default" {
2+
provider = google-beta
3+
name = "{{index $.Vars "network_name"}}"
4+
auto_create_subnetworks = false
5+
}
6+
7+
resource "google_network_security_mirroring_deployment_group" "default" {
8+
provider = google-beta
9+
mirroring_deployment_group_id = "{{index $.Vars "deployment_group_id"}}"
10+
location = "global"
11+
network = google_compute_network.default.id
12+
}
13+
14+
resource "google_network_security_mirroring_endpoint_group" "default" {
15+
provider = google-beta
16+
mirroring_endpoint_group_id = "{{index $.Vars "endpoint_group_id"}}"
17+
location = "global"
18+
type = "BROKER"
19+
mirroring_deployment_groups = [google_network_security_mirroring_deployment_group.default.id]
20+
}
21+
22+
resource "google_network_security_security_profile" "{{$.PrimaryResourceId}}" {
23+
provider = google-beta
24+
name = "{{index $.Vars "resource_name"}}"
25+
parent = "organizations/{{index $.TestEnvVars "org_id"}}"
26+
description = "my description"
27+
type = "CUSTOM_MIRRORING"
28+
29+
custom_mirroring_profile {
30+
mirroring_endpoint_group = google_network_security_mirroring_endpoint_group.default.id
31+
mirroring_deployment_groups = [google_network_security_mirroring_deployment_group.default.id]
32+
}
33+
}

0 commit comments

Comments
 (0)