Method: organizationSecurityPolicies.addRule

Inserts a rule into a security policy.

HTTP request

POST https://compute.googleapis.com/compute/beta/locations/global/{resourceId=securityPolicies/*}/addRule

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
resourceId

string

Name of the security policy to update.

Query parameters

Parameters
requestId

string

An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.

For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

Request body

The request body contains data with the following structure:

JSON representation
{
  "description": string,
  "priority": integer,
  "match": {
    "expr": {
      "expression": string,
      "title": string,
      "description": string,
      "location": string
    },
    "versionedExpr": enum,
    "config": {
      "srcIpRanges": [
        string
      ],
      "destIpRanges": [
        string
      ],
      "layer4Configs": [
        {
          "ipProtocol": string,
          "ports": [
            string
          ]
        }
      ]
    }
  },
  "action": string,
  "preview": boolean,
  "direction": enum,
  "targetResources": [
    string
  ],
  "enableLogging": boolean,
  "ruleTupleCount": integer,
  "rateLimitOptions": {
    "rateLimitThreshold": {
      "count": integer,
      "intervalSec": integer
    },
    "conformAction": string,
    "exceedAction": string,
    "enforceOnKey": enum,
    "enforceOnKeyName": string,
    "banThreshold": {
      "count": integer,
      "intervalSec": integer
    },
    "banDurationSec": integer
  },
  "targetServiceAccounts": [
    string
  ],
  "ruleNumber": string,
  "headerAction": {
    "requestHeadersToAdds": [
      {
        "headerName": string,
        "headerValue": string
      }
    ]
  },
  "redirectOptions": {
    "type": enum,
    "target": string
  },
  "kind": string
}
Fields
description

string

An optional description of this resource. Provide this property when you create the resource.

priority

integer

An integer indicating the priority of a rule in the list. The priority must be a positive value between 0 and 2147483647. Rules are evaluated from highest to lowest priority where 0 is the highest priority and 2147483647 is the lowest priority.

match

object

A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced.