REST Resource: accessPolicies.servicePerimeters

Resource: ServicePerimeter

ServicePerimeter describes a set of Google Cloud resources which can freely import and export data amongst themselves, but not export outside of the ServicePerimeter. If a request with a source within this ServicePerimeter has a target outside of the ServicePerimeter, the request is blocked. Otherwise the request is allowed. There are two types of service perimeter: regular and bridge. Regular perimeters cannot overlap, a single Google Cloud project or VPC network can only belong to a single regular perimeter. Perimeter bridges can contain only Google Cloud projects as members, a single Google Cloud project might belong to multiple Service perimeter bridges.

JSON representation
{
  "name": string,
  "title": string,
  "description": string,
  "perimeterType": enum (PerimeterType),
  "status": {
    object (ServicePerimeterConfig)
  },
  "spec": {
    object (ServicePerimeterConfig)
  },
  "useExplicitDryRunSpec": boolean,
  "etag": string
}
Fields
name

string

Identifier. Resource name for the ServicePerimeter. Format: accessPolicies/{access_policy}/servicePerimeters/{servicePerimeter}.

The servicePerimeter component must begin with a letter, followed by alphanumeric characters or _.

After you create a ServicePerimeter, you cannot change its name.

title

string

Human readable title. Must be unique within the Policy.

description

string

Description of the ServicePerimeter and its use. Does not affect behavior.

perimeterType

enum (PerimeterType)

Perimeter type indicator. A single project or VPC network is allowed to be a member of single regular perimeter, but a project can be in multiple service perimeter bridges. A project cannot be a included in a perimeter bridge without being included in regular perimeter. For perimeter bridges, the restricted service list as well as access level lists must be empty.

status

object (ServicePerimeterConfig)

Current ServicePerimeter configuration. Specifies sets of resources, restricted services and access levels that determine perimeter content and boundaries.

spec

object (ServicePerimeterConfig)

Proposed (or dry run) ServicePerimeter configuration. This configuration allows to specify and test ServicePerimeter configuration without enforcing actual access restrictions. Only allowed to be set when the "useExplicitDryRunSpec" flag is set.

useExplicitDryRunSpec

boolean

Use explicit dry run spec flag. Ordinarily, a dry-run spec implicitly exists for all Service Perimeters, and that spec is identical to the status for those Service Perimeters. When this flag is set, it inhibits the generation of the implicit spec, thereby allowing the user to explicitly provide a configuration ("spec") to use in a dry-run version of the Service Perimeter. This allows the user to test changes to the enforced config ("status") without actually enforcing them. This testing is done through analyzing the differences between currently enforced and suggested restrictions. useExplicitDryRunSpec must bet set to True if any of the fields in the spec are set to non-default values.

etag

string

Optional. An opaque identifier for the current version of the ServicePerimeter. This identifier does not follow any specific format. If an etag is not provided, the operation will be performed as if a valid etag is provided.

PerimeterType

Specifies the type of the Perimeter. There are two types: regular and bridge. Regular Service Perimeter contains resources, access levels, and restricted services. Every resource can be in at most ONE regular Service Perimeter.

In addition to being in a regular service perimeter, a resource can also be in zero or more perimeter bridges. A perimeter bridge only contains resources. Cross project operations are permitted if all effected resources share some perimeter (whether bridge or regular). Perimeter Bridge does not contain access levels or services: those are governed entirely by the regular perimeter that resource is in.

Perimeter Bridges are typically useful when building more complex toplogies with many independent perimeters that need to share some data with a common perimeter, but should not be able to share data among themselves.

Enums
PERIMETER_TYPE_REGULAR Regular Perimeter. When no value is specified, the perimeter uses this type.
PERIMETER_TYPE_BRIDGE Perimeter Bridge.

ServicePerimeterConfig

ServicePerimeterConfig specifies a set of Google Cloud resources that describe specific Service Perimeter configuration.

JSON representation
{
  "resources": [
    string
  ],
  "accessLevels": [
    string
  ],
  "restrictedServices": [
    string
  ],
  "vpcAccessibleServices": {
    object (VpcAccessibleServices)
  },
  "ingressPolicies": [
    {
      object (IngressPolicy)
    }
  ],
  "egressPolicies": [
    {
      object (EgressPolicy)
    }
  ]
}
Fields
resources[]

string

