azkaban 用户权限管理介绍

 我的测试配置:

<azkaban-users>
  <user groups="azkaban" password="azkaban" roles="admin" username="azkaban"/>
  <user password="metrics" roles="metrics" username="metrics"/>
  <user groups="data_shuju" password="123456" roles="data_shuju" username="data_shuju"/>
  <role name="data_shuju" permissions="READ,EXECUTE"/>
  <user username="wangye" password="123456" groups="data_shuju"/>
  <user username="changshichao" password="123456" groups="group_read_execute"/>
  <group name="group_user" roles="user"/>
  <group name="group_read_execute" roles="ree"/>
  <role name="ree" permissions="READ,EXECUTE"/>
  <role name="wangye" permissions="READ,EXECUTE"/>
  <role name="admin" permissions="ADMIN"/>
  <role name="metrics" permissions="METRICS"/>
</azkaban-users>

azkaban的权限分两种

1,单个用户

<user password="metrics" roles="metrics" username="metrics"/> 用户
<role name="metrics" permissions="METRICS"/> 用户的权限

 

2,用户组设置用户组后再该用户组的所有用户都有该组的权限

<user username="changshichao" password="123456" groups="group_read_execute"/>在用户组添加用户
  <group name="group_read_execute" roles="ree"/>设置用户组
  <role name="ree" permissions="READ,EXECUTE"/> 读权限和执行flow权限

官网原文(https://azkaban.github.io/azkaban/docs/latest/#user-manager

XmlUserManager

The XmlUserManager is the default UserManager that is built into Azkaban. To explicitly set the parameters that configure the XmlUserManager, the following parameters can be set in the azkaban.properties file.

ParameterDefault
user.manager.classazkaban.user.XmlUserManager
user.manager.xml.fileazkaban-users.xml

The other file that needs to be modified is the azkaban-users.xml file. The XmlUserManager will parse the user xml file once during startup to set up the users.

Everything must be enclosed in a <azkaban-users> tag.

<azkaban-users>
	...
</azkaban-users>

Users

To add users, add the <user> tag.

<azkaban-users>
  <user username="myusername" password="mypassword" roles="a" groups="mygroup" / >
  <user username="myusername2" password="mypassword2" roles="a, b" groups="ga, gb" / >
  ...
</azkaban-users>
AttributesValuesRequired?
usernameThe login username.yes
passwordThe login password.yes
rolesComma delimited list of roles that this user has.no
groupsComma delimited list of groups that the users belongs to.no
proxyComma delimited list of proxy users that this users can give to a projectno

Groups

To define each group, you can add the <group> tag.

<azkaban-users>
  <user username="a" ... groups="groupa" / >
  ...
  <group name="groupa" roles="myrole" / >
  ...
</azkaban-users>

In the previous example, user 'a' is in the group 'groupa'. User 'a' would also have the 'myrole' role. A regular user cannot add group permissions to a project unless they are members of that group.

The following are some group attributes that you can assign.

AttributesValuesRequired?
nameThe group nameyes
rolesComma delimited list of roles that this user has.no

Roles

Roles are different in that it assigns global permissions to users in Azkaban. You can set up roles with the <roles> tag.

<azkaban-users>
  <user username="a" ... groups="groupa" roles="readall" / >
  <user username="b" ... / >
  ...
  <group name="groupa" roles="admin" / >
  ...
  <role name="admin" permissions="ADMIN" / >
  <role name="readall" permissions="READ" / >
</azkaban-users>

In the above example, user 'a' has the role 'readall', which is defined as having the READ permission. This means that user 'a' has global READ access on all the projects and executions.

User 'a' also is in 'groupa', which has the role ADMIN. It's certainly redundant, but user 'a' is also granted the ADMIN role on all projects.

The following are some group attributes that you can assign.

AttributesValuesRequired?
nameThe group nameyes
permissionsComma delimited list global permissions for the roleyes

The possible role permissions are the following:

PermissionsValues
ADMINGrants all access to everything in Azkaban.
READGives users read only access to every project and their logs
WRITEAllows users to upload files, change job properties or remove any project
EXECUTEAllows users to trigger the execution of any flow
SCHEDULEUsers can add or remove schedules for any flows
CREATEPROJECTSAllows users to create new projects if project creation is locked down

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值