[Yandex Cloud documentation](../../index.md) > [Yandex Managed Service for OpenSearch](../index.md) > Access management

# Managing access to Managed Service for OpenSearch


In this section, you will learn about the following:

* [Resources you can assign a role for](#resources).
* [Roles this service has](#roles-list).
* [Roles required for specific actions](#required-roles).

To use the service, log in to the management console with your [Yandex account](../../iam/concepts/users/accounts.md#passport), [federated account](../../iam/concepts/users/accounts.md#saml-federation), or [local account](../../iam/concepts/users/accounts.md#local).

## 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 a role for a resource, you need the `mdb.admin` role, `managed-opensearch.admin` role, or 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.

To allow access to Managed Service for OpenSearch resources (clusters and hosts, cluster backups, and accounts), assign the user the appropriate roles for a folder, cloud, or organization containing these resources.

You can also assign a role for an individual cluster in the [management console](https://console.yandex.cloud), via the [CLI](../../cli/index.md), or [API](../api-ref/authentication.md).

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

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

```mermaid
%%{
  init: {
    "flowchart": { "defaultRenderer": "elk" },
    "elk": { "nodePlacementStrategy": "NETWORK_SIMPLEX" }
  }
}%%
flowchart BT
    vpc.publicAdmin
    mdb.viewer --> mdb.restorer
    managed-opensearch.viewer --> managed-opensearch.restorer
    managed-opensearch.restorer["`managed-opensearch.
    restorer`"] --> managed-opensearch.editor
    mdb.auditor --> mdb.maintenanceTask.viewer
    mdb.maintenanceTask.viewer --> mdb.maintenanceTask.editor
    managed-opensearch.maintenanceTask.viewer --> mdb.maintenanceTask.viewer
    managed-opensearch.maintenanceTask.editor["`managed-opensearch.
    maintenanceTask.editor`"] --> managed-opensearch.editor
    managed-opensearch.maintenanceTask.viewer["`managed-opensearch.
    maintenanceTask.viewer`"] --> managed-opensearch.viewer
    managed-opensearch.maintenanceTask.viewer --> managed-opensearch.maintenanceTask.editor
    managed-opensearch.maintenanceTask.editor --> mdb.maintenanceTask.editor
    managed-opensearch.viewer --> managed-opensearch.editor
    managed-opensearch.auditor --> managed-opensearch.maintenanceTask.viewer
    mdb.auditor --> mdb.viewer
    managed-opensearch.viewer["`managed-opensearch.
    viewer`"] --> mdb.viewer
    managed-opensearch.auditor["`managed-opensearch.
    auditor`"] --> mdb.auditor
    managed-opensearch.auditor["`managed-opensearch.
    auditor`"] --> managed-opensearch.viewer
    managed-opensearch.editor["`managed-opensearch.
    editor`"] --> managed-opensearch.admin
    managed-opensearch.restorer --> mdb.restorer
    managed-opensearch.user --> managed-opensearch.editor
    managed-opensearch.admin["`managed-opensearch.
    admin`"] --> mdb.admin
    mdb.viewer --> mdb.admin
```

### Service roles {#service-roles}

#### managed-opensearch.auditor {#managed-opensearch-auditor}

The `managed-opensearch.auditor` role enables viewing info on [OpenSearch clusters](../concepts/index.md), [access permissions](../../iam/concepts/access-control/index.md) granted for them, and on [quotas](../concepts/limits.md#quotas) and resource operations for Managed Service for OpenSearch.

#### managed-opensearch.viewer {#managed-opensearch-viewer}

The `managed-opensearch.viewer` role enables viewing info on OpenSearch clusters, their logs, and info on quotas and resource operations for Managed Service for OpenSearch.

Users with this role can:
* View info on [OpenSearch clusters](../concepts/index.md) and [access permissions](../../iam/concepts/access-control/index.md) granted for them.
* View info on [maintenance](../concepts/maintenance.md) tasks for OpenSearch clusters.
* View OpenSearch cluster logs.
* View info on [quotas](../concepts/limits.md#quotas) for Managed Service for OpenSearch.
* View info on resource operations for Managed Service for OpenSearch.

This role includes the `managed-opensearch.auditor` and `managed-opensearch.maintenanceTask.viewer` permissions.

#### managed-opensearch.restorer {#managed-opensearch-restorer}

The `managed-opensearch.restorer` role enables restoring OpenSearch clusters from backups and viewing info on OpenSearch clusters, their logs, as well as info on quotas and resource operations for Managed Service for OpenSearch.

Users with this role can:
* View info on [OpenSearch clusters](../concepts/index.md) and [access permissions](../../iam/concepts/access-control/index.md) granted for them.
* Restore OpenSearch clusters from backups.
* View info on [maintenance](../concepts/maintenance.md) tasks for OpenSearch clusters.
* View OpenSearch cluster logs.
* View info on [quotas](../concepts/limits.md#quotas) for Managed Service for OpenSearch.
* View info on resource operations for Managed Service for OpenSearch.

This role includes the `managed-opensearch.viewer` permissions.

#### managed-opensearch.user {#managed-opensearch-user}

The `managed-opensearch.user` role enables using [OpenSearch clusters](../concepts/index.md).

#### managed-opensearch.editor {#managed-opensearch-editor}

The `managed-opensearch.editor` role enables managing OpenSearch clusters.

Users with this role can:
* View info on [OpenSearch clusters](../concepts/index.md), as well as create, use, modify, delete, run, and stop them.
* View info on [access permissions](../../iam/concepts/access-control/index.md) granted for OpenSearch clusters.
* Restore OpenSearch clusters from backups.
* View info on [maintenance](../concepts/maintenance.md) tasks for OpenSearch clusters and modify such tasks.
* View OpenSearch cluster logs.
* View info on [quotas](../concepts/limits.md#quotas) for Managed Service for OpenSearch.
* View info on resource operations for Managed Service for OpenSearch.

This role includes the `managed-opensearch.viewer`, `managed-opensearch.user`, `managed-opensearch.restorer`, and `managed-opensearch.maintenanceTask.editor` permissions.

To create OpenSearch clusters, you also need the `vpc.user` role.

#### managed-opensearch.admin {#managed-opensearch-admin}

The `managed-opensearch.admin` role enables managing OpenSearch clusters and access to them.

Users with this role can:
* View info on [access permissions](../../iam/concepts/access-control/index.md) granted for [OpenSearch clusters](../concepts/index.md) and modify such permissions.
* View info on OpenSearch clusters, as well as create, use, modify, delete, run, and stop them.
* Restore OpenSearch clusters from backups.
* View info on [maintenance](../concepts/maintenance.md) tasks for OpenSearch clusters and modify such tasks.
* View OpenSearch cluster logs.
* View info on [quotas](../concepts/limits.md#quotas) for Managed Service for OpenSearch.
* View info on resource operations for Managed Service for OpenSearch.

This role includes the `managed-opensearch.editor` permissions.

To create OpenSearch clusters, you also need the `vpc.user` role.

#### managed-opensearch.maintenanceTask.viewer {#managed-opensearch-maintenanceTask-viewer}

The `managed-opensearch.maintenanceTask.viewer` role enables viewing info on [OpenSearch clusters](../concepts/index.md), [access permissions](../../iam/concepts/access-control/index.md) granted for them, their [maintenance](../concepts/maintenance.md) tasks, and on [quotas](../concepts/limits.md#quotas) and resource operations for Managed Service for OpenSearch.

This role includes the `managed-opensearch.auditor` permissions.

#### managed-opensearch.maintenanceTask.editor {#managed-opensearch-maintenanceTask-editor}

The `managed-opensearch.maintenanceTask.editor` role enables viewing info on [maintenance](../concepts/maintenance.md) tasks for OpenSearch clusters and modifying such tasks, as well as viewing info on [OpenSearch clusters](../concepts/index.md), [access permissions](../../iam/concepts/access-control/index.md) granted for them, and on [quotas](../concepts/limits.md#quotas) and resource operations for Managed Service for OpenSearch.

This role includes the `managed-opensearch.maintenanceTask.viewer` permissions.

#### mdb.auditor {#mdb-auditor}

The `mdb.auditor` role grants the minimum permissions required to view info on managed database clusters (without access to data or logs).

Users with this role can view info on managed database clusters, quotas, and resource operations.

This role includes the `managed-opensearch.auditor`, `managed-kafka.auditor`, `managed-mysql.auditor`, `managed-postgresql.auditor`, `managed-spqr.auditor`, `managed-greenplum.auditor`, `managed-clickhouse.auditor`, `managed-redis.auditor`, and `managed-mongodb.auditor` permissions.

#### mdb.viewer {#mdb-viewer}

The `mdb.viewer` role grants read access to managed database clusters and cluster logs.

Users with this role can read from databases, view the logs of managed database clusters, and view info on cluster maintenance tasks, clusters, quotas, and resource operations.

This role includes the `managed-opensearch.viewer`, `managed-kafka.viewer`, `managed-mysql.viewer`, `managed-postgresql.viewer`, `managed-greenplum.viewer`, `managed-clickhouse.viewer`, `managed-redis.viewer`, `managed-mongodb.viewer`, and `dataproc.viewer` permissions.

#### mdb.admin {#mdb-admin}

The `mdb.admin` role grants full access to managed database clusters.

Users with this role can create, edit, delete, run, and stop managed database clusters, manage access to clusters, create cluster backups and restore clusters from backups, read and write to databases, view info on clusters, view and modify cluster maintenance tasks, and view cluster logs as well as info on quotas and resource operations.

This role includes the `mdb.viewer`, `vpc.user`, `managed-opensearch.admin`, `managed-kafka.admin`, `managed-mysql.admin`, `managed-postgresql.admin`, `managed-spqr.admin`, `managed-greenplum.admin`, `managed-clickhouse.admin`, `managed-redis.admin`, `managed-mongodb.admin`, and `dataproc.admin` permissions.

#### mdb.restorer {#mdb-restorer}

The `mdb.restorer` role enables restoring managed database clusters from backups and grants read access to such clusters and their logs.

Users with this role can restore managed database clusters from backups, read from databases, view cluster logs, and view info on clusters, their maintenance tasks, quotas, and resource operations.

This role includes the `mdb.viewer`, `managed-opensearch.restorer`, `managed-mysql.restorer`, `managed-postgresql.restorer`, `managed-spqr.restorer`, `managed-greenplum.restorer`, `managed-clickhouse.restorer`, `managed-redis.restorer`, and `managed-mongodb.restorer` permissions.

#### mdb.maintenanceTask.viewer {#mdb-maintenanceTask-viewer}

The `mdb.maintenanceTask.viewer` role grants access to information on maintenance tasks for managed database clusters.

Users with this role can view information on managed database clusters, their maintenance tasks, and access permissions granted for them, on hosts and cluster backups, as well as on service quotas and resource operations.

This role includes the `mdb.auditor`, `managed-clickhouse.maintenanceTask.viewer`, `managed-greenplum.maintenanceTask.viewer`, `managed-kafka.maintenanceTask.viewer`, `managed-mongodb.maintenanceTask.viewer`, `managed-mysql.maintenanceTask.viewer`, `managed-opensearch.maintenanceTask.viewer`, `managed-postgresql.maintenanceTask.viewer`, `managed-redis.maintenanceTask.viewer`, and `managed-spqr.maintenanceTask.viewer` permissions.

#### mdb.maintenanceTask.editor {#mdb-maintenanceTask-editor}

The `mdb.maintenanceTask.editor` role enables managing maintenance tasks for managed database clusters.

Users with this role can view information on maintenance tasks for managed database clusters and modify such tasks, view information on managed database clusters and access permissions granted for them, on cluster hosts and backups, as well as on service quotas and resource operations.

This role includes the `mdb.maintenanceTask.viewer`, `managed-clickhouse.maintenanceTask.editor`, `managed-greenplum.maintenanceTask.editor`, `managed-kafka.maintenanceTask.editor`, `managed-mongodb.maintenanceTask.editor`, `managed-mysql.maintenanceTask.editor`, `managed-opensearch.maintenanceTask.editor`, `managed-postgresql.maintenanceTask.editor`, `managed-redis.maintenanceTask.editor`, and `managed-spqr.maintenanceTask.editor` permissions.

#### vpc.publicAdmin {#vpc-public-admin}

The `vpc.publicAdmin` role allows you to manage NAT gateways, public IP addresses, and external network connectivity, as well as view information on the quotas, resources, and resource operations. This role grants administrator privileges for multi-interface instances that provide connectivity between multiple networks.

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

* View the list of [cloud networks](../../vpc/concepts/network.md#network) and info on them, as well as set up external access to them.
* Manage connectivity of multiple cloud networks.
* Manage multi-interface instances that provide connectivity between multiple networks.
* View the list of [subnets](../../vpc/concepts/network.md#subnet) and info on them, as well as modify them.
* View information on [NAT gateways](../../vpc/concepts/gateways.md), as well as create, modify, and delete them.
* View the list of [cloud resource addresses](../../vpc/concepts/address.md) and info on them, as well as create, update, and delete public IP addresses.
* View the list of [route tables](../../vpc/concepts/routing.md#rt-vpc) and info on them, as well as link them to subnets.
* View the list of [security groups](../../vpc/concepts/security-groups.md) and the info on them.
* View information on the IP addresses used in subnets.
* View information on Virtual Private Cloud [quotas](../../vpc/concepts/limits.md#vpc-quotas).
* View information on resource operations for Virtual Private Cloud.
* View information on resource operations for Compute Cloud.
* View information on the relevant [cloud](../../resource-manager/concepts/resources-hierarchy.md#cloud).
* View info on the relevant [folder](../../resource-manager/concepts/resources-hierarchy.md#folder).

{% endcut %}

This role includes the `vpc.viewer` permissions.

You can assign a role for a cloud or folder.

{% note warning %}

If a network and subnet are in different folders, the `vpc.publicAdmin` role is checked for the folder where the network 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).

## Required roles {#required-roles}

As a user, you need the [managed-opensearch.editor role or higher](../../iam/concepts/access-control/roles.md) for the folder that will contain the new cluster. The `managed-opensearch.viewer` role only allows you to view the list of clusters.

To create a Managed Service for OpenSearch cluster, you need the [vpc.user](../../vpc/security/index.md#vpc-user) role and the `managed-opensearch.editor` role or higher.

You can always assign a role with more permissions, e.g., `managed-opensearch.admin` instead of `managed-opensearch.editor`.

## What's next {#whats-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).