-
Notifications
You must be signed in to change notification settings - Fork 2
IAM (Identity and Access Management) Documentation
In the Identity and Access Management (IAM) system, a Permission is a fundamental concept that defines the right to perform a specific action on a specific resource within the system. IAM operates on a "deny by default" model — this means that if a user or service does not have an explicitly granted permission for an action, that action will be blocked.
Each permission is represented as a string consisting of three parts separated by dots:
<service_name>.<resource_name>.<action>
-
<service_name>:- A unique identifier for a service or module in your system
- Examples:
billing,compute,auth,storage
-
<resource_name>:- Defines the type of object an action can be performed on
- Expressed in the singular form
- Examples:
account,vm,user,policy
-
<action>:- Defines the operation that can be performed on the specified resource
- Examples:
read,write,create,delete,activate
Permission examples:
-
billing.account.read— view account information in the billing service -
compute.vm.create— create a new virtual machine in the compute service -
auth.user.deactivate— deactivate a user in the authentication service
An important IAM philosophy is the principle of explicit permission:
- Initially, any user or service account has no access rights
- To perform any action, the subject must be granted the corresponding permission
- Services integrated with IAM must check for the required permission before executing an operation
POST /v1/iam/permissions/
Content-Type: application/json
Authorization: Bearer <token>
{
"name": "compute.vm.create",
"description": "Permission to create a virtual machine"
}{
"uuid": "5a1b2c3d-4e5f-6789-abcd-ef0123456789",
"name": "compute.vm.create",
"description": "Permission to create a virtual machine",
"created_at": "2025-08-21T07:38:04.778680Z",
"updated_at": "2025-08-21T07:38:04.778688Z",
"status": "ACTIVE"
}GET /v1/iam/permissions/5a1b2c3d-4e5f-6789-abcd-ef0123456789
Authorization: Bearer <token>GET /v1/iam/permissions/?name=compute.vm.create&status=ACTIVE
Authorization: Bearer <token>A Role is a named collection of Permissions. While a Permission defines the right for one specific action, a Role groups these rights into logical blocks corresponding to job functions, responsibilities, or the access level of a user or service.
To assign permissions to a role, the Permission Binding entity is used. This entity establishes a many-to-many relationship between roles and permissions.
- One Permission can be bound to several different roles
- One Role can contain many different permissions
Example:
- The
BillingViewerrole receives the following via Permission Binding:billing.account.readbilling.invoice.read
- The
BillingOperatorrole receives the following via Permission Binding:billing.account.readbilling.invoice.readbilling.invoice.pay
To grant a user access, a role must be assigned to them. The Role Binding entity is used for this purpose. This entity establishes a many-to-many relationship between users and roles.
- One user can be assigned several roles
- One role can be assigned to many users
The access verification process:
- A User makes a request to a service
- The Service determines which permission is needed for this action
-
IAM checks:
- Which roles are assigned to the user (via all their Role Bindings)
- Which permissions are included in these roles (via all Permission Bindings for these roles)
- If at least one of the user's roles contains the required permission, access is granted
POST /v1/iam/roles/
Content-Type: application/json
Authorization: Bearer <token>
{
"name": "BillingOperator",
"description": "Billing operator with rights to manage accounts"
}{
"uuid": "6b2c3d4e-5f67-789a-bcde-f01234567890",
"name": "BillingOperator",
"description": "Billing operator with rights to manage accounts",
"created_at": "2025-08-21T07:38:04.779416Z",
"updated_at": "2025-08-21T07:38:04.779424Z",
"status": "ACTIVE",
"project_id": null
}POST /v1/iam/permission_bindings/
Content-Type: application/json
Authorization: Bearer <token>
{
"role": "6b2c3d4e-5f67-789a-bcde-f01234567890",
"permission": "5a1b2c3d-4e5f-6789-abcd-ef0123456789"
}POST /v1/iam/role_bindings/
Content-Type: application/json
Authorization: Bearer <token>
{
"user": "7c3d4e5f-6789-89ab-cdef-123456789012",
"role": "6b2c3d4e-5f67-789a-bcde-f01234567890",
"project": "8d4e5f67-789a-9abc-def1-234567890123"
}GET /v1/iam/users/7c3d4e5f-6789-89ab-cdef-123456789012/actions/get_my_roles
Authorization: Bearer <token>Create roles that provide exactly the level of access required to perform a task, and nothing more.
Give roles and permissions clear names that reflect their purpose:
- Roles:
NetworkReadOnly,DatabaseSuperUser - Permissions:
compute.vm.read,storage.bucket.delete
Periodically review:
- Which roles are assigned to whom
- Which permissions are included in roles
- Remove unnecessary access promptly
Assign roles within the context of specific projects to ensure environment isolation:
{
"user": "7c3d4e5f-6789-89ab-cdef-123456789012",
"role": "6b2c3d4e-5f67-789a-bcde-f01234567890",
"project": "8d4e5f67-789a-9abc-def1-234567890123"
}The following errors may occur when working with the IAM API:
{
"status": 403,
"json": {
"code": 403,
"type": "PermissionDeniedException",
"message": "User does not have required permission: compute.vm.create"
}
}{
"status": 404,
"json": {
"code": 404,
"type": "NotFoundException",
"message": "Role with uuid 6b2c3d4e-5f67-789a-bcde-f01234567890 not found"
}
}{
"status": 400,
"json": {
"code": 400,
"type": "ValidationErrorException",
"message": "Field 'name' must be between 0 and 255 characters"
}
}- All changes to permissions and role bindings take effect immediately
- Caching access rights on the client side is not recommended
- For service accounts, use separate roles with the minimum required permissions
- Regularly update and review role assignments within the system
This documentation covers the basic aspects of working with the IAM system in Genesis Core. For more detailed information about specific API endpoints, refer to the full OpenAPI specification.