基于角色的访问控制 (RBAC)
基于角色的访问控制 (RBAC) 是一种安全机制,它根据用户被分配的角色来限制授权用户对资源的访问权限。在 SUSE Multi-Linux Manager 中,RBAC 可确保用户仅能执行其获得明确授权的操作以及访问相关资源,从而提升安全性并简化管理流程。
RBAC 的核心原则包括:
-
最小权限原则:仅授予用户执行其任务所需的必要访问权限。
-
精细化控制:针对特定功能提供精细的控制能力。
-
职责分离:防止单个用户对关键流程拥有过多控制权。
-
可审计性:能够清晰跟踪用户的操作及权限配置。
1. RBAC 核心概念
理解以下核心概念对于高效管理 RBAC 至关重要:
-
角色:权限的集合,用于定义用户在 SUSE Multi-Linux Manager 中具备的特定操作能力。角色分配给用户后,用户将获得该角色对应的所有聚合权限。
角色分配给用户后,用户将获得该角色对应的所有聚合权限。
-
权限:原子级的授权项,允许用户在 SUSE Multi-Linux Manager 中执行特定操作、访问特定网页或调用特定 API 端点。在 SUSE Multi-Linux Manager 中,权限通过名称空间及其访问模式来表示。
-
用户:与 SUSE Multi-Linux Manager 进行交互的个人帐户。用户可被分配一个或多个角色。
-
名称空间:粒度化的访问控制单元,以树形结构组织。大多数名称空间均设有独立的“查看”或“修改”模式。
2. 在 SUSE Multi-Linux Manager 中使用角色
SUSE Multi-Linux Manager 提供了预定义角色,并允许您定义额外的自定义角色,且可选择从多个其他角色的组合继承权限。
2.1. 预定义角色
有关预定义角色及其说明的完整列表,请参见 administration:users.adoc#administrator-roles。
3. 用于精细化访问控制的名称空间
名称空间提供精细的访问控制,以树形结构组织。对于大多数名称空间,其内部访问权限可通过“查看”和“修改”模式进一步细化。
| Namespace | Access Mode | Description |
|---|---|---|
|
Modify |
Build container or Kiwi images |
|
Modify |
Import container images from a registered image store |
|
View |
List all images |
|
Modify |
Delete images |
|
View |
View image details, patches, packages, build log and cluster information |
|
Modify |
Inspect, rebuild, delete images |
|
View |
View details of an image profile |
|
Modify |
Create image profiles, edit profile details |
|
View |
List all image profiles |
|
Modify |
Delete image profiles |
|
View |
View details of an image store |
|
Modify |
Create image stores, edit store details |
|
View |
List all image stores |
|
Modify |
Delete image stores |
A comprehensive list of namespaces and their descriptions can be retrieved by making a call to the access.listNamespaces API method. Refer to SUSE Multi-Linux Manager API documentation for detailed information, including request and response formats.
4. RBAC 管理
Managing RBAC roles and permissions is possible either through the API or through the Web UI. To assign roles to users via the web UI, refer to 用户.
4.1. 通过 API 管理 RBAC
SUSE Multi-Linux Manager API 提供了以编程方式管理角色、权限及用户分配的相关方法。
4.1.1. The access API
以下 API 方法用于管理角色及其关联的访问权限:
-
listNamespaces: Lists available namespaces, access modes and their descriptions in SUSE Multi-Linux Manager. -
listPermissions: Lists permitted namespaces of a role. -
listRoles: Lists existing roles in SUSE Multi-Linux Manager. -
createRole: Creates a new role, optionally copying permissions from existing roles. -
deleteRole: Deletes a role. -
grantAccess: Grants access to namespaces. -
revokeAccess: Revokes access to namespaces.
4.1.2. The user API
以下 API 方法用于管理用户与角色的分配关系:
-
listPermissions: Lists effective permissions of a user. -
listRoles: Lists a user’s assigned roles. -
addRole: Assigns a role to a user. -
removeRole: Removes a role from a user.
有关详细的 API 文档(包括请求和响应格式),请参见 SUSE Multi-Linux Manager API 参考手册。
5. RBAC 最佳实践
遵循以下最佳实践有助于维护安全、高效且易于管理的 RBAC 环境:
-
最小权限原则:始终仅授予用户完成其职责所需的最低权限,避免授予过于宽泛的权限。
-
定期审查:定期审查用户分配到的角色和权限,确保其仍然适用且符合当前的安全策略。
-
记录角色:为您创建的每个自定义角色清晰记录其用途和权限。
-
职责分离:设计并应用能够强制执行职责分离的角色,防止单个用户对关键流程拥有过多控制权。