You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create region security policies rules (#8477) (#6086)
* creating first version of region security policy and adding ddos protection config
* adding rules field in region security policy
* creating resource network_edge_security_service and their scenarios of test
* adding patch operation and fixing id, import_format and self_link
* added fields in the region_security_policy, and fixed the scenario tests for network_edge_security_service
* removed duplicated field for region_security_policy
* adding ddos_protection_config field in region_security_policy
* cleanups
* adding self_link field back and removing uncessary fields
* adding docs for ddosProtection
* making new resources only availabe in beta downstream
* fixing eof
* adding region security policy rule and basic scenario
* code experiments cleanups
* adding preconfiguredWafConfig object and some inner fields in region security policy rule
* adding mapping for network_match object in region security policy rule
* adding rateLimitOptions mapping
* adding ruleNumber field to region security policy
* adding basic update for region security policy rule
* adding network_match and preconfigured_waf scenarios for region sec policy rules
* wip - adding user_defined_fields in region security policy
* fixing yaml linter issues
* fixing review comments
* removing validate_only field
* fixing comments in region_security_policy_rule test
* fixing userDefinedFields and adding tests for regionSecPolicyRule
* adding user_defined_fields update test for regionSecPolicy
* removing rule_number from regionSecPolicyRule
* removing preconfiguredWaf from regionSecPolicyRule because it is not finished yet
* removing rateLimitOptions from RegionSecPolicyRule because it is not finished yet
* small cleanups
* fixing yamllint issues on the worked resources
* prevent that netwrokt_match test fails due paralellism
* adding new test for multiple rules
* fixing code review comments
* removing harcoded project from tests
* moving network_edge_security_service basic test to another region
* fixing code review issues
* fixing import cycle issue in downstream repo
* updating with upstream and change regions
---------
Signed-off-by: Modular Magician <[email protected]>
Co-authored-by: diogoEsteves <[email protected]>
@@ -99,6 +100,49 @@ If it is not provided, the provider region is used.`,
99
100
- CLOUD_ARMOR_NETWORK: Cloud Armor network policies can be configured to filter packets targeting network load balancing resources such as backend services, target pools, target instances, and instances with external IPs. They filter requests before the request is served from the application.
100
101
This field can be set only at resource creation time. Possible values: ["CLOUD_ARMOR", "CLOUD_ARMOR_EDGE", "CLOUD_ARMOR_NETWORK"]`,
101
102
},
103
+
"user_defined_fields": {
104
+
Type: schema.TypeList,
105
+
Optional: true,
106
+
Description: `Definitions of user-defined fields for CLOUD_ARMOR_NETWORK policies.
107
+
A user-defined field consists of up to 4 bytes extracted from a fixed offset in the packet, relative to the IPv4, IPv6, TCP, or UDP header, with an optional mask to select certain bits.
108
+
Rules may then specify matching values for these fields.`,
Description: `The base relative to which 'offset' is measured. Possible values are:
116
+
- IPV4: Points to the beginning of the IPv4 header.
117
+
- IPV6: Points to the beginning of the IPv6 header.
118
+
- TCP: Points to the beginning of the TCP header, skipping over any IPv4 options or IPv6 extension headers. Not present for non-first fragments.
119
+
- UDP: Points to the beginning of the UDP header, skipping over any IPv4 options or IPv6 extension headers. Not present for non-first fragments. Possible values: ["IPV4", "IPV6", "TCP", "UDP"]`,
120
+
},
121
+
"mask": {
122
+
Type: schema.TypeString,
123
+
Optional: true,
124
+
Description: `If specified, apply this mask (bitwise AND) to the field to ignore bits before matching.
125
+
Encoded as a hexadecimal number (starting with "0x").
126
+
The last byte of the field (in network byte order) corresponds to the least significant byte of the mask.`,
127
+
},
128
+
"name": {
129
+
Type: schema.TypeString,
130
+
Optional: true,
131
+
Description: `The name of this field. Must be unique within the policy.`,
132
+
},
133
+
"offset": {
134
+
Type: schema.TypeInt,
135
+
Optional: true,
136
+
Description: `Offset of the first byte of the field (in network byte order) relative to 'base'.`,
137
+
},
138
+
"size": {
139
+
Type: schema.TypeInt,
140
+
Optional: true,
141
+
Description: `Size of the field in bytes. Valid values: 1-4.`,
142
+
},
143
+
},
144
+
},
145
+
},
102
146
"fingerprint": {
103
147
Type: schema.TypeString,
104
148
Computed: true,
@@ -169,6 +213,12 @@ func resourceComputeRegionSecurityPolicyCreate(d *schema.ResourceData, meta inte
0 commit comments