如何防止Apache Hive绕过Zookeeper直接连接到jdbc

huangapple go评论57阅读模式
英文:

How to prevent Apache Hive from connecting directly to jdbc bypassing Zookeeper

问题

Apache Hive通过Apache Ranger进行保护已配置。
连接通过zookeeper quorum进行,例如:

jdbc:hive2://d01.test.local:2181,d02.test.local:2181,d03.test.local:2181/;service Discovery Mode=zooKeeper;zooKeeperNamespace=hiveserver2

用户可以通过指定直接连接到主机来连接到Hive2,例如:

jdbc:hive2://d01.test.local:10000

但在Hive服务名称的策略设置中,只能有一个(文件ranger-hive-security.xml)。

那么如何保护Hive免受这种直接连接的影响呢?

如果策略通过zookeeper配置,则直接连接不受保护,并且审计不起作用。

英文:

Apache Hive protection via Apache Ranger is configured
The connection goes through the zookeeper quorum, for example:

jdbc:hive2://d01.test.local:2181,d 02.test.local:2181,d 03.test.local:2181/;service Discovery Mode=zooKeeper;zooKeeperNamespace=hiveserver2

Users have the ability to connect to Hive2 by specifying a direct connection to the host, for example:

jdbc:hive2://d01.test.local:10000

But in the policy setting for Have Service Name there can be only one (file ranger-hive-security.xml )

How then to protect hive from such a direct connection?

If the policy is configured via zookeeper then the direct connection is not secured and the audit does not work

答案1

得分: 1

Zookeeper quorum is for service high availability, it coordinates all the HS2 instances (from the specified hosts) in your cluster to work together.

As far as I know, specifying the property hive.zookeeper.quorum does not help Ranger to enforce each HS2 host with only one plugin.

To achieve what you desire, I think you can go for such configuration;

  • Install Ranger Hive plugin on each node where you have HS2.
  • Create one service/repository to specify with REPOSITORY_NAME in install.properties.
  • Configure each Hive plugin to use the same service/repository.
  • Restart your HS2s.
  • Create/modify/delete your policies under the service/repository (REPOSITORY_NAME).

In this way, any policy you create/delete/modify under your service will affect all the HS2 nodes as they share the same repo.

英文:

Zookeeper quorum is for service high availability, it coordinates all the HS2 instances (from the specified hosts) in your cluster to work together.

As far as I know, specifying the property hive.zookeeper.quorum does not help Ranger to enforce each HS2 host with only one plugin.

To achieve what you desire, I think you can go for such configuration;

  • Install Ranger Hive plugin on each node where you have HS2.
  • Create one service/repository to specify with REPOSITORY_NAME in install.properties.
  • Configure each Hive plugin to use same service/repository.
  • Restart your HS2s.
  • Create/modify/delete your policies under the service/repository (REPOSITORY_NAME).

In this way, any policy you create/delete/modify under your service will affect all the HS2 nodes as they share same repo.

huangapple
  • 本文由 发表于 2023年6月2日 13:12:11
  • 转载请务必保留本文链接:https://go.coder-hub.com/76387287.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定