A list Google Cloud resources that are inside of the service perimeter. Only projects and VPCs are allowed. Project format: projects/{projectNumber}. VPC network format: //compute.googleapis.com/projects/{PROJECT_ID}/global/networks/{NETWORK_NAME}.

accessLevels[]

string

A list of AccessLevel resource names that allow resources within the ServicePerimeter to be accessed from the internet. AccessLevels listed must be in the same policy as this ServicePerimeter. Referencing a nonexistent AccessLevel is a syntax error. If no AccessLevel names are listed, resources within the perimeter can only be accessed through Google Cloud calls with request origins within the perimeter. Example: "accessPolicies/MY_POLICY/accessLevels/MY_LEVEL". For Service Perimeter Bridge, must be empty.

restrictedServices[]

string

Google Cloud services that are subject to the Service Perimeter restrictions. For example, if storage.googleapis.com is specified, access to the storage buckets inside the perimeter must meet the perimeter's access restrictions.

vpcAccessibleServices

object (VpcAccessibleServices)

Configuration for APIs allowed within Perimeter.

ingressPolicies[]

object (IngressPolicy)

List of IngressPolicies to apply to the perimeter. A perimeter may have multiple IngressPolicies, each of which is evaluated separately. Access is granted if any Ingress Policy grants it. Must be empty for a perimeter bridge.

egressPolicies[]

object (EgressPolicy)

List of EgressPolicies to apply to the perimeter. A perimeter may have multiple EgressPolicies, each of which is evaluated separately. Access is granted if any EgressPolicy grants it. Must be empty for a perimeter bridge.

VpcAccessibleServices

Specifies how APIs are allowed to communicate within the Service Perimeter.

JSON representation
{
  "enableRestriction": boolean,
  "allowedServices": [
    string
  ]
}
Fields
enableRestriction

boolean

Whether to restrict API calls within the Service Perimeter to the list of APIs specified in 'allowedServices'.

allowedServices[]

string

The list of APIs usable within the Service Perimeter. Must be empty unless 'enableRestriction' is True. You can specify a list of individual services, as well as include the 'RESTRICTED-SERVICES' value, which automatically includes all of the services protected by the perimeter.

IngressPolicy

Policy for ingress into ServicePerimeter.

IngressPolicies match requests based on ingressFrom and ingressTo stanzas. For an ingress policy to match, both the ingressFrom and ingressTo stanzas must be matched. If an IngressPolicy matches a request, the request is allowed through the perimeter boundary from outside the perimeter.

For example, access from the internet can be allowed either based on an AccessLevel or, for traffic hosted on Google Cloud, the project of the source network. For access from private networks, using the project of the hosting network is required.

Individual ingress policies can be limited by restricting which services and/or actions they match using the ingressTo field.

JSON representation
{
  "ingressFrom": {
    object (IngressFrom)
  },
  "ingressTo": {
    object (IngressTo)
  }
}
Fields
ingressFrom

object (IngressFrom)

Defines the conditions on the source of a request causing this IngressPolicy to apply.

ingressTo

object (IngressTo)

Defines the conditions on the ApiOperation and request destination that cause this IngressPolicy to apply.

IngressFrom

Defines the conditions under which an IngressPolicy matches a request. Conditions are based on information about the source of the request. The request must satisfy what is defined in sources AND identity related fields in order to match.

JSON representation
{
  "sources": [
    {
      object (IngressSource)
    }
  ],
  "identities": [
    string
  ],
  "identityType": enum (IdentityType)
}
Fields
sources[]

object (IngressSource)

Sources that this IngressPolicy authorizes access from.

identities[]

string

A list of identities that are allowed access through IngressPolicy. Identities can be an individual user, service account, Google group, or third-party identity. For third-party identity, only single identities are supported and other identity types are not supported. The v1 identities that have the prefix user, group, serviceAccount, and principal in https://cloud.google.com/iam/docs/principal-identifiers#v1 are supported.

identityType

enum (IdentityType)

Specifies the type of identities that are allowed access from outside the perimeter. If left unspecified, then members of identities field will be allowed access.

IngressSource

The source that IngressPolicy authorizes access from.

JSON representation
{

  // Union field source can be only one of the following:
  "accessLevel": string,
  "resource": string
  // End of list of possible types for union field source.
}
Fields
Union field source. Allowed ingress source. It can be one of AccessLevel or Google Cloud resource. source can be only one of the following:
accessLevel

string

