hive任务提交的相关权限认证详析
最近在研究Hue,遇到一个问题,在HiveEditor写一个HQL,提交后会报权限错误,类似这样的Authorizationfailed:NoprivilegeSelectfoundforinputs&n..
最近在研究Hue,遇到一个问题,在Hive Editor写一个HQL,提交后会报权限错误,类似这样的
Authorization failed:No privilege 'Select' found for inputs {database:xxx, table:xxx, columnName:xxx}. Use show grant to get more details. Hue的登录用户是hadoop,使用cli方式查询的时候,是没问题的,但是使用Hue连接HiveServer2的方式,就查询不了对应的表了,排除Hue的干扰,使用Beeline来连接HiveServer2,同样报权限的错误,堆栈信息如下图
根据堆栈信息大概梳理了下源码(只列出比较重要的代码),Hive提交SQL的权限验证流程如下
Hive的权限验证首先会调用authorizeUserDBAndTable验证用户是否对访问的DB和Table有访问权限,对应到MetaStore的DB_PRIVS和TBL_PRIVS表,在进行验证的时候,会通过thrift与HiveMetaStore进程进行交互来获取MetaStore库中对应表的相关信息。如果用户对更大粒度的资源有访问权限,则会直接返回,不会再继续进行更细粒度的验证,也就是说如果用户对DB有相关的权限,则不会继续验证对Table和Column的访问权限。
查看了下DB_PRIVS表,hadoop用户对访问的数据库是有Select权限的,所以再传统CLI模式下访问是没有问题的。看上述代码也都是在预料之中,因为实际上CLI模式和HiveServer模式的权限验证是一套代码。决定remote debug下,进而发现this.getAuthenticator().getUserName()的值为hive,也即是启动HiveServer2的用户,而不是提交SQL的用户hadoop,顺藤摸瓜,找到了设置authenticator相关属性的代码

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

In recent years, data warehouses have become an integral part of enterprise data management. Directly using the database for data analysis can meet simple query needs, but when we need to perform large-scale data analysis, a single database can no longer meet the needs. At this time, we need to use a data warehouse to process massive data. Hive is one of the most popular open source components in the data warehouse field. It can integrate the Hadoop distributed computing engine and SQL queries and support parallel processing of massive data. At the same time, in Go language, use

As data processing becomes more and more important, big data analysis becomes more and more common. However, many companies may not want to spend a lot of money on a business analytics platform. Open source solutions offer these companies a viable option. In this article, we will discuss how to implement the open source Hive big data analysis platform using PHP. Hive is a Hadoop-based data warehouse system that can query and manage large-scale data sets on Hadoop through SQL. It uses the SQL-like HiveQL language to query

PHP is a widely used server-side programming language that is used in almost all industries. In this article, we will explore the special role of PHP in big data processing. Under certain circumstances, PHP can collaborate with ApacheHive to achieve real-time data processing and analysis. First, let’s introduce Hive. Hive is a Hadoop-based data warehouse solution. It can map structured data into SQL queries and execute the queries as MapReduce tasks.

PHP is a programming language widely used in web development. In web applications, security is crucial, with permission authentication and authorization being one of the important aspects of protecting web applications from unauthorized access. In this article, we will learn how PHP implements permission authentication and authorization. Permission authentication is to verify whether a specific user has the right to access resources or perform operations. In order to implement this function, a user system is first needed, including user authentication and confirming whether the user has permission to access specific resources. Authentication enables

When installing and configuring Hive on CentOS7, you can follow these steps: Make sure Java is installed: First, make sure Java is installed on CentOS7. You can check whether Java is installed using the following command: java-version If Java is not installed, please install the appropriate Java version according to your needs. Download Hive: Visit the official website of ApacheHive () and download the latest stable version of Hive. Decompress the Hive compressed package: Use the following command to decompress the Hive compressed package: tarxvfzhive-x.x.x.tar.gz This will decompress Hive to the current directory. Configure environment variables: open the terminal,

A Microsoft official confirmed widespread reports that Google Chrome, ChromiumEdge, Discord and several other applications were flagged as "Behavior:Win32/Hive.ZY" by Microsoft's built-in antivirus software "WindowsDefender". The tech giant confirmed in a statement that it is working on a fix that will be rolled out to everyone in the next few hours. So what exactly is "Behavior:Win32/Hive.ZY"? According to a document posted on Microsoft's security portal, any file marked "Behavior:Win32/Hive.ZY" is

How to integrate a third-party authority authentication system in Laravel Introduction: Laravel is a powerful PHP development framework that provides many convenient functions and tools to simplify the development process. In actual development, we often need to integrate third-party permission authentication systems to manage user permissions. This article will introduce how to integrate a third-party authority authentication system in Laravel and provide specific code examples. Step 1: Install a third-party authority authentication system. First, we need to select and install a suitable third-party authority authentication system.

While keeping software updated and only downloading files from trusted sources are standard cybersecurity practices, given the recent increase in malware attacks, it's clear that more education is needed in this area. To that end, the Varonis forensics team has provided some guidance on how attackers using Hive ransomware are targeting Microsoft Exchange Server in their latest series of attacks. For those who don’t know, Hive follows a ransomware-as-a-service model. Although Microsoft is targeting E in 2021 for known vulnerabilities,
