绑定完请刷新页面
取消
刷新

分享好友

×
取消 复制
Hive禁止用户设置特定的hiveconf值
2013-10-23 18:49:40

我们的Hive中开启了authentication(hive.security.authorization.enabled为true),为了防止用户在hive session中reset这个配置为false,绕过authorization策略,我们在setProcessor中会预先加载hiveConfSetBlackList,如果用户set blacklist中的hiveconf会抛异常,今天发现Hive0.11中已经增加了一个配置选项“hive.conf.restricted.list,value用逗号分割,会起到相同的效果。

    // setup list of conf vars that are not allowed to change runtime
    String restrictListStr = this.get(ConfVars.HIVE_CONF_RESTRICTED_LIST.toString());
    if (restrictListStr != null) {
      for (String entry : restrictListStr.split(",")) {
        restrictList.add(entry);
      }
    }
    restrictList.add(ConfVars.HIVE_CONF_RESTRICTED_LIST.toString());

SetProcessor中的setConf会先对key做validation和verification,如果在restrictedList里面就会报错

  public void verifyAndSet(String name, String value) throws IllegalArgumentException {
    if (restrictList.contains(name)) {
      throw new IllegalArgumentException("Cann't modify " + name + " at runtime");
    }
    set(name, value);
  }

通过设置hive.conf.restricted.list,能防止用户reset某些禁止的hiveconf值


本文链接http://blog.csdn.net/lalaguozhe/article/details/12976511,转载请注明

分享好友

分享这个小栈给你的朋友们,一起进步吧。

大数据之我观
创建时间:2020-05-20 11:12:12
关注 Hadoop, Hive, HBase, YARN, Shark, Spark, 大规模数据处理相关的开源项目,数据挖掘,个性化推荐,反作弊诚信...
展开
订阅须知

• 所有用户可根据关注领域订阅专区或所有专区

• 付费订阅:虚拟交易,一经交易不退款;若特殊情况,可3日内客服咨询

• 专区发布评论属默认订阅所评论专区(除付费小栈外)

栈主、嘉宾

查看更多
  • yukang
    栈主

小栈成员

查看更多
  • 栈栈
  • gaokeke123
  • wojiuzhuai
  • fenyun689
戳我,来吐槽~