# Access management in Application Load Balancer

In this section, you will learn:
* [Resources you can assign a role for](#resources).
* [Roles this service has](#roles-list).
* [What roles are required](#required-roles) for specific actions.

## Access management {#about-access-control}

[Yandex Identity and Access Management](../../iam/index.md) checks all operations in Yandex Cloud. If an entity does not have required permissions, IAM returns an error.


To grant permissions for a resource, [assign](../../iam/operations/roles/grant.md) the relevant resource roles to an entity performing operations. You can assign roles to a [Yandex account](../../iam/concepts/users/accounts.md#passport), [service account](../../iam/concepts/users/service-accounts.md), [local user](../../iam/concepts/users/accounts.md#local), [federated user](../../iam/concepts/federations.md), [user group](../../organization/operations/manage-groups.md), [system group](../../iam/concepts/access-control/system-group.md), or [public group](../../iam/concepts/access-control/public-group.md). For more information, see [How access management works in Yandex Cloud](../../iam/concepts/access-control/index.md).

To assign roles for a resource, you need to have one of the following roles for that resource:

* `admin`
* `resource-manager.admin`
* `organization-manager.admin`
* `resource-manager.clouds.owner`
* `organization-manager.organizations.owner`

## Resources you can assign a role for {#resources}

You can assign a role to an [organization](../../organization/concepts/organization.md), [cloud](../../resource-manager/concepts/resources-hierarchy.md#cloud), or [folder](../../resource-manager/concepts/resources-hierarchy.md#folder). The roles assigned to organizations, clouds, and folders also apply to their nested resources.

## Roles this service has {#roles-list}

The chart below shows service’s roles and their permission inheritance. For example, `editor` inherits all `viewer` permissions. You can find role descriptions below the chart.

```mermaid
%%{init: {"flowchart": {'defaultRenderer': 'elk'}} }%%
flowchart BT
    alb.auditor --> alb.viewer
    alb.viewer --> alb.user
    alb.user --> alb.editor
    vpc.user --> alb.editor
    load-balancer.privateAdmin --> alb.editor
    alb.editor --> alb.admin
    vpc.publicAdmin
```

### Service roles {#service-roles}

#### alb.auditor {#alb-auditor}

The `alb.auditor` role enables you to view  info on the Application Load Balancer resources and quotas.

Users with this role can:
* View the list of [L7 balancers](../concepts/application-load-balancer.md) and the info on them.
* View the list of [HTTP routers](../concepts/http-router.md) and the info on them.
* View the list of [virtual hosts](../concepts/http-router.md#virtual-host) and the info on them.
* View the list of [backend groups](../concepts/backend-group.md) and the info on them.
* View the list of [target groups](../concepts/target-group.md) and the info on them.
* View info on the Application Load Balancer [quotas](../concepts/limits.md#quotas).

#### alb.viewer {#alb-viewer}

The `alb.viewer` role enables viewing the list of Application Load Balancer resources and the info on them and the relevant quotas.

Users with this role can:
* View the list of [L7 balancers](../concepts/application-load-balancer.md) and the info on them.
* View the list of [HTTP routers](../concepts/http-router.md) and the info on them.
* View the list of [virtual hosts](../concepts/http-router.md#virtual-host) and the info on them.
* View the list of [backend groups](../concepts/backend-group.md) and the info on them.
* View the list of [target groups](../concepts/target-group.md) and the info on them.
* View info on the Application Load Balancer [quotas](../concepts/limits.md#quotas).

This role includes the `alb.auditor` permissions.

#### alb.user {#alb-user}

The `alb.user` role enables using L7 balancers, HTTP routers, backend groups, and target groups, as well as viewing info on the Application Load Balancer resources.

Users with this role can:
* View the list of [L7 balancers](../concepts/application-load-balancer.md) and info on them, as well as use them.
* View the list of [HTTP routers](../concepts/http-router.md) and the info on them, as well as use such routers.
* View the list of [virtual hosts](../concepts/http-router.md#virtual-host) and the info on them.
* View the list of [backend groups](../concepts/backend-group.md) and info on them, as well as use them.
* View the list of [target groups](../concepts/target-group.md) and the info on them, as well as use them.
* View info on the Application Load Balancer [quotas](../concepts/limits.md#quotas).

You can assign this role for a folder.

#### alb.editor {#alb-editor}

The `alb.editor` role enables managing Application Load Balancer resources and internal network load balancers, as well as viewing info on them and on the cloud networks, subnets, route tables, gateways, security groups, and IP addresses.

{% cut "Users with this role can:" %}

* View the list of [L7 balancers](../concepts/application-load-balancer.md) and the info on them, as well as create, modify, delete, and use such balancers.
* View the list of [HTTP routers](../concepts/http-router.md) and the info on them, as well as create, modify, delete, and use such routers.
* View the list of [virtual hosts](../concepts/http-router.md#virtual-host) and info on them, as well as modify them.
* View the list of [backend groups](../concepts/backend-group.md) and the info on them, as well as create, modify, delete, and use such groups.
* View the list of L7 balancer target groups and [network balancers](../../network-load-balancer/concepts/target-resources.md) and the info on them, as well as create, modify, delete, and use target groups.
* View the list of [network load balancers](../../network-load-balancer/concepts/index.md) and the info on them, as well as create internal network load balances (including those with UDP listeners), modify, delete, start, and stop them.
* View the list of [cloud networks](../../vpc/concepts/network.md#network) and info on them, as well as use them.
* View the list of [subnets](../../vpc/concepts/network.md#subnet) and info on them, as well as use them.
* View the list of [cloud resource addresses](../../vpc/concepts/address.md) and info on them, as well as use such addresses.
* View the list of [route tables](../../vpc/concepts/routing.md#rt-vpc) and info on them, as well as use them.
* View the list of [security groups](../../vpc/concepts/security-groups.md) and info on them, as well as use them.
* View information on [NAT gateways](../../vpc/concepts/gateways.md) and connect them to route tables.
* View the info on the used IP addresses in subnets, as well as create [internal addresses](../../vpc/concepts/address.md#internal-addresses).
* View the info on operations with the Virtual Private Cloud and Compute Cloud resources.
* View the list of operations with the Network Load Balancer resources.
* View info on the relevant [cloud](../../resource-manager/concepts/resources-hierarchy.md#cloud) and [folder](../../resource-manager/concepts/resources-hierarchy.md#folder).
* View info on the [Application Load Balancer](../concepts/limits.md#quotas), [Network Load Balancer](../../network-load-balancer/concepts/limits.md#load-balancer-quotas), and [Virtual Private Cloud](../../vpc/concepts/limits.md#vpc-quotas) quotas.

{% endcut %}

This role includes the `load-balancer.privateAdmin` and `vpc.user` permissions.

To connect a public IP address to a new or existing L7 balancer, you also need the [vpc.publicAdmin](../../vpc/security/index.md#vpc-public-admin) `role` assigned for the network where the balancer resides.

#### alb.admin {#alb-admin}

The `alb.admin` role enables managing Application Load Balancer resources and internal network load balancers, as well as viewing info on cloud networks, subnets, route tables, gateways, security groups, IP addresses, and quotas.

{% cut "Users with this role can:" %}

* View the list of [L7 balancers](../concepts/application-load-balancer.md) and the info on them, as well as create, modify, delete, and use such balancers.
* View the list of [HTTP routers](../concepts/http-router.md) and the info on them, as well as create, modify, delete, and use such routers.
* View the list of [virtual hosts](../concepts/http-router.md#virtual-host) and info on them, as well as modify them.
* View the list of [backend groups](../concepts/backend-group.md) and the info on them, as well as create, modify, delete, and use such groups.
* View the list of L7 balancer target groups and [network balancers](../../network-load-balancer/concepts/target-resources.md) and the info on them, as well as create, modify, delete, and use target groups.
* View the list of [network load balancers](../../network-load-balancer/concepts/index.md) and the info on them, as well as create internal network load balances (including those with UDP listeners), modify, delete, start, and stop them.
* View the list of [cloud networks](../../vpc/concepts/network.md#network) and info on them, as well as use them.
* View the list of [subnets](../../vpc/concepts/network.md#subnet) and info on them, as well as use them.
* View the list of [cloud resource addresses](../../vpc/concepts/address.md) and info on them, as well as use such addresses.
* View the list of [route tables](../../vpc/concepts/routing.md#rt-vpc) and info on them, as well as use them.
* View the list of [security groups](../../vpc/concepts/security-groups.md) and info on them, as well as use them.
* View information on [NAT gateways](../../vpc/concepts/gateways.md) and connect them to route tables.
* View the info on the used IP addresses in subnets, as well as create [internal addresses](../../vpc/concepts/address.md#internal-addresses).
* View the info on operations with the Virtual Private Cloud and Compute Cloud resources.
* View the list of operations with the Network Load Balancer resources.
* View info on the relevant [cloud](../../resource-manager/concepts/resources-hierarchy.md#cloud) and [folder](../../resource-manager/concepts/resources-hierarchy.md#folder).
* View info on the [Application Load Balancer](../concepts/limits.md#quotas), [Network Load Balancer](../../network-load-balancer/concepts/limits.md#load-balancer-quotas), and [Virtual Private Cloud](../../vpc/concepts/limits.md#vpc-quotas) quotas.

{% endcut %}

This role includes the `alb.editor` permissions.

To connect a public IP address to a new or existing L7 balancer, you also need the `vpc.publicAdmin` [role](../../vpc/security/index.md#vpc-public-admin) assigned for the network where the balancer resides.

{% note info %}

Assigning a public IP address to an L7 load balancer requires `vpc.publicAdmin` and `alb.editor` / `alb.admin` role permissions for the network where the load balancer is located.

{% endnote %}

### Primitive roles {#primitive-roles}

Primitive roles allow users to perform actions in all Yandex Cloud [services](../../overview/concepts/services.md).

#### auditor {#auditor}

The `auditor` role grants a permission to read configuration and metadata of any Yandex Cloud resources without any access to data.

For instance, users with this role can:
* View info on a [resource](../../resource-manager/concepts/resources-hierarchy.md).
* View the resource metadata.
* View the list of operations with a resource.

`auditor` is the most secure role that does not grant any access to the [service](../../overview/concepts/services.md) data. This role suits the users who need minimum access to the Yandex Cloud resources.

#### viewer {#viewer}

The `viewer` role grants the permissions to read the info on any Yandex Cloud [resources](../../resource-manager/concepts/resources-hierarchy.md).

This role includes the `auditor` permissions.

Unlike `auditor`, the `viewer` role provides access to [service](../../overview/concepts/services.md) data in read mode.

#### editor {#editor}

The `editor` role provides permissions to manage any Yandex Cloud [resources](../../resource-manager/concepts/resources-hierarchy.md), except for assigning roles to other users, transferring [organization](../../organization/concepts/organization.md) ownership, removing an organization, and deleting Key Management Service [encryption keys](../../kms/concepts/index.md).

For instance, users with this role can create, modify, and delete resources.

This role includes the `viewer` permissions.

#### admin {#admin}

The `admin` role enables assigning any roles, except for `resource-manager.clouds.owner` and `organization-manager.organizations.owner`, and provides permissions to manage any Yandex Cloud [resources](../../resource-manager/concepts/resources-hierarchy.md) (except for transferring [organization](../../organization/concepts/organization.md) ownership and removing an organization).

Prior to assigning the `admin` role for an organization, [cloud](../../resource-manager/concepts/resources-hierarchy.md#cloud), or [billing account](../../billing/concepts/billing-account.md), make sure to check out the information on protecting [privileged accounts](../../security/standard/all.md#privileged-users).

This role includes the `editor` permissions.

Instead of primitive roles, we recommend using service roles with more granular access control, allowing you to implement the [least privilege principle](../../security/standard/all.md#min-privileges).

For more information on primitive roles, see the [Yandex Cloud role reference](../../iam/roles-reference.md#primitive-roles).

## What roles do I need {#required-roles}

The table below lists the roles required for specific actions. You can always assign a role with more permissions. For example, you can assign the `editor` role instead of `viewer`.

Action | Methods | Required roles
----- | ----- | -----
**Viewing data** | |
Viewing resource details | `get`, `list`, `listOperations` | `alb.viewer` for the required resource
**Managing L7 load balancers** | |
[Creating](../operations/application-load-balancer-create.md) and [updating](../operations/application-load-balancer-update.md) L7 load balancers with public IP addresses | `create` | `alb.editor` and `vpc.publicAdmin` for the network containing the load balancer
Creating and updating L7 load balancers without public IP addresses | `create` | `alb.editor`
[Deleting L7 load balancers](../operations/application-load-balancer-delete.md) | `update`, `delete` | `alb.editor`
Getting target group statuses | `getTargetStates` | `alb.viewer`
Adding, updating, and removing listeners | `addListener`, `updateListener`, `removeListener` | `alb.editor`
Adding, updating, and removing SNI listeners | `addSniMatch`, `updateSniMatch`, `removeSniMatch` | `alb.editor`
Getting TLS listener certificates | `addListener`, `updateListener` | `certificate-manager.certificates.downloader`
Stopping and starting an L7 load balancer | `stop`, `start` | `alb.editor`
**Managing HTTP routers** | |
[Creating an HTTP router](../operations/http-router-create.md) | `create` | `alb.editor`
[Updating an HTTP router](../operations/http-router-update.md) | `update` | `alb.editor`
[Deleting an HTTP router](../operations/http-router-delete.md) | `delete` | `alb.editor`
**Managing backend groups** | |
[Creating](../operations/backend-group-create.md) and [updating](../operations/backend-group-update.md) backend groups | `create`, `update`, `updateBackend` | `alb.editor`
[Deleting backend groups](../operations/backend-group-delete.md) | `delete` | `alb.editor`
Adding resources to a backend group | `addBackend` | `alb.editor`
Removing resources from a backend group | `removeBackend` | `alb.editor`
**Managing target groups** | |
[Creating](../operations/target-group-create.md) and [updating](../operations/target-group-update.md) target groups in a folder | `create`, `update` | `alb.editor`
[Deleting target groups](../operations/target-group-delete.md) | `delete` | `alb.editor`
Adding resources to a target group | `addTargets` | `alb.editor`
Removing resources from a target group | `removeTargets` | `alb.editor`
**Resource access management** | |
[Granting](../../iam/operations/roles/grant.md), [revoking](../../iam/operations/roles/revoke.md), and viewing roles for a resource | `setAccessBindings`, `updateAccessBindings`, `listAccessBindings` | `admin` for the resource

{% note info %}

While [creating](../quickstart-wizard.md) a load balancer using the wizard, you may face a bucket access error when creating a group of backends. To avoid this, you need the `storage.viewer` role.

{% endnote %}

#### What's next

* [How to assign a role](../../iam/operations/roles/grant.md).
* [How to revoke a role](../../iam/operations/roles/revoke.md).
* [Learn more about access management in Yandex Cloud](../../iam/concepts/access-control/index.md).
* [Learn more about role inheritance](../../resource-manager/concepts/resources-hierarchy.md#access-rights-inheritance).