v1

latestOpenAPI 3.0.0Creative Commons Attribution 3.02026-07-131,0021,0174.3 MB
regionNetworkFirewallPolicies

Inserts a rule into a network firewall policy.

post/projects/{project}/regions/{region}/firewallPolicies/{firewallPolicy}/addRule

Path parameters

projectstring required

Project ID for this request.

regionstring required

Name of the region scoping this request.

firewallPolicystring required

Name of the firewall policy to update.

Query parameters

maxPriorityinteger

When rule.priority is not specified, auto choose a unused priority betweenminPriority and maxPriority>. This field is exclusive with rule.priority.

minPriorityinteger

When rule.priority is not specified, auto choose a unused priority betweenminPriority and maxPriority>. This field is exclusive with rule.priority.

requestIdstring

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

disabledboolean

Denotes whether the firewall policy rule is disabled. When set to true, the firewall policy rule is not enforced and traffic behaves as if it did not exist. If this is unspecified, the firewall policy rule will be enabled.

tlsInspectboolean

Boolean flag indicating if the traffic should be TLS decrypted. Can be set only if action = 'apply_security_profile_group' and cannot be set for other actions.

descriptionstring

An optional description for this resource.

actionstring

The Action to perform when the client connection triggers the rule. Valid actions for firewall rules are: "allow", "deny", "apply_security_profile_group" and "goto_next" ( "apply_security_profile_group" can be specified only for global network firewall policies or hierarchical firewall policies). Valid actions for packet mirroring rules are: "mirror", "do_not_mirror" and "goto_next".

targetType'INSTANCES' | 'INTERNAL_MANAGED_LB'

Target types of the firewall policy rule. Default value is INSTANCES.

direction'EGRESS' | 'INGRESS'

The direction in which this rule applies.

targetServiceAccountsstring[]

A list of service accounts indicating the sets of instances that are applied with this rule.

kindstring

Output only. [Output only] Type of the resource. Returnscompute#firewallPolicyRule for firewall rules andcompute#packetMirroringRule for packet mirroring rules.

ruleNamestring

An optional name for the rule. This field is not a unique identifier and can be updated.

targetForwardingRulesstring[]

A list of forwarding rules to which this rule applies. This field allows you to control which load balancers get this rule. For example, the following are valid values:

 - https://www.googleapis.com/compute/v1/projects/project/global/forwardingRules/forwardingRule
 - https://www.googleapis.com/compute/v1/projects/project/regions/region/forwardingRules/forwardingRule
 - projects/project/global/
 forwardingRules/forwardingRule
 - projects/project/regions/region/forwardingRules/
 forwardingRule
priorityinteger

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.

targetResourcesstring[]

A list of network resource URLs to which this rule applies. This field allows you to control which network's VMs get this rule. If this field is left blank, all VMs within the organization will receive the rule.

ruleTupleCountinteger

Output only. [Output Only] Calculation of the complexity of a single firewall policy rule.

securityProfileGroupstring

A fully-qualified URL of a SecurityProfileGroup resource instance. Example: https://networksecurity.googleapis.com/v1/projects/{project}/locations/{location}/securityProfileGroups/my-security-profile-group Must be specified if action is one of 'apply_security_profile_group' or 'mirror'. Cannot be specified for other actions. Can be specified only for global network firewall policies or hierarchical firewall policies.

enableLoggingboolean

Denotes whether to enable logging for a particular rule. If logging is enabled, logs will be exported to the configured export destination in Stackdriver. Logs may be exported to BigQuery or Pub/Sub. Note: you cannot enable logging on "goto_next" rules.

Response

Successful response