Skip to main content

authz_policies

Creates, updates, deletes, gets or lists an authz_policies resource.

Overview

Nameauthz_policies
TypeResource
Idgoogle.networksecurity.authz_policies

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringRequired. Identifier. Name of the AuthzPolicy resource in the following format: projects/{project}/locations/{location}/authzPolicies/{authz_policy}.
actionstringRequired. Can be one of ALLOW, DENY, CUSTOM. When the action is CUSTOM, customProvider must be specified. When the action is ALLOW, only requests matching the policy will be allowed. When the action is DENY, only requests matching the policy will be denied. When a request arrives, the policies are evaluated in the following order: 1. If there is a CUSTOM policy that matches the request, the CUSTOM policy is evaluated using the custom authorization providers and the request is denied if the provider rejects the request. 2. If there are any DENY policies that match the request, the request is denied. 3. If there are no ALLOW policies for the resource or if any of the ALLOW policies match the request, the request is allowed. 4. Else the request is denied by default if none of the configured AuthzPolicies with ALLOW action match the request.
createTimestring (google-datetime)Output only. The timestamp when the resource was created.
customProviderobjectOptional. Required if the action is CUSTOM. Allows delegating authorization decisions to Cloud IAP or to Service Extensions. One of cloudIap or authzExtension must be specified. (id: AuthzPolicyCustomProvider)
descriptionstringOptional. A human-readable description of the resource.
httpRulesarrayOptional. A list of authorization HTTP rules to match against the incoming request. A policy match occurs when at least one HTTP rule matches the request or when no HTTP rules are specified in the policy. At least one HTTP Rule is required for Allow or Deny Action. Limited to 5 rules.
labelsobjectOptional. Set of labels associated with the AuthzPolicy resource. The format must comply with the following requirements.
targetobjectRequired. Specifies the set of resources to which this policy should be applied to. (id: AuthzPolicyTarget)
updateTimestring (google-datetime)Output only. The timestamp when the resource was updated.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
projects_locations_authz_policies_getselectprojectsId, locationsId, authzPoliciesIdGets details of a single AuthzPolicy.
projects_locations_authz_policies_listselectprojectsId, locationsIdpageSize, pageToken, filter, orderByLists AuthzPolicies in a given project and location.
projects_locations_authz_policies_createinsertprojectsId, locationsIdauthzPolicyId, requestIdCreates a new AuthzPolicy in a given project and location.
projects_locations_authz_policies_patchupdateprojectsId, locationsId, authzPoliciesIdupdateMask, requestIdUpdates the parameters of a single AuthzPolicy.
projects_locations_authz_policies_deletedeleteprojectsId, locationsId, authzPoliciesIdrequestIdDeletes a single AuthzPolicy.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
authzPoliciesIdstring
locationsIdstring
projectsIdstring
authzPolicyIdstring
filterstring
orderBystring
pageSizeinteger (int32)
pageTokenstring
requestIdstring
updateMaskstring (google-fieldmask)

SELECT examples

Gets details of a single AuthzPolicy.

SELECT
name,
action,
createTime,
customProvider,
description,
httpRules,
labels,
target,
updateTime
FROM google.networksecurity.authz_policies
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND authzPoliciesId = '{{ authzPoliciesId }}' -- required;

INSERT examples

Creates a new AuthzPolicy in a given project and location.

INSERT INTO google.networksecurity.authz_policies (
data__name,
data__description,
data__labels,
data__target,
data__httpRules,
data__action,
data__customProvider,
projectsId,
locationsId,
authzPolicyId,
requestId
)
SELECT
'{{ name }}',
'{{ description }}',
'{{ labels }}',
'{{ target }}',
'{{ httpRules }}',
'{{ action }}',
'{{ customProvider }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ authzPolicyId }}',
'{{ requestId }}'
RETURNING
name,
done,
error,
metadata,
response
;

UPDATE examples

Updates the parameters of a single AuthzPolicy.

UPDATE google.networksecurity.authz_policies
SET
data__name = '{{ name }}',
data__description = '{{ description }}',
data__labels = '{{ labels }}',
data__target = '{{ target }}',
data__httpRules = '{{ httpRules }}',
data__action = '{{ action }}',
data__customProvider = '{{ customProvider }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND authzPoliciesId = '{{ authzPoliciesId }}' --required
AND updateMask = '{{ updateMask}}'
AND requestId = '{{ requestId}}'
RETURNING
name,
done,
error,
metadata,
response;

DELETE examples

Deletes a single AuthzPolicy.

DELETE FROM google.networksecurity.authz_policies
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND authzPoliciesId = '{{ authzPoliciesId }}' --required
AND requestId = '{{ requestId }}';