Skip to main content

rules

Creates, updates, deletes, gets or lists a rules resource.

Overview

Namerules
TypeResource
Idgoogle.networksecurity.rules

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringRequired. Immutable. Name of the resource. ame is the full resource name so projects/{project}/locations/{location}/gatewaySecurityPolicies/{gateway_security_policy}/rules/{rule} rule should match the pattern: (^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$).
applicationMatcherstringOptional. CEL expression for matching on L7/application level criteria.
basicProfilestringRequired. Profile which tells what the primitive action should be.
createTimestring (google-datetime)Output only. Time when the rule was created.
descriptionstringOptional. Free-text description of the resource.
enabledbooleanRequired. Whether the rule is enforced.
priorityinteger (int32)Required. Priority of the rule. Lower number corresponds to higher precedence.
sessionMatcherstringRequired. CEL expression for matching on session criteria.
tlsInspectionEnabledbooleanOptional. Flag to enable TLS inspection of traffic matching on , can only be true if the parent GatewaySecurityPolicy references a TLSInspectionConfig.
updateTimestring (google-datetime)Output only. Time when the rule was updated.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
projects_locations_gateway_security_policies_rules_getselectprojectsId, locationsId, gatewaySecurityPoliciesId, rulesIdGets details of a single GatewaySecurityPolicyRule.
projects_locations_gateway_security_policies_rules_listselectprojectsId, locationsId, gatewaySecurityPoliciesIdpageSize, pageTokenLists GatewaySecurityPolicyRules in a given project and location.
projects_locations_gateway_security_policies_rules_createinsertprojectsId, locationsId, gatewaySecurityPoliciesIdgatewaySecurityPolicyRuleIdCreates a new GatewaySecurityPolicy in a given project and location.
projects_locations_gateway_security_policies_rules_patchupdateprojectsId, locationsId, gatewaySecurityPoliciesId, rulesIdupdateMaskUpdates the parameters of a single GatewaySecurityPolicyRule.
projects_locations_gateway_security_policies_rules_deletedeleteprojectsId, locationsId, gatewaySecurityPoliciesId, rulesIdDeletes a single GatewaySecurityPolicyRule.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
gatewaySecurityPoliciesIdstring
locationsIdstring
projectsIdstring
rulesIdstring
gatewaySecurityPolicyRuleIdstring
pageSizeinteger (int32)
pageTokenstring
updateMaskstring (google-fieldmask)

SELECT examples

Gets details of a single GatewaySecurityPolicyRule.

SELECT
name,
applicationMatcher,
basicProfile,
createTime,
description,
enabled,
priority,
sessionMatcher,
tlsInspectionEnabled,
updateTime
FROM google.networksecurity.rules
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND gatewaySecurityPoliciesId = '{{ gatewaySecurityPoliciesId }}' -- required
AND rulesId = '{{ rulesId }}' -- required;

INSERT examples

Creates a new GatewaySecurityPolicy in a given project and location.

INSERT INTO google.networksecurity.rules (
data__basicProfile,
data__name,
data__enabled,
data__priority,
data__description,
data__sessionMatcher,
data__applicationMatcher,
data__tlsInspectionEnabled,
projectsId,
locationsId,
gatewaySecurityPoliciesId,
gatewaySecurityPolicyRuleId
)
SELECT
'{{ basicProfile }}',
'{{ name }}',
{{ enabled }},
{{ priority }},
'{{ description }}',
'{{ sessionMatcher }}',
'{{ applicationMatcher }}',
{{ tlsInspectionEnabled }},
'{{ projectsId }}',
'{{ locationsId }}',
'{{ gatewaySecurityPoliciesId }}',
'{{ gatewaySecurityPolicyRuleId }}'
RETURNING
name,
done,
error,
metadata,
response
;

UPDATE examples

Updates the parameters of a single GatewaySecurityPolicyRule.

UPDATE google.networksecurity.rules
SET
data__basicProfile = '{{ basicProfile }}',
data__name = '{{ name }}',
data__enabled = {{ enabled }},
data__priority = {{ priority }},
data__description = '{{ description }}',
data__sessionMatcher = '{{ sessionMatcher }}',
data__applicationMatcher = '{{ applicationMatcher }}',
data__tlsInspectionEnabled = {{ tlsInspectionEnabled }}
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND gatewaySecurityPoliciesId = '{{ gatewaySecurityPoliciesId }}' --required
AND rulesId = '{{ rulesId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
done,
error,
metadata,
response;

DELETE examples

Deletes a single GatewaySecurityPolicyRule.

DELETE FROM google.networksecurity.rules
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND gatewaySecurityPoliciesId = '{{ gatewaySecurityPoliciesId }}' --required
AND rulesId = '{{ rulesId }}' --required;