# REST Resource: projects.locations.gatewaySecurityPolicies.rules

- [Resource: GatewaySecurityPolicyRule](https://docs.cloud.google.com/service-mesh/v1.23/docs/reference/network-security/rest/v1beta1/projects.locations.gatewaySecurityPolicies.rules#GatewaySecurityPolicyRule)
  - [JSON representation](https://docs.cloud.google.com/service-mesh/v1.23/docs/reference/network-security/rest/v1beta1/projects.locations.gatewaySecurityPolicies.rules#GatewaySecurityPolicyRule.SCHEMA_REPRESENTATION)
- [BasicProfile](https://docs.cloud.google.com/service-mesh/v1.23/docs/reference/network-security/rest/v1beta1/projects.locations.gatewaySecurityPolicies.rules#BasicProfile)
- [Methods](https://docs.cloud.google.com/service-mesh/v1.23/docs/reference/network-security/rest/v1beta1/projects.locations.gatewaySecurityPolicies.rules#METHODS_SUMMARY)

## Resource: GatewaySecurityPolicyRule

The GatewaySecurityPolicyRule resource is in a nested collection within a GatewaySecurityPolicy and represents a traffic matching condition and associated action to perform.

| JSON representation |
|---|
| ``` { "name": string, "createTime": string, "updateTime": string, "enabled": boolean, "priority": integer, "description": string, "sessionMatcher": string, "applicationMatcher": string, "tlsInspectionEnabled": boolean, // Union field `profile` can be only one of the following: "basicProfile": enum (`https://docs.cloud.google.com/service-mesh/v1.23/docs/reference/network-security/rest/v1beta1/projects.locations.gatewaySecurityPolicies.rules#BasicProfile`) // End of list of possible types for union field `profile`. } ``` |

| Fields ||
|---|---|
| `name` | `string` Required. Immutable. Name of the resource. ame is the full resource name so projects/{project}/locations/{location}/gatewaySecurityPolicies/{gatewaySecurityPolicy}/rules/{rule} rule should match the pattern: (\^[a-z](https://docs.cloud.google.com/service-mesh/v1.23/docs/reference/network-security/rest/v1beta1/[a-z0-9-]{0,61}[a-z0-9])?$). |
| `createTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Output only. Time when the rule was created. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: `"2014-10-02T15:01:23Z"` and `"2014-10-02T15:01:23.045123456Z"`. |
| `updateTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Output only. Time when the rule was updated. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: `"2014-10-02T15:01:23Z"` and `"2014-10-02T15:01:23.045123456Z"`. |
| `enabled` | `boolean` Required. Whether the rule is enforced. |
| `priority` | `integer` Required. Priority of the rule. Lower number corresponds to higher precedence. |
| `description` | `string` Optional. Free-text description of the resource. |
| `sessionMatcher` | `string` Required. CEL expression for matching on session criteria. |
| `applicationMatcher` | `string` Optional. CEL expression for matching on L7/application level criteria. |
| `tlsInspectionEnabled` | `boolean` Optional. Flag to enable TLS inspection of traffic matching on , can only be true if the parent GatewaySecurityPolicy references a TLSInspectionConfig. |
| Union field `profile`. `profile` can be only one of the following: ||
| `basicProfile` | ``enum (`https://docs.cloud.google.com/service-mesh/v1.23/docs/reference/network-security/rest/v1beta1/projects.locations.gatewaySecurityPolicies.rules#BasicProfile`)`` Required. Profile which tells what the primitive action should be. |

## BasicProfile

enum to define the primitive action.

| Enums ||
|---|---|
| `BASIC_PROFILE_UNSPECIFIED` | If there is not a mentioned action for the target. |
| `ALLOW` | Allow the matched traffic. |
| `DENY` | Deny the matched traffic. |

| ## Methods ||
|---|---|
| ### `https://docs.cloud.google.com/service-mesh/v1.23/docs/reference/network-security/rest/v1beta1/projects.locations.gatewaySecurityPolicies.rules/create` | Creates a new GatewaySecurityPolicy in a given project and location. |
| ### `https://docs.cloud.google.com/service-mesh/v1.23/docs/reference/network-security/rest/v1beta1/projects.locations.gatewaySecurityPolicies.rules/delete` | Deletes a single GatewaySecurityPolicyRule. |
| ### `https://docs.cloud.google.com/service-mesh/v1.23/docs/reference/network-security/rest/v1beta1/projects.locations.gatewaySecurityPolicies.rules/get` | Gets details of a single GatewaySecurityPolicyRule. |
| ### `https://docs.cloud.google.com/service-mesh/v1.23/docs/reference/network-security/rest/v1beta1/projects.locations.gatewaySecurityPolicies.rules/list` | Lists GatewaySecurityPolicyRules in a given project and location. |
| ### `https://docs.cloud.google.com/service-mesh/v1.23/docs/reference/network-security/rest/v1beta1/projects.locations.gatewaySecurityPolicies.rules/patch` | Updates the parameters of a single GatewaySecurityPolicyRule. |