• 欢迎关注微信公众号:九万里大数据
  • 请使用Ctrl+D收藏本站到书签栏
  • 手机也可访问本站 jwldata.com

HUE的security browser显示There are currently no roles defined

大数据技术 九万里大数据 1年前 (2021-02-23) 380次浏览 0个评论 扫描二维码
文章目录[隐藏]

现象分析

如图,Roles页面显示There are currently no roles defined
HUE的security browser显示There are currently no roles defined

但是在Browser选项页是有roles的
HUE的security browser显示There are currently no roles defined

从后台HTTP请求来看,list_sentry_privileges_by_authorizable接口是有数据
HUE的security browser显示There are currently no roles defined

而list_sentry_roles_by_group接口没有数据
HUE的security browser显示There are currently no roles defined

解决办法

解决办法是将当前用户拉入sentry的admin组,比如hive组,sysadmins组等都可以。
HUE的security browser显示There are currently no roles defined

再次打开security browser的Roles选项页,已经出现了正确的roles,后台HTTP接口list_sentry_roles_by_group也有了正确的数据。
HUE的security browser显示There are currently no roles defined

总结,只要用户在sentry.service.admin.group里的都可以正常访问Roles页面。
HUE的security browser显示There are currently no roles defined

源码分析

https://github.com/cloudera/hue/blob/cdh6.0.1-release/apps/security/src/security/api/hive.py
HUE的security browser显示There are currently no roles defined
HUE的security browser显示There are currently no roles defined

后台HTTP接口传入的groupName默认是空的,所以进入else语句,去判断用户所在HUE数据库中的组(request.user.groups)是不是也在sentry的admin组里,如果存在的话,就返回*

https://github.com/cloudera/hue/blob/cdh6.0.1-release/desktop/libs/libsentry/src/libsentry/sentry_site.py
get_sentry_server_admin_groups这个函数实质上是去读取sentry-site.xml里面的sentry.service.admin.group值
HUE的security browser显示There are currently no roles defined

https://github.com/cloudera/hue/blob/cdh6.0.1-release/desktop/libs/libsentry/src/libsentry/api.py
list_sentry_roles_by_group这个函数就很普通,根据传入groupName进行role-group的字典拼装
HUE的security browser显示There are currently no roles defined


欢迎关注我的公众号“九万里大数据”,原创技术文章第一时间推送。


HUE的security browser显示There are currently no roles defined


本站文章,如未注明,均为原创 | 原创文章版权归九万里大数据所有,未经许可不得转载。
本文链接:HUE的security browser显示There are currently no roles defined
喜欢 (3)

您必须 登录 才能发表评论!