{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/google-cloud-compute-engine/json-schema/google-cloud-compute-engine-security-policy-schema.json",
  "title": "SecurityPolicy",
  "description": "Represents a Google Cloud Armor security policy resource.\n\nOnly external backend services that use load balancers can\nreference a security policy. For more information, see\nGoogle Cloud Armor security policy overview.",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/google-cloud-compute-engine-organization-security-policies-api-openapi.yml#/components/schemas/SecurityPolicy",
  "properties": {
    "selfLink": {
      "readOnly": true,
      "description": "Output only. [Output Only] Server-defined URL for the resource.",
      "type": "string"
    },
    "type": {
      "type": "string",
      "description": "The type indicates the intended use of the security policy.\n   \n   - CLOUD_ARMOR: Cloud Armor backend security policies can\n   be configured to filter incoming HTTP requests targeting backend services.\n   They filter requests before they hit the origin servers.\n   - CLOUD_ARMOR_EDGE: Cloud Armor edge security policies can\n   be configured to filter incoming HTTP requests targeting backend services\n   (including Cloud CDN-enabled) as well as backend buckets (Cloud Storage).\n   They filter requests before the request is served from Google's cache.\n   - CLOUD_ARMOR_INTERNAL_SERVICE (preview only): Cloud Armor\n   internal service policies can be configured to filter HTTP requests\n   targeting services managed by Traffic Director in a service mesh. They\n   filter requests before the request is served from the application.\n\n- CLOUD_ARMOR_NETWORK: Cloud Armor network policies\ncan be configured to filter packets targeting network load balancing\nresources such as backend services, target pools, target instances, and\ninstances with external IPs. They filter requests before the request is\nserved from the application.\n\n\nThis field can be set only at resource creation time.",
      "enum": [
        "CLOUD_ARMOR",
        "CLOUD_ARMOR_EDGE",
        "CLOUD_ARMOR_NETWORK"
      ]
    },
    "ddosProtectionConfig": {
      "$ref": "#/$defs/SecurityPolicyDdosProtectionConfig"
    },
    "associations": {
      "items": {
        "$ref": "#/$defs/SecurityPolicyAssociation"
      },
      "description": "A list of associations that belong to this policy.",
      "type": "array"
    },
    "labelFingerprint": {
      "type": "string",
      "description": "A fingerprint for the labels being applied to this security policy, which\nis essentially a hash of the labels set used for optimistic locking. The\nfingerprint is initially generated by Compute Engine and changes after\nevery request to modify or update labels. You must always provide an\nup-to-date fingerprint hash in order to update or change labels.\n\nTo see the latest fingerprint, make get() request to the\nsecurity policy.",
      "format": "byte"
    },
    "shortName": {
      "description": "User-provided name of the organization security policy. The name should be\nunique in the organization in which the security policy is created. This\nshould only be used when SecurityPolicyType is CLOUD_ARMOR.\nThe name must be 1-63 characters long, and comply with\nhttps://www.ietf.org/rfc/rfc1035.txt. Specifically, the name must be 1-63\ncharacters long and match the regular expression\n`[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a\nlowercase letter, and all following characters must be a dash, lowercase\nletter, or digit, except the last character, which cannot be a dash.",
      "type": "string",
      "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?"
    },
    "rules": {
      "type": "array",
      "description": "A list of rules that belong to this policy.\nThere must always be a default rule which is a rule with priority\n2147483647 and match all condition (for the match condition this means\nmatch  \"*\" for srcIpRanges and for the networkMatch condition every field\nmust be either match \"*\" or not set). If no rules are provided when\ncreating a security policy, a default rule with action \"allow\" will be\nadded.",
      "items": {
        "$ref": "#/$defs/SecurityPolicyRule"
      }
    },
    "fingerprint": {
      "type": "string",
      "format": "byte",
      "description": "Specifies a fingerprint for this resource, which is essentially a hash of\nthe metadata's contents and used for optimistic locking. The\nfingerprint is initially generated by Compute Engine and changes after\nevery request to modify or update metadata. You must always provide an\nup-to-date fingerprint hash in order to update or change metadata,\notherwise the request will fail with error412 conditionNotMet.\n\nTo see the latest fingerprint, make get() request to the\nsecurity policy."
    },
    "labels": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "description": "Labels for this resource. These can only be added or modified by thesetLabels method. Each label key/value pair must comply withRFC1035.\nLabel values may be empty."
    },
    "recaptchaOptionsConfig": {
      "$ref": "#/$defs/SecurityPolicyRecaptchaOptionsConfig"
    },
    "userDefinedFields": {
      "description": "Definitions of user-defined fields for CLOUD_ARMOR_NETWORK policies. A\nuser-defined field consists of up to 4 bytes extracted from a fixed offset\nin the packet, relative to the IPv4, IPv6, TCP, or UDP header, with an\noptional mask to select certain bits. Rules may then specify matching\nvalues for these fields.\n\nExample:\n\n userDefinedFields:\n - name: \"ipv4_fragment_offset\"\n   base: IPV4\n   offset: 6\n   size: 2\n   mask: \"0x1fff\"",
      "type": "array",
      "items": {
        "$ref": "#/$defs/SecurityPolicyUserDefinedField"
      }
    },
    "kind": {
      "readOnly": true,
      "description": "Output only. [Output only] Type of the resource. Alwayscompute#securityPolicyfor security policies",
      "type": "string",
      "default": "compute#securityPolicy"
    },
    "creationTimestamp": {
      "description": "Output only. [Output Only] Creation timestamp inRFC3339\ntext format.",
      "type": "string",
      "readOnly": true
    },
    "description": {
      "description": "An optional description of this resource. Provide this property when you\ncreate the resource.",
      "type": "string"
    },
    "region": {
      "readOnly": true,
      "type": "string",
      "description": "Output only. [Output Only] URL of the region where the regional security policy\nresides. This field is not applicable to global security policies."
    },
    "name": {
      "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
      "type": "string",
      "description": "Name of the resource. Provided by the client when the resource is created.\nThe name must be 1-63 characters long, and comply withRFC1035.\nSpecifically, the name must be 1-63 characters long and match the regular\nexpression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first\ncharacter must be a lowercase letter, and all following characters must\nbe a dash, lowercase letter, or digit, except the last character, which\ncannot be a dash."
    },
    "advancedOptionsConfig": {
      "$ref": "#/$defs/SecurityPolicyAdvancedOptionsConfig"
    },
    "adaptiveProtectionConfig": {
      "$ref": "#/$defs/SecurityPolicyAdaptiveProtectionConfig"
    },
    "id": {
      "readOnly": true,
      "format": "uint64",
      "type": "string",
      "description": "Output only. [Output Only] The unique identifier for the resource. This identifier is\ndefined by the server."
    },
    "parent": {
      "type": "string",
      "description": "Output only. [Output Only] The parent of the security policy.",
      "readOnly": true
    }
  },
  "type": "object",
  "$defs": {
    "Expr": {
      "properties": {
        "expression": {
          "description": "Textual representation of an expression in Common Expression Language\nsyntax.",
          "type": "string"
        },
        "location": {
          "type": "string",
          "description": "Optional. String indicating the location of the expression for error\nreporting, e.g. a file name and a position in the file."
        },
        "title": {
          "description": "Optional. Title for the expression, i.e. a short string describing\nits purpose. This can be used e.g. in UIs which allow to enter the\nexpression.",
          "type": "string"
        },
        "description": {
          "description": "Optional. Description of the expression. This is a longer text which\ndescribes the expression, e.g. when hovered over it in a UI.",
          "type": "string"
        }
      },
      "type": "object",
      "description": "Represents a textual expression in the Common Expression Language (CEL)\nsyntax. CEL is a C-like expression language. The syntax and semantics of CEL\nare documented at https://github.com/google/cel-spec.\n\nExample (Comparison):\n\n    title: \"Summary size limit\"\n    description: \"Determines if a summary is less than 100 chars\"\n    expression: \"document.summary.size() < 100\"\n\nExample (Equality):\n\n    title: \"Requestor is owner\"\n    description: \"Determines if requestor is the document owner\"\n    expression: \"document.owner == request.auth.claims.email\"\n\nExample (Logic):\n\n    title: \"Public documents\"\n    description: \"Determine whether the document should be publicly visible\"\n    expression: \"document.type != 'private' && document.type != 'internal'\"\n\nExample (Data Manipulation):\n\n    title: \"Notification string\"\n    description: \"Create a notification string with a timestamp.\"\n    expression: \"'New message received at ' + string(document.create_time)\"\n\nThe exact variables and functions that may be referenced within an expression\nare determined by the service that evaluates it. See the service\ndocumentation for additional information."
    },
    "SecurityPolicyAdaptiveProtectionConfig": {
      "properties": {
        "layer7DdosDefenseConfig": {
          "$ref": "#/$defs/SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfig",
          "description": "If set to true, enables Cloud Armor Machine Learning."
        }
      },
      "type": "object",
      "description": "Configuration options for Cloud Armor Adaptive Protection (CAAP)."
    },
    "SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfig": {
      "type": "object",
      "properties": {
        "thresholdConfigs": {
          "type": "array",
          "description": "Configuration options for layer7 adaptive protection for various\ncustomizable thresholds.",
          "items": {
            "$ref": "#/$defs/SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfigThresholdConfig"
          }
        },
        "ruleVisibility": {
          "enum": [
            "PREMIUM",
            "STANDARD"
          ],
          "type": "string",
          "description": "Rule visibility can be one of the following:\nSTANDARD - opaque rules. (default)\nPREMIUM - transparent rules.\nThis field is only supported in Global Security Policies of type\nCLOUD_ARMOR."
        },
        "enable": {
          "type": "boolean",
          "description": "If set to true, enables CAAP for L7 DDoS detection.\nThis field is only supported in Global Security Policies of type\nCLOUD_ARMOR."
        }
      },
      "description": "Configuration options for L7 DDoS detection.\nThis field is only supported in Global Security Policies of type\nCLOUD_ARMOR."
    },
    "SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfigThresholdConfig": {
      "properties": {
        "detectionRelativeToBaselineQps": {
          "type": "number",
          "format": "float"
        },
        "detectionLoadThreshold": {
          "format": "float",
          "type": "number"
        },
        "autoDeployExpirationSec": {
          "type": "integer",
          "format": "int32"
        },
        "autoDeployConfidenceThreshold": {
          "format": "float",
          "type": "number"
        },
        "name": {
          "description": "The name must be 1-63 characters long, and comply withRFC1035.\nThe name must be unique within the security policy.",
          "type": "string",
          "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?"
        },
        "autoDeployLoadThreshold": {
          "type": "number",
          "format": "float"
        },
        "detectionAbsoluteQps": {
          "type": "number",
          "format": "float"
        },
        "autoDeployImpactedBaselineThreshold": {
          "type": "number",
          "format": "float"
        },
        "trafficGranularityConfigs": {
          "type": "array",
          "description": "Configuration options for enabling Adaptive Protection to operate\non specified granular traffic units.",
          "items": {
            "$ref": "#/$defs/SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfigThresholdConfigTrafficGranularityConfig"
          }
        }
      },
      "type": "object"
    },
    "SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfigThresholdConfigTrafficGranularityConfig": {
      "description": "Configurations to specifc granular traffic units processed by\nAdaptive Protection.",
      "type": "object",
      "properties": {
        "value": {
          "description": "Requests that match this value constitute a granular traffic unit.",
          "type": "string"
        },
        "type": {
          "type": "string",
          "description": "Type of this configuration.",
          "enum": [
            "HTTP_HEADER_HOST",
            "HTTP_PATH",
            "UNSPECIFIED_TYPE"
          ]
        },
        "enableEachUniqueValue": {
          "description": "If enabled, traffic matching each unique value for the specified\ntype constitutes a separate traffic unit.\nIt can only be set to true if `value` is empty.",
          "type": "boolean"
        }
      }
    },
    "SecurityPolicyAdvancedOptionsConfig": {
      "type": "object",
      "properties": {
        "requestBodyInspectionSize": {
          "description": "The maximum request size chosen by the customer with Waf enabled.\nValues supported are \"8KB\", \"16KB, \"32KB\", \"48KB\" and \"64KB\".\nValues are case insensitive.",
          "type": "string"
        },
        "logLevel": {
          "enum": [
            "NORMAL",
            "VERBOSE"
          ],
          "type": "string"
        },
        "jsonCustomConfig": {
          "$ref": "#/$defs/SecurityPolicyAdvancedOptionsConfigJsonCustomConfig",
          "description": "Custom configuration to apply the JSON parsing. Only applicable when\njson_parsing is set to STANDARD."
        },
        "jsonParsing": {
          "type": "string",
          "enum": [
            "DISABLED",
            "STANDARD",
            "STANDARD_WITH_GRAPHQL"
          ]
        },
        "userIpRequestHeaders": {
          "type": "array",
          "description": "An optional list of case-insensitive request header names to use for\nresolving the callers client IP address.",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "SecurityPolicyAdvancedOptionsConfigJsonCustomConfig": {
      "type": "object",
      "properties": {
        "contentTypes": {
          "items": {
            "type": "string"
          },
          "description": "A list of custom Content-Type header values to apply the JSON parsing.\n\nAs per RFC 1341, a Content-Type header value has the following format:\n\nContent-Type := type \"/\" subtype *[\";\" parameter]\n\nWhen configuring a custom Content-Type header value, only the\ntype/subtype needs to be specified, and the parameters should be\nexcluded.",
          "type": "array"
        }
      }
    },
    "SecurityPolicyAssociation": {
      "type": "object",
      "properties": {
        "excludedProjects": {
          "items": {
            "type": "string"
          },
          "description": "A list of projects to exclude from the security policy.",
          "type": "array"
        },
        "securityPolicyId": {
          "readOnly": true,
          "description": "Output only. [Output Only] The security policy ID of the association.",
          "type": "string"
        },
        "shortName": {
          "readOnly": true,
          "type": "string",
          "description": "Output only. [Output Only] The short name of the security policy of the association."
        },
        "name": {
          "type": "string",
          "description": "The name for an association."
        },
        "attachmentId": {
          "description": "The resource that the security policy is attached to.",
          "type": "string"
        },
        "displayName": {
          "readOnly": true,
          "type": "string",
          "description": "Output only. [Output Only] The display name of the security policy of the association.",
          "deprecated": true
        },
        "excludedFolders": {
          "type": "array",
          "description": "A list of folders to exclude from the security policy.",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "SecurityPolicyDdosProtectionConfig": {
      "type": "object",
      "properties": {
        "ddosProtection": {
          "type": "string",
          "enum": [
            "ADVANCED",
            "ADVANCED_PREVIEW",
            "STANDARD"
          ]
        },
        "ddosImpactedBaselineThreshold": {
          "format": "float",
          "type": "number",
          "description": "DDoS Protection for Network Load Balancers (and VMs with public IPs)\nbuilds DDoS mitigations that minimize collateral damage. It quantifies\nthis as the fraction of a non-abuse baseline that's inadvertently\nblocked.\n\nRules whose collateral damage exceeds ddosImpactedBaselineThreshold will\nnot be deployed. Using a lower value will prioritize keeping collateral\ndamage low, possibly at the cost of its effectiveness in rate limiting\nsome or all of the attack. It should typically be unset, so Advanced DDoS\n(and Adaptive Protection) uses the best mitigation it can find. Setting\nthe threshold is advised if there are logs for false positive detections\nwith high collateral damage, and will cause Advanced DDoS to attempt to\nfind a less aggressive rule that satisfies the constraint. If a suitable\nrule cannot be found, the system falls back to either no mitigation for\nsmaller attacks or broader network throttles for larger ones."
        },
        "ddosAdaptiveProtection": {
          "type": "string",
          "enum": [
            "DDOS_ADAPTIVE_PROTECTION_UNSPECIFIED",
            "DISABLED",
            "ENABLED",
            "PREVIEW",
            "UNSPECIFIED_ADAPTIVE_PROTECTION"
          ]
        }
      }
    },
    "SecurityPolicyRecaptchaOptionsConfig": {
      "type": "object",
      "properties": {
        "redirectSiteKey": {
          "type": "string",
          "description": "An optional field to supply a reCAPTCHA site key to be used for all the\nrules using the redirect action with the type of GOOGLE_RECAPTCHA under\nthe security policy. The specified site key needs to be created from the\nreCAPTCHA API. The user is responsible for the validity of the specified\nsite key. If not specified, a Google-managed site key is used.\nThis field is only supported in Global Security Policies of type\nCLOUD_ARMOR."
        }
      }
    },
    "SecurityPolicyRule": {
      "type": "object",
      "properties": {
        "kind": {
          "readOnly": true,
          "default": "compute#securityPolicyRule",
          "type": "string",
          "description": "Output only. [Output only] Type of the resource. Alwayscompute#securityPolicyRule for security policy rules"
        },
        "rateLimitOptions": {
          "$ref": "#/$defs/SecurityPolicyRuleRateLimitOptions",
          "description": "Must be specified if the action is \"rate_based_ban\" or \"throttle\" or\n\"fairshare\". Cannot be specified for any other actions."
        },
        "redirectOptions": {
          "$ref": "#/$defs/SecurityPolicyRuleRedirectOptions",
          "description": "Parameters defining the redirect action. Cannot be specified for any\nother actions.\nThis field is only supported in Global Security Policies of type\nCLOUD_ARMOR."
        },
        "networkMatch": {
          "$ref": "#/$defs/SecurityPolicyRuleNetworkMatcher",
          "description": "A match condition that incoming packets are evaluated against for\nCLOUD_ARMOR_NETWORK security policies. If it matches, the corresponding\n'action' is enforced.\n\nThe match criteria for a rule consists of built-in match fields (like\n'srcIpRanges') and potentially multiple user-defined match fields\n('userDefinedFields').\n\nField values may be extracted directly from the packet or derived from it\n(e.g. 'srcRegionCodes'). Some fields may not be present in every packet\n(e.g. 'srcPorts'). A user-defined field is only present if the base\nheader is found in the packet and the entire field is in bounds.\n\nEach match field may specify which values can match it, listing one or\nmore ranges, prefixes, or exact values that are considered a match for\nthe field. A field value must be present in order to match a specified\nmatch field. If no match values are specified for a match field, then any\nfield value is considered to match it, and it's not required to be\npresent. For strings specifying '*' is also equivalent to match all.\n\nFor a packet to match a rule, all specified match fields must match the\ncorresponding field values derived from the packet.\n\nExample:\n\nnetworkMatch:\n  srcIpRanges:\n  - \"192.0.2.0/24\"\n  - \"198.51.100.0/24\"\n  userDefinedFields:\n  - name: \"ipv4_fragment_offset\"\n    values:\n    - \"1-0x1fff\"\n\nThe above match condition matches packets with a source IP in\n192.0.2.0/24 or 198.51.100.0/24 and a user-defined field named\n\"ipv4_fragment_offset\" with a value between 1 and 0x1fff inclusive."
        },
        "description": {
          "description": "An optional description of this resource. Provide this property when you\ncreate the resource.",
          "type": "string"
        },
        "match": {
          "$ref": "#/$defs/SecurityPolicyRuleMatcher",
          "description": "A match condition that incoming traffic is evaluated against.\nIf it evaluates to true, the corresponding 'action' is enforced."
        },
        "headerAction": {
          "$ref": "#/$defs/SecurityPolicyRuleHttpHeaderAction",
          "description": "Optional, additional actions that are performed on headers.\nThis field is only supported in Global Security Policies of type\nCLOUD_ARMOR."
        },
        "priority": {
          "format": "int32",
          "type": "integer",
          "description": "An integer indicating the priority of a rule in the list. The priority\nmust be a positive value between 0 and 2147483647.\nRules are evaluated from highest to lowest priority where 0 is the\nhighest priority and 2147483647 is the lowest priority."
        },
        "preconfiguredWafConfig": {
          "$ref": "#/$defs/SecurityPolicyRulePreconfiguredWafConfig",
          "description": "Preconfigured WAF configuration to be applied for the rule. If the rule\ndoes not evaluate preconfigured WAF rules, i.e., if\nevaluatePreconfiguredWaf() is not used, this field will have no effect."
        },
        "preview": {
          "description": "If set to true, the specified action is not enforced.",
          "type": "boolean"
        },
        "action": {
          "type": "string",
          "description": "The Action to perform when the rule is matched.\nThe following are the valid actions:\n   \n   - allow: allow access to target.\n   - deny(STATUS): deny access to target, returns the\n   HTTP response code specified. Valid values for `STATUS`\n   are 403, 404, and 502.\n   - rate_based_ban: limit client traffic to the configured\n   threshold and ban the client if the traffic exceeds the threshold.\n   Configure parameters for this action in RateLimitOptions. Requires\n   rate_limit_options to be set.\n   - redirect: redirect to a different target. This can\n   either be an internal reCAPTCHA redirect, or an external URL-based\n   redirect via a 302 response. Parameters for this action can be configured\n   via redirectOptions. This action is only supported in Global Security\n   Policies of type CLOUD_ARMOR.\n   - throttle: limit\n   client traffic to the configured threshold. Configure parameters for this\n   action in rateLimitOptions. Requires rate_limit_options to be set for\n   this.\n   - fairshare (preview only): when traffic reaches the\n   threshold limit, requests from the clients matching this rule begin to be\n   rate-limited using the Fair Share algorithm. This action is only allowed\n   in security policies of type `CLOUD_ARMOR_INTERNAL_SERVICE`."
        }
      },
      "description": "Represents a rule that describes one or more match conditions along with\nthe action to be taken when traffic matches this condition (allow or deny)."
    },
    "SecurityPolicyRuleHttpHeaderAction": {
      "properties": {
        "requestHeadersToAdds": {
          "description": "The list of request headers to add or overwrite if they're already\npresent.",
          "items": {
            "$ref": "#/$defs/SecurityPolicyRuleHttpHeaderActionHttpHeaderOption"
          },
          "type": "array"
        }
      },
      "type": "object"
    },
    "SecurityPolicyRuleHttpHeaderActionHttpHeaderOption": {
      "properties": {
        "headerName": {
          "description": "The name of the header to set.",
          "type": "string"
        },
        "headerValue": {
          "type": "string",
          "description": "The value to set the named header to."
        }
      },
      "type": "object"
    },
    "SecurityPolicyRuleMatcher": {
      "properties": {
        "exprOptions": {
          "$ref": "#/$defs/SecurityPolicyRuleMatcherExprOptions",
          "description": "The configuration options available when specifying a user defined\nCEVAL expression (i.e., 'expr')."
        },
        "config": {
          "$ref": "#/$defs/SecurityPolicyRuleMatcherConfig",
          "description": "The configuration options available when specifying versioned_expr.\nThis field must be specified if versioned_expr is specified and cannot\nbe specified if versioned_expr is not specified."
        },
        "expr": {
          "$ref": "#/$defs/Expr",
          "description": "User defined CEVAL expression.\nA CEVAL expression is used to specify match criteria such as origin.ip,\nsource.region_code and contents in the request header.\nExpressions containing `evaluateThreatIntelligence` require a Cloud\nArmor Enterprise subscription and are not supported in Edge Policies\nnor in Regional Policies. Expressions containing\n`evaluatePreconfiguredExpr('sourceiplist-*')` require a Cloud Armor\nEnterprise subscription and are only supported in Global Security\nPolicies."
        },
        "versionedExpr": {
          "type": "string",
          "description": "Preconfigured versioned expression.\nIf this field is specified, config must also be specified.\nAvailable preconfigured expressions along with their requirements are:\nSRC_IPS_V1 - must specify the corresponding src_ip_range field in\nconfig.",
          "enum": [
            "SRC_IPS_V1"
          ]
        }
      },
      "description": "Represents a match condition that incoming traffic is evaluated against.\nExactly one field must be specified.",
      "type": "object"
    },
    "SecurityPolicyRuleMatcherConfig": {
      "properties": {
        "srcIpRanges": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "CIDR IP address range.\nMaximum number of src_ip_ranges allowed is 10."
        }
      },
      "type": "object"
    },
    "SecurityPolicyRuleMatcherExprOptions": {
      "type": "object",
      "properties": {
        "recaptchaOptions": {
          "$ref": "#/$defs/SecurityPolicyRuleMatcherExprOptionsRecaptchaOptions",
          "description": "reCAPTCHA configuration options to be applied for the rule. If the\nrule does not evaluate reCAPTCHA tokens, this field has no effect."
        }
      }
    },
    "SecurityPolicyRuleMatcherExprOptionsRecaptchaOptions": {
      "properties": {
        "sessionTokenSiteKeys": {
          "items": {
            "type": "string"
          },
          "description": "A list of site keys to be used during the validation of reCAPTCHA\nsession-tokens. The provided site keys need to be created from\nreCAPTCHA API under the same project where the security policy is\ncreated.",
          "type": "array"
        },
        "actionTokenSiteKeys": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "description": "A list of site keys to be used during the validation of reCAPTCHA\naction-tokens. The provided site keys need to be created from\nreCAPTCHA API under the same project where the security policy is\ncreated."
        }
      },
      "type": "object"
    },
    "SecurityPolicyRuleNetworkMatcher": {
      "description": "Represents a match condition that incoming network traffic is evaluated\nagainst.",
      "properties": {
        "ipProtocols": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "IPv4 protocol / IPv6 next header (after extension headers). Each\nelement can be an 8-bit unsigned decimal number (e.g. \"6\"), range (e.g.\n\"253-254\"), or one of the following protocol names: \"tcp\", \"udp\",\n\"icmp\", \"esp\", \"ah\", \"ipip\", or \"sctp\"."
        },
        "userDefinedFields": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/SecurityPolicyRuleNetworkMatcherUserDefinedFieldMatch"
          },
          "description": "User-defined fields. Each element names a defined field and lists the\nmatching values for that field."
        },
        "srcRegionCodes": {
          "description": "Two-letter ISO 3166-1 alpha-2 country code associated with the source\nIP address.",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "srcIpRanges": {
          "items": {
            "type": "string"
          },
          "description": "Source IPv4/IPv6 addresses or CIDR prefixes, in standard text format.",
          "type": "array"
        },
        "srcAsns": {
          "items": {
            "type": "integer",
            "format": "uint32"
          },
          "type": "array",
          "description": "BGP Autonomous System Number associated with the source IP address."
        },
        "destPorts": {
          "items": {
            "type": "string"
          },
          "description": "Destination port numbers for TCP/UDP/SCTP. Each element can be a 16-bit\nunsigned decimal number (e.g. \"80\") or range (e.g. \"0-1023\").",
          "type": "array"
        },
        "destIpRanges": {
          "description": "Destination IPv4/IPv6 addresses or CIDR prefixes, in standard text\nformat.",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "srcPorts": {
          "items": {
            "type": "string"
          },
          "description": "Source port numbers for TCP/UDP/SCTP. Each element can be a 16-bit\nunsigned decimal number (e.g. \"80\") or range (e.g. \"0-1023\").",
          "type": "array"
        }
      },
      "type": "object"
    },
    "SecurityPolicyRuleNetworkMatcherUserDefinedFieldMatch": {
      "type": "object",
      "properties": {
        "values": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Matching values of the field. Each element can be a 32-bit unsigned\ndecimal or hexadecimal (starting with \"0x\") number (e.g. \"64\") or\nrange (e.g.  \"0x400-0x7ff\")."
        },
        "name": {
          "type": "string",
          "description": "Name of the user-defined field, as given in the definition."
        }
      }
    },
    "SecurityPolicyRulePreconfiguredWafConfig": {
      "properties": {
        "exclusions": {
          "type": "array",
          "description": "A list of exclusions to apply during preconfigured WAF evaluation.",
          "items": {
            "$ref": "#/$defs/SecurityPolicyRulePreconfiguredWafConfigExclusion"
          }
        }
      },
      "type": "object"
    },
    "SecurityPolicyRulePreconfiguredWafConfigExclusion": {
      "type": "object",
      "properties": {
        "requestQueryParamsToExclude": {
          "items": {
            "$ref": "#/$defs/SecurityPolicyRulePreconfiguredWafConfigExclusionFieldParams"
          },
          "description": "A list of request query parameter names whose value will be excluded\nfrom inspection during preconfigured WAF evaluation. Note that the\nparameter can be in the query string or in the POST body.",
          "type": "array"
        },
        "requestBodiesToExclude": {
          "description": "A list of request body fields to be excluded from inspection during\npreconfigured WAF evaluation.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/SecurityPolicyRulePreconfiguredWafConfigExclusionFieldParams"
          }
        },
        "requestCookiesToExclude": {
          "items": {
            "$ref": "#/$defs/SecurityPolicyRulePreconfiguredWafConfigExclusionFieldParams"
          },
          "description": "A list of request cookie names whose value will be excluded from\ninspection during preconfigured WAF evaluation.",
          "type": "array"
        },
        "targetRuleSet": {
          "type": "string",
          "description": "Target WAF rule set to apply the preconfigured WAF exclusion."
        },
        "targetRuleIds": {
          "description": "A list of target rule IDs under the WAF rule set to apply the\npreconfigured WAF exclusion. If omitted, it refers to all the rule\nIDs under the WAF rule set.",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "requestUrisToExclude": {
          "description": "A list of request URIs from the request line to be excluded from\ninspection during preconfigured WAF evaluation. When specifying this\nfield, the query or fragment part should be excluded.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/SecurityPolicyRulePreconfiguredWafConfigExclusionFieldParams"
          }
        },
        "requestHeadersToExclude": {
          "type": "array",
          "description": "A list of request header names whose value will be excluded from\ninspection during preconfigured WAF evaluation.",
          "items": {
            "$ref": "#/$defs/SecurityPolicyRulePreconfiguredWafConfigExclusionFieldParams"
          }
        }
      }
    },
    "SecurityPolicyRulePreconfiguredWafConfigExclusionFieldParams": {
      "type": "object",
      "properties": {
        "val": {
          "type": "string",
          "description": "The value of the field."
        },
        "op": {
          "enum": [
            "CONTAINS",
            "ENDS_WITH",
            "EQUALS",
            "EQUALS_ANY",
            "STARTS_WITH"
          ],
          "description": "The match operator for the field.",
          "type": "string"
        }
      }
    },
    "SecurityPolicyRuleRateLimitOptions": {
      "properties": {
        "banThreshold": {
          "$ref": "#/$defs/SecurityPolicyRuleRateLimitOptionsThreshold",
          "description": "Can only be specified if the action for the rule is\n\"rate_based_ban\". If specified, the key will be banned for the\nconfigured 'ban_duration_sec' when the number of requests that exceed\nthe 'rate_limit_threshold' also exceed this 'ban_threshold'."
        },
        "rateLimitThreshold": {
          "$ref": "#/$defs/SecurityPolicyRuleRateLimitOptionsThreshold",
          "description": "Threshold at which to begin ratelimiting."
        },
        "conformAction": {
          "type": "string",
          "description": "Action to take for requests that are under the configured rate limit\nthreshold. Valid option is \"allow\" only."
        },
        "enforceOnKeyConfigs": {
          "description": "If specified, any combination of values of\nenforce_on_key_type/enforce_on_key_name is treated as the key on which\nratelimit threshold/action is enforced. You can specify up to 3\nenforce_on_key_configs. If enforce_on_key_configs is specified,\nenforce_on_key must not be specified.",
          "items": {
            "$ref": "#/$defs/SecurityPolicyRuleRateLimitOptionsEnforceOnKeyConfig"
          },
          "type": "array"
        },
        "enforceOnKey": {
          "type": "string",
          "description": "Determines the key to enforce the rate_limit_threshold on. Possible\nvalues are:\n   \n   - ALL: A single rate limit threshold is applied to all\n   the requests matching this rule. This is the default value if\n   \"enforceOnKey\" is not configured.\n   - IP: The source IP address of\n   the request is the key. Each IP has this limit enforced\n   separately.\n   - HTTP_HEADER: The value of the HTTP\n   header whose name is configured under \"enforceOnKeyName\". The key\n   value is truncated to the first 128 bytes of the header value. If no\n   such header is present in the request, the key type defaults toALL.\n   - XFF_IP: The first IP address (i.e. the\n   originating client IP address) specified in the list of IPs under\n   X-Forwarded-For HTTP header. If no such header is present or the value\n   is not a valid IP, the key defaults to the source IP address of\n   the request i.e. key type IP.\n   - HTTP_COOKIE: The value of the HTTP\n   cookie whose name is configured under \"enforceOnKeyName\". The key\n   value is truncated to the first 128 bytes of the cookie value. If no\n   such cookie is present in the request, the key type defaults toALL.\n   - HTTP_PATH: The URL path of the HTTP request. The key\n   value is truncated to the first 128 bytes. \n   - SNI: Server name indication in the TLS session of the\n   HTTPS request. The key value is truncated to the first 128 bytes. The\n   key type defaults to ALL on a HTTP session. \n   - REGION_CODE: The country/region from which the request\n   originates. \n   - TLS_JA3_FINGERPRINT: JA3 TLS/SSL fingerprint if the\n   client connects using HTTPS, HTTP/2 or HTTP/3. If not available, the\n   key type defaults to ALL. \n   - USER_IP: The IP address of the originating client,\n   which is resolved based on \"userIpRequestHeaders\" configured with the\n   security policy. If there is no \"userIpRequestHeaders\" configuration or\n   an IP address cannot be resolved from it, the key type defaults toIP. \n   - ASN: The autonomous system number of the originating\n   client. If not available, the key type defaults toALL.\n   - TLS_JA4_FINGERPRINT: JA4 TLS/SSL fingerprint if the\n   client connects using HTTPS, HTTP/2 or HTTP/3. If not available, the\n   key type defaults to ALL. \n\n\nFor \"fairshare\" action, this value is limited to ALL i.e. a single rate\nlimit threshold is enforced for all the requests matching the rule.",
          "enum": [
            "ALL",
            "ASN",
            "HTTP_COOKIE",
            "HTTP_HEADER",
            "HTTP_PATH",
            "IP",
            "REGION_CODE",
            "SNI",
            "TLS_JA3_FINGERPRINT",
            "TLS_JA4_FINGERPRINT",
            "USER_IP",
            "XFF_IP"
          ]
        },
        "exceedRedirectOptions": {
          "$ref": "#/$defs/SecurityPolicyRuleRedirectOptions",
          "description": "Parameters defining the redirect action that is used as the exceed\naction. Cannot be specified if the exceed action is not redirect.\nThis field is only supported in Global Security Policies of type\nCLOUD_ARMOR."
        },
        "exceedAction": {
          "type": "string",
          "description": "Action to take for requests that are above the configured rate limit\nthreshold, to either deny with a specified HTTP response code, or\nredirect to a different endpoint.\nValid options are `deny(STATUS)`, where valid values for\n`STATUS` are 403, 404, 429, and 502, and\n`redirect`, where the redirect parameters come from\n`exceedRedirectOptions` below.\nThe `redirect` action is only supported in Global Security Policies of\ntype CLOUD_ARMOR."
        },
        "banDurationSec": {
          "type": "integer",
          "format": "int32",
          "description": "Can only be specified if the action for the rule is\n\"rate_based_ban\". If specified, determines the time (in seconds)\nthe traffic will continue to be banned by the rate limit after the\nrate falls below the threshold."
        },
        "enforceOnKeyName": {
          "type": "string",
          "description": "Rate limit key name applicable only for the following key types:\nHTTP_HEADER -- Name of the HTTP header whose value is taken as the key\nvalue.\nHTTP_COOKIE -- Name of the HTTP cookie whose value is taken as the key\nvalue."
        }
      },
      "type": "object"
    },
    "SecurityPolicyRuleRateLimitOptionsEnforceOnKeyConfig": {
      "properties": {
        "enforceOnKeyType": {
          "description": "Determines the key to enforce the rate_limit_threshold on. Possible\nvalues are:\n   \n   - ALL: A single rate limit threshold is applied to all\n   the requests matching this rule. This is the default value if\n   \"enforceOnKeyConfigs\" is not configured.\n   - IP: The source IP address of\n   the request is the key. Each IP has this limit enforced\n   separately.\n   - HTTP_HEADER: The value of the HTTP\n   header whose name is configured under \"enforceOnKeyName\". The key\n   value is truncated to the first 128 bytes of the header value. If no\n   such header is present in the request, the key type defaults toALL.\n   - XFF_IP: The first IP address (i.e. the\n   originating client IP address) specified in the list of IPs under\n   X-Forwarded-For HTTP header. If no such header is present or the\n   value is not a valid IP, the key defaults to the source IP address of\n   the request i.e. key type IP.\n   - HTTP_COOKIE: The value of the HTTP\n   cookie whose name is configured under \"enforceOnKeyName\". The key\n   value is truncated to the first 128 bytes of the cookie value. If no\n   such cookie is present in the request, the key type defaults toALL.\n   - HTTP_PATH: The URL path of the HTTP request. The key\n   value is truncated to the first 128 bytes. \n   - SNI: Server name indication in the TLS session of\n   the HTTPS request. The key value is truncated to the first 128 bytes.\n   The key type defaults to ALL on a HTTP session. \n   - REGION_CODE: The country/region from which the\n   request originates. \n   - TLS_JA3_FINGERPRINT: JA3 TLS/SSL fingerprint if the\n   client connects using HTTPS, HTTP/2 or HTTP/3. If not available, the\n   key type defaults to ALL. \n   - USER_IP: The IP address of the originating client,\n   which is resolved based on \"userIpRequestHeaders\" configured with the\n   security policy. If there is no \"userIpRequestHeaders\" configuration\n   or an IP address cannot be resolved from it, the key type defaults toIP. \n   - ASN: The autonomous system number of the originating\n   client. If not available, the key type defaults toALL.\n   - TLS_JA4_FINGERPRINT: JA4 TLS/SSL fingerprint if the\n   client connects using HTTPS, HTTP/2 or HTTP/3. If not available, the\n   key type defaults to ALL.",
          "type": "string",
          "enum": [
            "ALL",
            "ASN",
            "HTTP_COOKIE",
            "HTTP_HEADER",
            "HTTP_PATH",
            "IP",
            "REGION_CODE",
            "SNI",
            "TLS_JA3_FINGERPRINT",
            "TLS_JA4_FINGERPRINT",
            "USER_IP",
            "XFF_IP"
          ]
        },
        "enforceOnKeyName": {
          "description": "Rate limit key name applicable only for the following key types:\nHTTP_HEADER -- Name of the HTTP header whose value is taken as the\nkey value. HTTP_COOKIE -- Name of the HTTP cookie whose value is\ntaken as the key value.",
          "type": "string"
        }
      },
      "type": "object"
    },
    "SecurityPolicyRuleRateLimitOptionsThreshold": {
      "type": "object",
      "properties": {
        "intervalSec": {
          "type": "integer",
          "format": "int32",
          "description": "Interval over which the threshold is computed."
        },
        "count": {
          "type": "integer",
          "format": "int32",
          "description": "Number of HTTP(S) requests for calculating the threshold."
        }
      }
    },
    "SecurityPolicyRuleRedirectOptions": {
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "EXTERNAL_302",
            "GOOGLE_RECAPTCHA"
          ],
          "description": "Type of the redirect action. Possible values are:\n   \n   - GOOGLE_RECAPTCHA: redirect to reCAPTCHA for manual\n   challenge assessment.\n   - EXTERNAL_302: redirect to a different URL via a 302\n   response."
        },
        "target": {
          "description": "Target for the redirect action. This is required if the type is\nEXTERNAL_302 and cannot be specified for GOOGLE_RECAPTCHA.",
          "type": "string"
        }
      },
      "type": "object"
    },
    "SecurityPolicyUserDefinedField": {
      "type": "object",
      "properties": {
        "mask": {
          "type": "string",
          "description": "If specified, apply this mask (bitwise AND) to the field to ignore bits\nbefore matching. Encoded as a hexadecimal number (starting with \"0x\").\nThe last byte of the field (in network byte order) corresponds to the\nleast significant byte of the mask."
        },
        "base": {
          "description": "The base relative to which 'offset' is measured. Possible values are:\n   \n   - IPV4: Points to the beginning of the IPv4 header.\n   - IPV6: Points to the beginning of the IPv6 header.\n   - TCP: Points to the beginning of the TCP header, skipping\n   over any IPv4 options or IPv6 extension headers. Not present for\n   non-first fragments.\n   - UDP: Points to the beginning of the UDP header, skipping\n   over any IPv4 options or IPv6 extension headers. Not present for\n   non-first fragments.\n\n\nrequired",
          "enum": [
            "IPV4",
            "IPV6",
            "TCP",
            "UDP"
          ],
          "type": "string"
        },
        "offset": {
          "type": "integer",
          "format": "int32",
          "description": "Offset of the first byte of the field (in network byte order) relative to\n'base'."
        },
        "name": {
          "description": "The name of this field. Must be unique within the policy.",
          "type": "string"
        },
        "size": {
          "format": "int32",
          "type": "integer",
          "description": "Size of the field in bytes. Valid values: 1-4."
        }
      }
    }
  }
}