每个 RBAC 数据库都使用 key=value 语法存储属性。此方法可以适应将来的数据库扩展。此外,使用此方法,系统可以在遇到其策略未知的关键字时继续运行。key=value 内容将文件链接起来。四个数据库中的以下链接项说明了 RBAC 数据库协同工作的方式。
在以下示例中,通过为用户 jdoe 指定角色 filemgr,使此用户获取文件系统管理配置文件的功能。
在 user_attr 数据库的 jdoe 用户项中为用户 jdoe 指定角色 filemgr。
# user_attr - user definition jdoe::::type=normal;roles=filemgr |
在 user_attr 数据库的角色项中为角色 filemgr 指定权限配置文件文件系统管理。
# user_attr - role definition filemgr::::profiles=File System Management;type=role |
用户和角色在本地系统上的 passwd 和 shadow 文件中(或者在分布式名称服务的等效数据库中)唯一定义。
文件系统管理权限配置文件在 prof_attr 数据库中定义。此数据库还为文件系统管理项指定了三组授权。
# prof_attr - rights profile definitions and assigned authorizations File System Management:::Manage, mount, share file systems: help=RtFileSysMngmnt.html; auths=solaris.admin.fsmgr.*,solaris.admin.diskmgr.*,solaris.admin.volmgr.* |
这些授权在 auth_attr 数据库中定义。
# auth_attr - authorization definitions solaris.admin.fsmgr.:::Mounts and Shares::help=AuthFsmgrHeader.html solaris.admin.fsmgr.read:::View Mounts and Shares::help=AuthFsmgrRead.html solaris.admin.fsmgr.write:::Mount and Share Files::help=AuthFsmgrWrite.html |
在 exec_attr 数据库中为文件系统管理权限配置文件指定带有安全属性的命令。
# exec_attr - rights profile names with secured commands File System Management:suser:cmd:::/usr/sbin/mount:uid=0 File System Management:suser:cmd:::/usr/sbin/dfshares:euid=0 … File System Management:solaris:cmd:::/usr/sbin/mount:privs=sys_mount … |