Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Support Questions

Find answers, ask questions, and share your expertise
Announcements
Share your experience with Cloudera on G2 and get a $25 Amazon Gift card.
Hi, I'm CLEO! Something exciting is coming to the Community. Stay Tuned!

how to know which group is linked to a sentry role by command line

avatar
Expert Contributor

hello cloudera community,

 

how can we find out which group is tied to a sentry role by command line?

1 ACCEPTED SOLUTION

avatar
Super Guru

@yagoaparecidoti ,

 

The opposite command doesn't exist, as far as I know. Querying the database is the only option that I'm aware.

 

Cheers,

André

 

--
Was your question answered? Please take some time to click on "Accept as Solution" below this post.
If you find a reply useful, say thanks by clicking on the thumbs up button.

View solution in original post

3 REPLIES 3

avatar
Super Guru

@yagoaparecidoti ,

 

You can do the reverse with the command "SHOW ROLE GRANT GROUP group name;".

I don't think there's a command to do exactly what you need, but you can query the database directly:

select
  r.ROLE_NAME,
  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
order by
  r.ROLE_NAME,
  g.GROUP_NAME
;

 

Cheers,

André

--
Was your question answered? Please take some time to click on "Accept as Solution" below this post.
If you find a reply useful, say thanks by clicking on the thumbs up button.

avatar
Expert Contributor

hi @araujo 

 

this command "SHOW ROLE GRANT GROUP group name" I know and already used, I thought there was a command that did the opposite.

 

well I will check in mysql then and soon return if it worked.

avatar
Super Guru

@yagoaparecidoti ,

 

The opposite command doesn't exist, as far as I know. Querying the database is the only option that I'm aware.

 

Cheers,

André

 

--
Was your question answered? Please take some time to click on "Accept as Solution" below this post.
If you find a reply useful, say thanks by clicking on the thumbs up button.