Hive 将用户限制为Apache配置单元中授予的架构(基于SQL标准的配置单元授权)

Hive 将用户限制为Apache配置单元中授予的架构(基于SQL标准的配置单元授权),hive,Hive,如何限制配置单元用户仅查看配置单元单机版中的已授予架构,以使用基于SQL标准的配置单元授权 通过限制,我的意思是删除列出模式的权限,用户不授予(show schemas;)权限,也不允许从其他模式中描述表(使用其他模式;描述表) hive site.xml hive.security.authorization.enabled: true hive.server2.enable.doAs: false hive.users.in.admin.role: hive hive.security.a

如何限制配置单元用户仅查看配置单元单机版中的已授予架构,以使用基于SQL标准的配置单元授权

通过限制,我的意思是删除列出模式的权限,用户不授予(show schemas;)权限,也不允许从其他模式中描述表(使用其他模式;描述表)

hive site.xml

hive.security.authorization.enabled: true
hive.server2.enable.doAs: false
hive.users.in.admin.role: hive
hive.security.authorization.manager:
org.apache.hadoop.hive.ql.security.authorization.plugin.sqlstd.SQLStdHiveAuthorizerFactory
hive.security.authorization.enabled: true
hive.security.authenticator.manager:
org.apache.hadoop.hive.ql.security.SessionStateUserAuthenticator
hiveserver2 site.xml

hive.security.authorization.enabled: true
hive.server2.enable.doAs: false
hive.users.in.admin.role: hive
hive.security.authorization.manager:
org.apache.hadoop.hive.ql.security.authorization.plugin.sqlstd.SQLStdHiveAuthorizerFactory
hive.security.authorization.enabled: true
hive.security.authenticator.manager:
org.apache.hadoop.hive.ql.security.SessionStateUserAuthenticator
配置单元架构和表

CREATE SCHEMA db_test1;
CREATE EXTERNAL TABLE db_test1.test_table_1 (title STRING, comment_count INT)
LOCATION 's3a://bucket/hive/test1/test_table_1';

CREATE SCHEMA db_test2;
CREATE EXTERNAL TABLE db_test2.test_table_2 (title STRING, comment_count INT)
LOCATION 's3a://bucket/hive/test2/test_table_2';
create role test1;
create role test2;
grant select on table db_test1.test_table_1 to role test1;
grant select on table db_test2.test_table_2 to role test2;
GRANT SELECT ON DATABASE db_test1 TO ROLE test1_role;
GRANT SELECT ON DATABASE db_test2 TO ROLE test2_role;
grant role test1 to user test1;
grant role test2 to user test1;
赠款

CREATE SCHEMA db_test1;
CREATE EXTERNAL TABLE db_test1.test_table_1 (title STRING, comment_count INT)
LOCATION 's3a://bucket/hive/test1/test_table_1';

CREATE SCHEMA db_test2;
CREATE EXTERNAL TABLE db_test2.test_table_2 (title STRING, comment_count INT)
LOCATION 's3a://bucket/hive/test2/test_table_2';
create role test1;
create role test2;
grant select on table db_test1.test_table_1 to role test1;
grant select on table db_test2.test_table_2 to role test2;
GRANT SELECT ON DATABASE db_test1 TO ROLE test1_role;
GRANT SELECT ON DATABASE db_test2 TO ROLE test2_role;
grant role test1 to user test1;
grant role test2 to user test1;

是否要将角色分配给数据库,而不是在表上执行此操作?是的,忘记添加以下行:我正在为SCSpecific schema授予角色选择权限将数据库db_test1上的选择授予角色test1_role;将数据库db_test2上的SELECT授予角色test2_角色;任何错误或具体问题是什么?是的,当用户被授予特定模式时,他仍然可以通过运行show schemas列出其他模式;并列出在他不拥有的架构上运行描述表的表。如何删除这些权限?是否要将角色分配给数据库,而不是在表上执行此操作?是的,忘记了将我为特定架构授予角色选择权限的行添加到角色test1\u角色中;将数据库db_test2上的SELECT授予角色test2_角色;任何错误或具体问题是什么?是的,当用户被授予特定模式时,他仍然可以通过运行show schemas列出其他模式;并列出在他不拥有的架构上运行描述表的表如何删除这些权限?