-
-
将 RBAC 与 CLI 结合使用
-
This content has been machine translated dynamically.
Dieser Inhalt ist eine maschinelle Übersetzung, die dynamisch erstellt wurde. (Haftungsausschluss)
Cet article a été traduit automatiquement de manière dynamique. (Clause de non responsabilité)
Este artículo lo ha traducido una máquina de forma dinámica. (Aviso legal)
此内容已经过机器动态翻译。 放弃
このコンテンツは動的に機械翻訳されています。免責事項
이 콘텐츠는 동적으로 기계 번역되었습니다. 책임 부인
Este texto foi traduzido automaticamente. (Aviso legal)
Questo contenuto è stato tradotto dinamicamente con traduzione automatica.(Esclusione di responsabilità))
This article has been machine translated.
Dieser Artikel wurde maschinell übersetzt. (Haftungsausschluss)
Ce article a été traduit automatiquement. (Clause de non responsabilité)
Este artículo ha sido traducido automáticamente. (Aviso legal)
この記事は機械翻訳されています.免責事項
이 기사는 기계 번역되었습니다.책임 부인
Este artigo foi traduzido automaticamente.(Aviso legal)
这篇文章已经过机器翻译.放弃
Questo articolo è stato tradotto automaticamente.(Esclusione di responsabilità))
Translation failed!
将 RBAC 与 CLI 结合使用
RBAC xe CLI 命令
可使用以下命令对角色和使用者进行相应操作。
列出所有可用的已定义角色
运行以下命令:xe role-list
此命令返回当前已定义角色的列表,例如:
uuid( RO): 0165f154-ba3e-034e-6b27-5d271af109ba
name ( RO): pool-admin
description ( RO): The Pool Administrator role has full access to all
features and settings, including accessing Dom0 and managing subjects,
roles and external authentication
uuid ( RO): b9ce9791-0604-50cd-0649-09b3284c7dfd
name ( RO): pool-operator
description ( RO): The Pool Operator role manages host- and pool-wide resources,
including setting up storage, creating resource pools and managing patches, and
high availability (HA).
uuid( RO): 7955168d-7bec-10ed-105f-c6a7e6e63249
name ( RO): vm-power-admin
description ( RO): The VM Power Administrator role has full access to VM and
template management and can choose where to start VMs and use the dynamic memory
control and VM snapshot features
uuid ( RO): aaa00ab5-7340-bfbc-0d1b-7cf342639a6e
name ( RO): vm-admin
description ( RO): The VM Administrator role can manage VMs and templates
uuid ( RO): fb8d4ff9-310c-a959-0613-54101535d3d5
name ( RO): vm-operator
description ( RO): The VM Operator role can use VMs and interact with VM consoles
uuid ( RO): 7233b8e3-eacb-d7da-2c95-f2e581cdbf4e
name ( RO): read-only
description ( RO): The Read-Only role can log in with basic read-only access
<!--NeedCopy-->
注意:
此角色列表固定不变。您无法添加、删除或修改角色。
显示当前使用者的列表
运行以下命令:
xe subject-list
<!--NeedCopy-->
此命令将返回 Citrix Hypervisor 用户、其 UUID 及其相关联的角色的列表:
uuid ( RO): bb6dd239-1fa9-a06b-a497-3be28b8dca44
subject-identifier ( RO): S-1-5-21-1539997073-1618981536-2562117463-2244
other-config (MRO): subject-name: example01\user_vm_admin; subject-upn: \
user_vm_admin@XENDT.NET; subject-uid: 1823475908; subject-gid: 1823474177; \
subject-sid: S-1-5-21-1539997073-1618981536-2562117463-2244; subject-gecos: \
user_vm_admin; subject-displayname: user_vm_admin; subject-is-group: false; \
subject-account-disabled: false; subject-account-expired: false; \
subject-account-locked: false;subject-password-expired: false
roles (SRO): vm-admin
uuid ( RO): 4fe89a50-6a1a-d9dd-afb9-b554cd00c01a
subject-identifier ( RO): S-1-5-21-1539997073-1618981536-2562117463-2245
other-config (MRO): subject-name: example02\user_vm_op; subject-upn: \
user_vm_op@XENDT.NET; subject-uid: 1823475909; subject-gid: 1823474177; \
subject-sid: S-1-5-21-1539997073-1618981536-2562117463-2245; \
subject-gecos: user_vm_op; subject-displayname: user_vm_op; \
subject-is-group: false; subject-account-disabled: false; \
subject-account-expired: false; subject-account-locked: \
false; subject-password-expired: false
roles (SRO): vm-operator
uuid ( RO): 8a63fbf0-9ef4-4fef-b4a5-b42984c27267
subject-identifier ( RO): S-1-5-21-1539997073-1618981536-2562117463-2242
other-config (MRO): subject-name: example03\user_pool_op; \
subject-upn: user_pool_op@XENDT.NET; subject-uid: 1823475906; \
subject-gid: 1823474177; subject-s id:
S-1-5-21-1539997073-1618981536-2562117463-2242; \
subject-gecos: user_pool_op; subject-displayname: user_pool_op; \
subject-is-group: false; subject-account-disabled: false; \
subject-account-expired: false; subject-account-locked: \
false; subject-password-expired: false
roles (SRO): pool-operator
<!--NeedCopy-->
将使用者添加到 RBAC
为使现有 AD 用户能够使用 RBAC,请在 Citrix Hypervisor 中直接为 AD 用户或为包含组创建一个使用者实例:
运行以下命令以添加新的使用者实例:
xe subject-add subject-name=AD user/group
<!--NeedCopy-->
向使用者分配 RBAC 角色
添加使用者之后,可以为其分配 RBAC 角色。可以通过角色的 UUID 或名称引用该角色:
运行以下命令:
xe subject-role-add uuid=subject uuid role-uuid=role_uuid
<!--NeedCopy-->
或
xe subject-role-add uuid=subject uuid role-name=role_name
<!--NeedCopy-->
例如,以下命令会将 UUID 为 b9b3d03b-3d10-79d3-8ed7-a782c5ea13b4
的使用者添加到池管理员角色:
xe subject-role-add uuid=b9b3d03b-3d10-79d3-8ed7-a782c5ea13b4 role-name=pool-admin
<!--NeedCopy-->
更改使用者的 RBAC 角色
要更改用户的角色,需要将用户从现有角色中删除,然后再将其添加到新角色:
运行以下命令:
xe subject-role-remove uuid=subject_uuid role-name=role_name_to_remove
xe subject-role-add uuid=subject_uuid role-name=role_name_to_add
<!--NeedCopy-->
用户必须注销并重新登录以确保新角色生效。此操作需要适用于池管理员或池操作员的“注销活动用户连接”权限。
如果从用户中删除池管理员角色,还可以考虑更改服务器 root 用户密码并轮换池密码。有关详细信息,请参阅池安全性。
警告:
添加或删除池管理员使用者时,可能需要几秒钟时间来允许池中的所有主机接受与此使用者相关联的 SSH 会话。
审核
RBAC 审核日志将记录已登录的用户执行的所有操作。
-
该消息将记录与调用该操作的会话相关联的使用者 ID 和用户名。
-
如果使用者调用某个未获授权的操作,则将记录该操作。
-
还会记录任何成功的操作。如果操作失败,则会记录错误代码。
审核日志 xe CLI 命令
此命令将池中 RBAC 审核文件的所有可用记录下载到某个文件中。如果可选参数“since”存在,该命令将仅下载自该特定时间点开始的记录。
xe audit-log-get [since=timestamp] filename=output filename
<!--NeedCopy-->
获取池中的所有审核记录
运行以下命令:
xe audit-log-get filename=/tmp/auditlog-pool-actions.out
<!--NeedCopy-->
获取自精确到毫秒的时间戳开始的池审核记录
运行以下命令:
xe audit-log-get since=2009-09-24T17:56:20.530Z \
filename=/tmp/auditlog-pool-actions.out
<!--NeedCopy-->
获取自精确到分钟的时间戳开始的池审核记录
运行以下命令:
xe audit-log-get since=2009-09-24T17:56Z \
filename=/tmp/auditlog-pool-actions.out
<!--NeedCopy-->
共享
共享
This Preview product documentation is Cloud Software Group Confidential.
You agree to hold this documentation confidential pursuant to the terms of your Cloud Software Group Beta/Tech Preview Agreement.
The development, release and timing of any features or functionality described in the Preview documentation remains at our sole discretion and are subject to change without notice or consultation.
The documentation is for informational purposes only and is not a commitment, promise or legal obligation to deliver any material, code or functionality and should not be relied upon in making Cloud Software Group product purchase decisions.
If you do not agree, select I DO NOT AGREE to exit.