An AccessLevel resource name that allows resources within the ServicePerimeters to be accessed from the internet. AccessLevels listed must be in the same policy as this ServicePerimeter. Referencing a nonexistent AccessLevel will cause an error. If an AccessLevel AccessLevel name is not specified, resources within the perimeter can only be accessed through Google Cloud calls with request origins within the perimeter. Example: accessPolicies/MY_POLICY/accessLevels/MY_LEVEL. If a single * is specified for accessLevel, then all IngressSources will be allowed.

resource

string

A Google Cloud resource that is allowed to ingress the perimeter. Requests from these resources are allowed to access perimeter data. Only projects and VPCs are allowed. Project format: projects/{projectNumber}. VPC network format: //compute.googleapis.com/projects/{PROJECT_ID}/global/networks/{NETWORK_NAME}. The resource might be in any Google Cloud organization, not just the organization that the perimeter is defined in. * is not allowed, the case of allowing all Google Cloud resources only is not supported.

IdentityType

Specifies the types of identities that are allowed access in either IngressFrom or EgressFrom rules.

Enums
IDENTITY_TYPE_UNSPECIFIED No blanket identity group specified.
ANY_IDENTITY Authorize access from all identities outside the perimeter.
ANY_USER_ACCOUNT Authorize access from all human users outside the perimeter.
ANY_SERVICE_ACCOUNT Authorize access from all service accounts outside the perimeter.

IngressTo

Defines the conditions under which an IngressPolicy matches a request. Conditions are based on information about the ApiOperation intended to be performed on the target resource of the request. The request must satisfy what is defined in operations AND resources in order to match.

JSON representation
{
  "operations": [
    {
      object (ApiOperation)
    }
  ],
  "resources": [
    string
  ],
  "roles": [
    string
  ]
}
Fields
operations[]

object (ApiOperation)

A list of ApiOperations the sources specified in corresponding IngressFrom are allowed to perform in this ServicePerimeter.

resources[]

string

A list of resources, currently only projects in the form projects/<projectnumber>, protected by this ServicePerimeter that are allowed to be accessed by sources defined in the corresponding IngressFrom. If a single * is specified, then access to all resources inside the perimeter are allowed.

roles[]

string

IAM roles that represent the set of operations that the sources specified in the corresponding IngressFrom are allowed to perform in this ServicePerimeter.

ApiOperation

Identification for an API Operation.

JSON representation
{
  "serviceName": string,
  "methodSelectors": [
    {
      object (MethodSelector)
    }
  ]
}
Fields
serviceName

string

The name of the API whose methods or permissions the IngressPolicy or EgressPolicy want to allow. A single ApiOperation with serviceName field set to * will allow all methods AND permissions for all services.

methodSelectors[]

object (MethodSelector)

API methods or permissions to allow. Method or permission must belong to the service specified by serviceName field. A single MethodSelector entry with * specified for the method field will allow all methods AND permissions for the service specified in serviceName.

EgressPolicy

Policy for egress from perimeter.

EgressPolicies match requests based on egressFrom and egressTo stanzas. For an EgressPolicy to match, both egressFrom and egressTo stanzas must be matched. If an EgressPolicy matches a request, the request is allowed to span the ServicePerimeter boundary. For example, an EgressPolicy can be used to allow VMs on networks within the ServicePerimeter to access a defined set of projects outside the perimeter in certain contexts (e.g. to read data from a Cloud Storage bucket or query against a BigQuery dataset).

EgressPolicies are concerned with the resources that a request relates as well as the API services and API actions being used. They do not related to the direction of data movement. More detailed documentation for this concept can be found in the descriptions of EgressFrom and EgressTo.

JSON representation
{
  "egressFrom": {
    object (EgressFrom)
  },
  "egressTo": {
    object (EgressTo)
  }
}
Fields
egressFrom

object (EgressFrom)

Defines conditions on the source of a request causing this EgressPolicy to apply.

egressTo

object (EgressTo)

Defines the conditions on the ApiOperation and destination resources that cause this EgressPolicy to apply.

EgressFrom

Defines the conditions under which an EgressPolicy matches a request. Conditions based on information about the source of the request. Note that if the destination of the request also is protected by a ServicePerimeter, then that ServicePerimeter must have an IngressPolicy which allows access in order for this request to succeed.

JSON representation
{
  "identities": [
    string
  ],
  "identityType": enum (IdentityType),
  "sources": [
    {
      object (EgressSource)
    }
  ],
  "sourceRestriction": enum (SourceRestriction)
}
Fields
identities[]

