How to view all authorized groups for a role in Hive
This article mainly explains "how to view all authorized groups of a role in Hive". The explanation in the article is simple and clear, easy to learn and understand. Please follow the editor's train of thought to study and learn "how to view all authorized groups of a role in Hive".
one
Purpose of document writing
Executing show role grant group xxx; on the command line makes it easy to get the roles owned by the group, but you cannot see which groups are owned under a role with a single command.
So is there a more convenient way to directly list all authorized groups under a role? next, Fayson introduces
Test environment
Version 5.15.0 for 1.CM and CDH
2.Redhat7.4
two
View all groups under roles
There is currently no such use of a statement to view all authorized groups under the role. Currently, you can view all authorized groups under a role in two ways:
1. You can view all authorized groups under roles through the "Security" interface of Hue UI
two。 Of course, if you need to store this information in your own management system, you can query the Sentry database directly using SQL statements, as shown in the following SQL statement:
Select g.GROUP_NAME
From SENTRY_GROUP g
Join SENTRY_ROLE_GROUP_MAP rg on rg.GROUP_ID = g.GROUP_ID
Join SENTRY_ROLE r on r.ROLE_ID = rg.ROLE_ID
Where r.ROLE_NAME = 'hive_admin'
As described above, there are two ways to obtain authorized groups under a role.
three
Summary
Currently, there is no statement like SHOW ROLE GRANT GROUP xxx to get all authorized user groups under the role, which can be obtained through the Hue management interface or directly using SQL to query the Sentry database.
Thank you for your reading, the above is the content of "how to view all authorized groups of a role in Hive". After the study of this article, I believe you have a deeper understanding of how to view all authorized groups of a role in Hive, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!