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

# Access management in Managed Service for Apache Kafka®


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](#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 a role for a resource, you need the `mdb.admin` role, `managed-kafka.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 Apache Kafka® resources (clusters, hosts, cluster backups, partitions, topics, and users), assign the user the appropriate roles for the 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

    managed-kafka.user --> managed-kafka.editor
    managed-kafka.interfaceUser["`managed-kafka.
    interfaceUser`"] --> managed-kafka.editor
    managed-kafka.viewer --> managed-kafka.editor
    managed-kafka.maintenanceTask.viewer --> managed-kafka.viewer
    managed-kafka.maintenanceTask.viewer --> managed-kafka.maintenanceTask.editor["`managed-kafka.
    maintenanceTask.editor`"]
    managed-kafka.maintenanceTask.editor --> managed-kafka.editor
    managed-kafka.editor --> managed-kafka.admin
    managed-kafka.auditor --> managed-kafka.maintenanceTask.viewer["`managed-kafka.
    maintenanceTask.viewer`"]
    mdb.maintenanceTask.viewer --> mdb.maintenanceTask.editor
    managed-kafka.maintenanceTask.viewer --> mdb.maintenanceTask.viewer
    mdb.auditor --> mdb.maintenanceTask.viewer
    managed-kafka.viewer --> mdb.viewer
    managed-kafka.maintenanceTask.editor --> mdb.maintenanceTask.editor
    managed-kafka.admin --> mdb.admin
    managed-kafka.auditor --> mdb.auditor --> mdb.viewer --> mdb.admin
```

### Service roles {#service-roles}

#### managed-kafka.auditor {#managed-kafka-auditor}

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

#### managed-kafka.viewer {#managed-kafka-viewer}

The `managed-kafka.viewer` role enables viewing info on Apache Kafka® clusters, their logs, as well as info on quotas and resource operations for Managed Service for Apache Kafka®.

Users with this role can:
* View info on [Apache Kafka® 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 Apache Kafka® clusters.
* View Apache Kafka® cluster logs.
* View info on [quotas](../concepts/limits.md#mkf-quotas) for Managed Service for Apache Kafka®.
* View info on resource operations for Managed Service for Apache Kafka®.

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


#### managed-kafka.user {#managed-kafka-user}

The `managed-kafka.user` role enables using [Apache Kafka® clusters](../concepts/index.md).

#### managed-kafka.editor {#managed-kafka-editor}

The `managed-kafka.editor` role enables managing Apache Kafka® clusters.

Users with this role can:
* View info on [Apache Kafka® 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 Apache Kafka® clusters.
* Use [Kafka UI](../concepts/kafka-ui.md) for Apache Kafka®.
* View info on [maintenance](../concepts/maintenance.md) tasks for Apache Kafka® clusters and modify such tasks.
* View Apache Kafka® cluster logs.
* View info on [quotas](../concepts/limits.md#mkf-quotas) for Managed Service for Apache Kafka®.
* View info on resource operations for Managed Service for Apache Kafka®.

This role includes the `managed-kafka.viewer`, `managed-kafka.user`, `managed-kafka.interfaceUser`, and `managed-kafka.maintenanceTask.editor` permissions.

To create Apache Kafka® clusters, you also need the `vpc.user` role.

#### managed-kafka.admin {#managed-kafka-admin}

The `managed-kafka.admin` role enables managing Apache Kafka® clusters and access to them.

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

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

To create Apache Kafka® clusters, you also need the `vpc.user` role.

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

The `managed-kafka.maintenanceTask.viewer` role enables viewing info on [Apache Kafka® 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#mkf-quotas) and resource operations for Managed Service for Apache Kafka®.

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

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

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

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

#### managed-kafka.interfaceUser {#managed-kafka-interface-user}

The `managed-kafka.interfaceUser` role enables using [Kafka UI for Apache Kafka®](../concepts/kafka-ui.md).

#### 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.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-kafka.editor role or higher](../../iam/concepts/access-control/roles.md) for the folder that will contain the new cluster. The `managed-kafka.viewer` role only allows you to view the list of clusters.

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

You can always assign a role with more permissions, e.g., `managed-kafka.admin` instead of `managed-kafka.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).