Google Cloud offers [Identity and Access Management (IAM)](https://docs.cloud.google.com/iam/docs.md.txt) to let you provide
more granular access to specific Google Cloud resources and prevent
access to other resources. This page describes the roles and permissions for
Service Extensions.

IAM lets you adopt the
[security principle of least privilege](https://wikipedia.org/wiki/Principle_of_least_privilege)
so that you need to grant only the necessary access to your resources.

Roles are collections of IAM permissions. To make permissions
available to principals, including users, groups, and service accounts, you
grant roles to the principals. You can control *who* has *what* permissions to
*which* resources by setting IAM policies. IAM
policies grant specific roles to principals, thereby giving them certain
permissions.

For detailed information about IAM roles, see [Roles and permissions](https://docs.cloud.google.com/iam/docs/roles-overview.md.txt).

## Predefined roles and permissions for Service Extensions

Service Extensions supports IAM permissions at the
project level.

The following table lists Service Extensions IAM
roles and the permissions that each role includes.

| Roles | Permissions |
|---|---|
| **Service Extensions Admin** (`roles/networkservices.serviceExtensionsAdmin`) Permissions to create, update, list, view, and delete extensions. | `networkservices.authzExtensions.create` `networkservices.authzExtensions.delete` `networkservices.authzExtensions.get` `networkservices.authzExtensions.list` `networkservices.authzExtensions.update` `networkservices.authzExtensions.use` `networkservices.lbEdgeExtensions.create` `networkservices.lbEdgeExtensions.delete` `networkservices.lbEdgeExtensions.get` `networkservices.lbEdgeExtensions.list` `networkservices.lbEdgeExtensions.update` `networkservices.lbRouteExtensions.create` `networkservices.lbRouteExtensions.delete` `networkservices.lbRouteExtensions.get` `networkservices.lbRouteExtensions.list` `networkservices.lbRouteExtensions.update` `networkservices.lbTrafficExtensions.create` `networkservices.lbTrafficExtensions.delete` `networkservices.lbTrafficExtensions.get` `networkservices.lbTrafficExtensions.list` `networkservices.lbTrafficExtensions.update` `networkservices.cdnEdgeExtensions.create` `networkservices.cdnEdgeExtensions.delete` `networkservices.cdnEdgeExtensions.get` `networkservices.cdnEdgeExtensions.list` `networkservices.cdnEdgeExtensions.update` `networkservices.wasmPlugins.create` `networkservices.wasmPlugins.delete` `networkservices.wasmPlugins.get` `networkservices.wasmPlugins.list` `networkservices.wasmPlugins.update` `networkservices.wasmPlugins.use` `networkservices.wasmPluginVersions.create` `networkservices.wasmPluginVersions.delete` `networkservices.wasmPluginVersions.get` `networkservices.wasmPluginVersions.list` |
| **Service Extensions Viewer** (`roles/networkservices.serviceExtensionsViewer`) Permissions to list and view extensions. | `networkservices.authzExtensions.get` `networkservices.authzExtensions.list` `networkservices.lbEdgeExtensions.get` `networkservices.lbEdgeExtensions.list` `networkservices.lbRouteExtensions.get` `networkservices.lbRouteExtensions.list` `networkservices.lbTrafficExtensions.get` `networkservices.lbTrafficExtensions.list` `networkservices.cdnEdgeExtensions.get` `networkservices.cdnEdgeExtensions.list` `networkservices.wasmPlugins.get` `networkservices.wasmPlugins.list` `networkservices.wasmPluginVersions.get` `networkservices.wasmPluginVersions.list` |

The following table lists IAM roles that you need
for other services and the permissions that each role includes.

| Roles | Permissions |
|---|---|
| **[Compute Load Balancer Admin](https://docs.cloud.google.com/iam/docs/roles-permissions/compute.md.txt#compute.loadBalancerAdmin)** (`roles/compute.loadBalancerAdmin`) Permissions to update forwarding rules. Required while creating and updating extensions that attach to forwarding rules. | `compute.forwardingRules.update` `compute.globalForwardingRules.update` |
| **[Compute Load Balancer Services User](https://docs.cloud.google.com/iam/docs/roles-permissions/compute.md.txt#compute.loadBalancerServiceUser)** (`roles/compute.loadBalancerServiceUser`) Permissions to use backend services. Required while creating and updating extensions that use backend services as extension services. | `compute.backendServices.use` `compute.regionBackendBuckets.use` |

| Role | Permissions |
|---|---|
| #### Service Extensions Admin ^Beta^ (`roles/serviceextensions.admin`) Grants full access to Service Extensions resources. | `resourcemanager.projects.get` `resourcemanager.projects.list` `serviceextensions.*` - `serviceextensions.callouts.invoke` - `serviceextensions.locations.get` - `serviceextensions.locations.list` |
| #### Service Extensions Editor ^Beta^ (`roles/serviceextensions.editor`) Grants access to edit Service Extensions resources. | `resourcemanager.projects.get` `resourcemanager.projects.list` `serviceextensions.*` - `serviceextensions.callouts.invoke` - `serviceextensions.locations.get` - `serviceextensions.locations.list` |
| #### Service Extensions Viewer ^Beta^ (`roles/serviceextensions.viewer`) Grants read access to Service Extensions resources. | `resourcemanager.projects.get` `resourcemanager.projects.list` `serviceextensions.locations.*` - `serviceextensions.locations.get` - `serviceextensions.locations.list` |

### Service agent roles


Service agent roles should only be granted to [service agents](https://docs.cloud.google.com/iam/docs/service-agents.md.txt).

| Role | Permissions |
|---|---|
| #### Network Actions Service Agent (`roles/networkactions.serviceAgent`) Gives Network Actions service account access to read required resources. > [!WARNING] > **Warning:** Do not grant service agent roles to any principals except [service agents](https://docs.cloud.google.com/iam/docs/service-agents.md.txt). | `artifactregistry.files.download` `artifactregistry.repositories.downloadArtifacts` |

## Manage access control

To set access controls at the project level, follow these steps:

1. In the Google Cloud console, go to the **IAM** page.

   [Go to IAM](https://console.cloud.google.com/iam-admin/iam)
2. Select your project.

3. Click **Add**.

4. In **New principals**, enter the email address of a new principal.

5. Select the required role.

6. Click **Save**.

7. Verify that the principal is listed with the role that you granted.

## Identify the permissions in a role

To determine whether one or more permissions are included in a role, you can use
one of the following methods:

- The [IAM permissions search reference](https://docs.cloud.google.com/iam/docs/permissions-reference)
- The [`gcloud iam roles describe` command](https://docs.cloud.google.com/sdk/gcloud/reference/iam/roles/describe.md.txt)
- The [`roles.get()` method](https://docs.cloud.google.com/iam/reference/rest/v1/roles/get) in the IAM API

## What's next

- See the [Service Extensions overview](https://docs.cloud.google.com/service-extensions/docs/overview.md.txt).
- Learn how to [prepare the plugin code](https://docs.cloud.google.com/service-extensions/docs/prepare-plugin-code.md.txt) to create plugins.
- Learn how to [create a plugin](https://docs.cloud.google.com/service-extensions/docs/create-plugin.md.txt).
- Learn how to [manage plugins](https://docs.cloud.google.com/service-extensions/docs/manage-plugins.md.txt).