string

A list of identities that are allowed access through EgressPolicy. Identities can be an individual user, service account, Google group, or third-party identity. For third-party identity, only single identities are supported and other identity types are not supported. The v1 identities that have the prefix user, group, serviceAccount, and principal in https://cloud.google.com/iam/docs/principal-identifiers#v1 are supported.

identityType

enum (IdentityType)

Specifies the type of identities that are allowed access to outside the perimeter. If left unspecified, then members of identities field will be allowed access.

sources[]

object (EgressSource)

Sources that this EgressPolicy authorizes access from. If this field is not empty, then sourceRestriction must be set to SOURCE_RESTRICTION_ENABLED.

sourceRestriction

enum (SourceRestriction)

Whether to enforce traffic restrictions based on sources field. If the sources fields is non-empty, then this field must be set to SOURCE_RESTRICTION_ENABLED.

EgressSource

The source that EgressPolicy authorizes access from inside the ServicePerimeter to somewhere outside the ServicePerimeter boundaries.

JSON representation
{

  // Union field source can be only one of the following:
  "accessLevel": string
  // End of list of possible types for union field source.
}
Fields
Union field source. Allowed egress source. source can be only one of the following:
accessLevel

string

An AccessLevel resource name that allows protected resources inside the ServicePerimeters to access outside the ServicePerimeter boundaries. AccessLevels listed must be in the same policy as this ServicePerimeter. Referencing a nonexistent AccessLevel will cause an error. If an AccessLevel name is not specified, only resources within the perimeter can be accessed through Google Cloud calls with request origins within the perimeter. Example: accessPolicies/MY_POLICY/accessLevels/MY_LEVEL. If a single * is specified for accessLevel, then all EgressSources will be allowed.

SourceRestriction

Whether to enable the enforcement of traffic based on the sources field. Only applies to EgressFrom.

Enums
SOURCE_RESTRICTION_UNSPECIFIED Enforcement preference unspecified, will not enforce traffic restrictions based on sources in EgressFrom.
SOURCE_RESTRICTION_ENABLED Enforcement preference enabled, traffic restrictions will be enforced based on sources in EgressFrom.
SOURCE_RESTRICTION_DISABLED Enforcement preference disabled, will not enforce traffic restrictions based on sources in EgressFrom.

EgressTo

Defines the conditions under which an EgressPolicy matches a request. Conditions are based on information about the ApiOperation intended to be performed on the resources specified. Note that if the destination of the request is also protected by a ServicePerimeter, then that ServicePerimeter must have an IngressPolicy which allows access in order for this request to succeed. The request must match operations AND resources fields in order to be allowed egress out of the perimeter.

JSON representation
{
  "resources": [
    string
  ],
  "operations": [
    {
      object (ApiOperation)
    }
  ],
  "externalResources": [
    string
  ],
  "roles": [
    string
  ]
}
Fields
resources[]

string

A list of resources, currently only projects in the form projects/<projectnumber>, that are allowed to be accessed by sources defined in the corresponding EgressFrom. A request matches if it contains a resource in this list. If * is specified for resources, then this EgressTo rule will authorize access to all resources outside the perimeter.

operations[]

object (ApiOperation)

A list of ApiOperations allowed to be performed by the sources specified in the corresponding EgressFrom. A request matches if it uses an operation/service in this list.

externalResources[]

string

A list of external resources that are allowed to be accessed. Only AWS and Azure resources are supported. For Amazon S3, the supported formats are s3://BUCKET_NAME, s3a://BUCKET_NAME, and s3n://BUCKET_NAME. For Azure Storage, the supported format is azure://myaccount.blob.core.windows.net/CONTAINER_NAME. A request matches if it contains an external resource in this list (Example: s3://bucket/path). Currently '*' is not allowed.

roles[]

string

IAM roles that represent the set of operations allowed to be performed by the sources specified in the corresponding EgressFrom.

Methods

commit

Commits the dry-run specification for all the service perimeters in an access policy.

create

Creates a service perimeter.

delete

Deletes a service perimeter based on the resource name.

get

Gets a service perimeter based on the resource name.

list

Lists all service perimeters for an access policy.

patch

Updates a service perimeter.

replaceAll

Replace all existing service perimeters in an access policy with the service perimeters provided.

testIamPermissions

Returns the IAM permissions that the caller has on the specified Access Context Manager resource.