Hadoop的安全问题

认证

kerberos:Kerberos 是一个网络身份验证协议,用户只需输入身份验证信息,验证通过获取票据即可访问多个接入 Kerberos 的服务,机器的单点登录也可以基于此协议完成。

  1. 用户执行任务前,先通过KDC认证自己,获取TGT(Ticket Granting Ticket)。KDC是 Kerberos 认证的中心服务,存储用户和服务的认证信息,主要包括三部分:A database of the users and services (known as principals) that it knows about and their respective Kerberos passwords / Authentication ServerTicket Granting Server 
  2. 用户通过 TGT 向 KDC 请求访问服务的Ticket, KDC 生成 session key 后一并发给客户端。
  3. 客户端通过 service ticket 向服务认证自己,完成身份认证。
  4. 完成身份认证后客户端向服务请求若干token供后续任务执行认证使用(比如 HDFS NameNode Delegation Token, YARN ResourceManager Delegation Token)
  5. 客户端连同获取到的 token 一并提交任务,后续任务执行使用 token 进行来自服务的认证

授权

ranger

审计

ranger

Hadoop的RPC实现支持SASL,SASL除了支持身份认证外,还提供了可选的信息完整性和信息加密。 SASL(Simple Authentication and Security Layer)是网络协议中使用的认证层。SASL并不是一种协议,而是一种认证、数据完整性校验和加密的机制的框架。

数据加密

静态数据

动态数据

HDFS

HDFS通信协议建立在TCP/IP基础上,提供了Hadoop RPC接口和流式接口(基于TCP或HTTP)两种方式,前者主要负责一些连接、节点以及数据的管理,而后者主要负责数据的读写传输(包括DataTransferProrocol等)。(HDFS没有采用Hadoop RPC实现HDFS文件的读写功能,是因为Hadoop RPC框架的效率目前不足以支撑超大文件的读写,而使用基于TCP的流式接口有利于批量处理数据,同时提高了数据的吞吐量)

  • Quality of Proection for RPC protocol: The qop for RPC is specified via the configuration property hadoop.rpc.protection. Hadoop supports Kerberos authentication and quality protection via the SASL Java library. The Java SASL library supports the three levels of qop (auth / auth-int / auth-conf). Setting hadoop.rpc.protection to privacy encrypts all communication from clients to namenode, from clients to Resource Manager, from datanodes to namenodes, from Node Managers to Resource managers, and so on.
  • Quality of Proection for HTTP: The qop for HTTP can be controlled by the policies dfs.http.policy and yarn.http.policy.Setting dfs.http.policy and yarn.http.policy to HTTPS_ONLY causes all HTTP traffic to be encrypted. This includes the web UI for namenodes and Resource Managers, Web HDFS interactions, and others.
  • Quality of Proection for DataTransferProtocol: The qop for the Data Transfer Protocol can be specified via the configuration property dfs.data.transfer.protection. Like RPC, the value can be one of authentication, integrity, or privacy. Specifying this property makes SASL effective on the Data Transfer Protocol.

配置DataNode SASL

Hive

  • hive.server2.thrift.sasl.qop 控制 HiveServer2 和客户端交互是否加密传输
  • hive.metastore.thrift.sasl.qop 控制 Metastore 和客户端交互是否加密传输

HBase

  • hbase.rpc.protection

Misc

SASL

Java Authentication and Authorization Service 能够控制代码对敏感或关键资源的访问, 如文件系统、网络服务、系统属性等。

证书生成

背景:

  • TLS及其前身SSL是建立在传输层与应用层(HTTP/FTP/Telnet)之间,为网络通讯提供安全及数据完整性保障的一种安全协议(HTTPS即HTTP over SSL)。
  •  truststore里存放的是来自他人的受信任的包含公钥的数字证书,不存放任何安全敏感信息,比如私钥或密码,客户端通常会包含一些大的CA机构的证书,这样当遇到新的证书时,客户端就可以使用这些CA机构的证书来验证这些新证书是否合法;keystore里存放的是自己的私钥和关联的证书或者证书链(证书链由客户端证书和一或多个CA证书)。

步骤:

猜你喜欢

转载自blog.csdn.net/qq_34276652/article/details/120319610