# REST Resource: projects.locations.gatewaySecurityPolicies.rules

- [Resource: GatewaySecurityPolicyRule](https://docs.cloud.google.com/secure-web-proxy/docs/reference/network-security/rest/v1/projects.locations.gatewaySecurityPolicies.rules#GatewaySecurityPolicyRule)
  - [JSON representation](https://docs.cloud.google.com/secure-web-proxy/docs/reference/network-security/rest/v1/projects.locations.gatewaySecurityPolicies.rules#GatewaySecurityPolicyRule.SCHEMA_REPRESENTATION)
- [BasicProfile](https://docs.cloud.google.com/secure-web-proxy/docs/reference/network-security/rest/v1/projects.locations.gatewaySecurityPolicies.rules#BasicProfile)
- [Methods](https://docs.cloud.google.com/secure-web-proxy/docs/reference/network-security/rest/v1/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/secure-web-proxy/docs/reference/network-security/rest/v1/projects.locations.gatewaySecurityPolicies.rules#BasicProfile`) // End of list of possible types for union field `profile`. } ``` |

| Fields ||
|---|---|
| `name` | `string` Required. Immutable. Name of the resource. `name` is the full resource name; so, the `projects/{project}/locations/{location}/gatewaySecurityPolicies/{gatewaySecurityPolicy}/rules/{rule}` rule must match this pattern: `^[a-z0-9-]+$`. |
| `createTime` | ``string (`https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Timestamp` format)`` Output only. Time when the rule was created. A timestamp in the RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. For example, `"2014-10-02T15:01:23Z"` and `"2014-10-02T15:01:23.045123456Z"`. |
| `updateTime` | ``string (`https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Timestamp` format)`` Output only. Time when the rule was updated. A timestamp in the RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. For example, `"2014-10-02T15:01:23Z"` and `"2014-10-02T15:01:23.045123456Z"`. |
| `enabled` | `boolean` Required. Indicates whether the rule is enforced. |
| `priority` | `integer` Required. Priority of the rule. Lower number corresponds to a 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 \`sessionMatcher\`. It 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/secure-web-proxy/docs/reference/network-security/rest/v1/projects.locations.gatewaySecurityPolicies.rules#BasicProfile`)`` Required. Profile that indicates the primitive action to take on the matched traffic. |

## BasicProfile

enum to define the primitive action.

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

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