【总结】Apache Sentry 服务简介
Sentry是一个RPC服务,将认证元数据信息存储在关系型数据库,并提供RPC接口检索和操作权限。利用Kerveros支持安全访问。Sentry Service通过后台数据库存储提供认证元数据信息,不处理真实的权限验证,当Hive,Impala等服务的配置使用Sentry权限的时候,Hive,Impala只作为Sentry的client。
最早的Sentry是使用policy file配置权限,逐渐版本升级过程中,目前采用关系型数据库存储权限角色等。使用新的Sentry服务相比于旧的policy file能够更容易处理用户权限,新的Sentry服务提供了更传统的 GRANT/REVOKE语句修改权限。
早版本Sentry中的策略文件policy file:
1
2
3
4
5
6
7
|
[groups]
manager = customers_insert_role,
customers_select_role
analyst = customers_select_role
[roles]
customers_insert_role = server=server1->db=customers->table=*->action= insert
customers_select_role = server=server1->db=customers->table=*->action=select
|
Sentry历史版本功能:
Sentry with policy files is added in CDH 5.1.0.
Sentry with config support is added in CDH 5.5.0.
Sentry with database-backed Sentry service is added with CDH 5.8.0.
Sentry中基础名词:
1.object Sentry认证规则所保护的一个对象,包括 server, database, table, URI, collection, and config
2.role 访问给定object的规则集合
3.privilege 包括insert select update等
4.user 来自于能够访问Sentry服务的一个认证系统用户,user可以是Kerberos的principal, LDAP的userid,或其他认证系统的标识
5.group 组,一个或者多个用户的集合,Sentry中将role分配给group,一个组就相应担当某个角色
6.A configured group provider determines a user’s affiliation with a group. The current release supports HDFS-backed groups and locally configured groups.
Privilege | Object |
INSERT | DB, TABLE |
SELECT | SERVER, DB, TABLE, COLUMN |
UPDATE | COLLECTION, CONFIG |
QUERY | COLLECTION, CONFIG |
ALL | SERVER, TABLE, DB, URI, COLLECTION, CONFIG |
Sentry权限模型:
Sentry使用基于角色权限模型,有如下特征
1、允许所有用户执行show functions,show locks等
2、允许用户看到那些有权限的tables,databases,collections,configs等
3、HiveQL执行例如LOAD,IMPORT等操作,需要用户有相应URI的权限
4、赋予一个URI某个权限,其子目录也递归赋予这个权限,所以只需将权限grant给一个父目录
5、CDH 5.5引入Column级别的访问控制,之前版本的如果要控制到列级别访问,使用View,创建一个只包含有访问权限Column的View
Tips
Hive中使用Sentry的时候,必须使用Beeline方式执行查询,Hive Cli方式不支持Sentry
Hive On Sentry中Object层级结构关系
权限能够赋予层级中的不同的object,一个权限如果赋予层级中一个object,则这个object子层级中的object继承这个权限。
比如赋予DATABASE的SELECT权限给用户A,则用户A拥有DATABASE下所有Object的SELECT权限
权限类型和Object的对应关系
Privilege | Object |
INSERT | DB, TABLE |
SELECT | DB, TABLE, VIEW, COLUMN |
ALL | SERVER, TABLE, DB, URI |
权限层级
Base Object | Granular privileges on object | Container object that contains the base object | Privileges on container object that implies privileges on the base object |
DATABASE | ALL | SERVER | ALL |
TABLE | INSERT | DATABASE | ALL |
TABLE | SELECT | DATABASE | ALL |
COLUMN | SELECT | DATABASE | ALL |
VIEW | SELECT | DATABASE | ALL |
Hive&Impala操作权限表
Operation | Scope | Privileges Required | URI |
CREATE DATABASE | SERVER | ALL | |
DROP DATABASE | DATABASE | ALL | |
CREATE TABLE | DATABASE | ALL | |
DROP TABLE | TABLE | ALL | |
CREATE VIEW-This operation is allowed if you have column-level SELECTaccess to the columns being used. | DATABASE; SELECT on TABLE; | ALL | |
ALTER VIEW-This operation is allowed if you have column-level SELECTaccess to the columns being used. | VIEW/TABLE | ALL | |
DROP VIEW | VIEW/TABLE | ALL | |
ALTER TABLE .. ADD COLUMNS | TABLE | ALL | |
ALTER TABLE .. REPLACE COLUMNS | TABLE | ALL | |
ALTER TABLE .. CHANGE column | TABLE | ALL | |
ALTER TABLE .. RENAME | TABLE | ALL | |
ALTER TABLE .. SET TBLPROPERTIES | TABLE | ALL | |
ALTER TABLE .. SET FILEFORMAT | TABLE | ALL | |
ALTER TABLE .. SET LOCATION | TABLE | ALL | URI |
ALTER TABLE .. ADD PARTITION | TABLE | ALL | |
ALTER TABLE .. ADD PARTITION location | TABLE | ALL | URI |
ALTER TABLE .. DROP PARTITION | TABLE | ALL | |
ALTER TABLE .. PARTITION SET FILEFORMAT | TABLE | ALL | |
SHOW CREATE TABLE | TABLE | SELECT/INSERT | |
SHOW PARTITIONS | TABLE | SELECT/INSERT | |
SHOW TABLES-Output includes all the tables for which the user has table-level privileges and all the tables for which the user has some column-level privileges. | TABLE | SELECT/INSERT | |
SHOW GRANT ROLE-Output includes an additional field for any column-level privileges. | TABLE | SELECT/INSERT | |
DESCRIBE TABLE-Output shows all columns if the user has table level-privileges or SELECT privilege on at least one table column | TABLE | SELECT/INSERT | |
LOAD DATA | TABLE | INSERT | URI |
SELECT-You can grant the SELECT privilege on a view to give users access to specific columns of a table they do not otherwise have access to. -See Column-level Authorization for details on allowed column-level operations. |
VIEW/TABLE; COLUMN | SELECT | |
INSERT OVERWRITE TABLE | TABLE | INSERT | |
CREATE TABLE .. AS SELECT-This operation is allowed if you have column-level SELECTaccess to the columns being used. | DATABASE; SELECT on TABLE | ALL | |
USE <dbName> | Any | ||
CREATE FUNCTION | SERVER | ALL | |
ALTER TABLE .. SET SERDEPROPERTIES | TABLE | ALL | |
ALTER TABLE .. PARTITION SET SERDEPROPERTIES | TABLE | ALL | |
Hive-Only Operations | |||
INSERT OVERWRITE DIRECTORY | TABLE | INSERT | URI |
Analyze TABLE | TABLE | SELECT + INSERT | |
IMPORT TABLE | DATABASE | ALL | URI |
EXPORT TABLE | TABLE | SELECT | URI |
ALTER TABLE TOUCH | TABLE | ALL | |
ALTER TABLE TOUCH PARTITION | TABLE | ALL | |
ALTER TABLE .. CLUSTERED BY SORTED BY | TABLE | ALL | |
ALTER TABLE .. ENABLE/DISABLE | TABLE | ALL | |
ALTER TABLE .. PARTITION ENABLE/DISABLE | TABLE | ALL | |
ALTER TABLE .. PARTITION.. RENAME TO PARTITION | TABLE | ALL | |
MSCK REPAIR TABLE | TABLE | ALL | |
ALTER DATABASE | DATABASE | ALL | |
DESCRIBE DATABASE | DATABASE | SELECT/INSERT | |
SHOW COLUMNS-Output for this operation filters columns to which the user does not have explicit SELECT access | TABLE | SELECT/INSERT | |
CREATE INDEX | TABLE | ALL | |
DROP INDEX | TABLE | ALL | |
SHOW INDEXES | TABLE | SELECT/INSERT | |
GRANT PRIVILEGE | Allowed only for Sentry admin users | ||
REVOKE PRIVILEGE | Allowed only for Sentry admin users | ||
SHOW GRANT | Allowed only for Sentry admin users | ||
SHOW TBLPROPERTIES | TABLE | SELECT/INSERT | |
DESCRIBE TABLE .. PARTITION | TABLE | SELECT/INSERT | |
ADD JAR | Not Allowed | ||
ADD FILE | Not Allowed | ||
DFS | Not Allowed | ||
Impala-Only Operations | |||
EXPLAIN | TABLE; COLUMN | SELECT | |
INVALIDATE METADATA | SERVER | ALL | |
INVALIDATE METADATA <table name> | TABLE | SELECT/INSERT | |
REFRESH <table name> or REFRESH <table name> PARTITION (<partition_spec>) | TABLE | SELECT/INSERT | |
DROP FUNCTION | SERVER | ALL | |
COMPUTE STATS | TABLE | ALL |
通过HUE管理Sentry:http://10120275.blog.51cto.com/10110275/1956777
【总结】Apache Sentry 服务简介相关推荐
- sentry mysql_安装配置apache sentry服务
环境 系统环境:Centos6.7 Hadoop版本:CDH5.10 jdk版本:jdk7 注:本文并未集成kerberos组件 安装Sentry Server 选择安装hive的节点进行安装测试: ...
- Apache Sentry手动安装、使用手册
Sentry手动安装.使用手册 1 Sentry简介 Apache Sentry 是Cloudera公司发布的一个Hadoop开源组件,截止目前还是Apache的孵化项目,它提供了细粒度级.基于角色的 ...
- Apache Sentry详细讲解
Sentry 简介 Apache Sentry是Cloudera公司发布的一个Hadoop开源组件,2016年3月从Incubator毕业,成为Apache顶级项目. Sentry是一个基于角色的粒度 ...
- Apache Sentry架构介绍
2019独角兽企业重金招聘Python工程师标准>>> cdh版本的hadoop在对数据安全上的处理通常采用Kerberos+Sentry的结构. kerberos主要负责平台用户的 ...
- 什么是 Apache Sentry , Apache Sentry 介绍
Apache Sentry是Hadoop中的一个基于角色的细粒度授权组件.Sentry可以在Hadoop集群上对通过身份认证的用户和应用程序控制数据访问权限.Sentry开箱即用的支持Hive,Hiv ...
- 《深入理解 Spring Cloud 与微服务构建》第一章 微服务简介
<深入理解 Spring Cloud 与微服务构建>第一章 微服务简介 文章目录 <深入理解 Spring Cloud 与微服务构建>第一章 微服务简介 一.单体架构及其存在的 ...
- Apache Sentry 第一弹:Server启动、连接Hue、分组详解
2019独角兽企业重金招聘Python工程师标准>>> 前言: Sentry是Hadoop安全方面的一个开源组件,目前还在孵化中,地址:https://sentry.incubato ...
- HiveServer2服务简介
HiveServer2服务简介 HiveServer2 基本概念介绍 hiveserver2的搭建使用 独立hiveserver2模式 共享metastore server的hiveserver2模式 ...
- Apache Shiro 框架简介
一.什么是Shiro Apache Shiro是一个强大易用的Java安全框架,提供了认证.授权.加密和会话管理等功能: 认证 - 用户身份识别,常被称为用户"登录": 授权 ...
最新文章
- MapXtreme 2005 学习心得 在地图上创建点/线并显示标注(五)
- 正则表达式的深入理解
- 一个不错的资源共享微盘
- Thinking in java第一章对象导论
- php strtoup,PHP 7 的几处函数安全小变化
- 信息 按顺序打印commit_提高效率的 10 个 Git 小技巧
- 【数据分析】你一定要掌握的Python七种数据清洗方法
- IE代理服务器出错导致浏览器无法上网
- [tensorflow]tensorflow 2.1 函数API(The Functional API)
- 数据对比,四个角度看中国公募基金的未来
- [EMNLP2017]Global Normalization of Convolutional Neural Networks for Joint Entity and Relation(阅读笔记)
- 抽奖活动软件 html,APP怎么制作抽奖活动,制作APP抽奖活动有何亮点
- fpga学习——zynq图像处理中的DVP流接口封装
- 基于STM32F103的ACS712电流传感器使用教程
- 不同网段共享文件服务器,不同网段ip 如何设置局域网共享?
- c语言实现一个计算器
- amazon aws 亚马逊云服务概述
- srio 门铃_如何更改SkyBell HD门铃的LED颜色
- CAN总线网络知识(一)
- 服务器运维用macos,MacOS和Linux区别_网站服务器运行维护,linux,macos