Openstack组件部署 — Keystone功能介绍与认证实现流程
目录
前文列表
Openstack组件部署 — Overview和前期环境准备
Openstack组建部署 — Environment of Controller Node
Keystone认证服务
Keystone是Identity Service认证服务的Alias。为一个架构组件或服务或抽象对象取别名或项目名,在我看来就是老外的一个代码组织习惯,尤其常见于开源项目。Openstack学习之路从认识每一个功能组件开始,当然这会引入许多可能陌生的概念,在学习的过程中认识、理解、Kill all this,这是将会非常有意思的事情。
官档:The OpenStack Identity service provides a single point of integration for managing authentication, authorization, and service catalog services. Other OpenStack services use the Identity service as a common unified API. Additionally, services that provide information about users but that are not included in OpenStack (such as LDAP services) can be integrated into a pre-existing infrastructure.
In order to benefit from the Identity service, other OpenStack services need to collaborate with it. When an OpenStack service receives a request from a user, it checks with the Identity service whether the user is authorized to make the request.
粗译:Openstack身份认证服务提供了一个整合管理身份认证、授权、服务目录的point(Keystone组件基本就是围绕着这个point来展开)。其他的Openstack服务会使用Identity service的这个point来作为统一的API(这些API会被存放带一个服务目录中)。除此之外,Identity service还能够提供用户的相关信息,但这个信息并不会被包含在Openstack中,这些用户信息会被预先整合到一个基础架构中(例如LDAP service或SQL Database这些能够提供用户集中管理服务的组件)。
Identity service带来的好处在于,其他的Openstack需要通过Identity service来进行集中协调。当一个Openstack服务接收到一个用户的请求时,那么Openstack就会通过Identity service来检查这个用户是否有权限来发出这个请求。
**总而言之**Keystone这个子项目为Openstack通过了Account、Authentication、Authorization服务——简称3A。在安装OpenStack Identity service后,其他的OpenStack service必须要在Identity service中注册才能被使用。Identity可以追踪每一个OpenStack service的安装,并在系统网络中定位这个service的位置。
有了Identity service,Openstack就能够很好的对多个不同组件或者不同的用户进行协调和管理,在一个复杂的大型SOA软件系统中,需要Keystone这样的角色来支撑系统的松耦合架构设计。
我们要享受看官档的这个过程(os : 不要打我)
Identity service功能列表:
- 身份认证(Authentication):令牌的发放和校验
- 用户授权(Authorization):授予用户在一个服务中所拥有的权限
- 用户管理(Account)
- 服务目录(Service Catalog):包含可用服务的API point
Keystone认证服务中的概念
User(用户):一个People or System or Service在OpenStack中的数字表示。用于身份认证,也能够通过为登录到Openstack的用户分配令牌环,以此获得访问资源的权限。同一个用户可以被关联到给若干个租户,就像用户可以隶属于若干个不同的组。
Tenant(租户):一个资源或对象的抽象表示。租户可以包含多个用户,不同租户之间相互隔离。根据service运行的需求,租户可以映射为账户、组织、项目或服务。
Role(角色):可定制化的包含有特定用户权限的权限集合,可以关联到若干个User-Tenant对,来为User-Tenant对赋予权限。
Token(令牌):用于限定User-Tenant对进行OpenStack API和资源访问的字符串表示。一个临牌会持续一段时间有效,也可以随时撤销。
Credentials(凭证):用于确认用户身份的数据,例如:Username/Password
Authentication(检验):是确定用户身份的过程。
Service(服务):Openstack service,即Openstack中运行的组件服务。
Endpoint(端点):一个可以通过网络来访问和定位某个Openstack service的地址,通常是一个URL。使用RESTful的设计思想,详见RESTful_URI资源。
Keystone Client(Keystone CLI):Keystone的命令行工具,可以完成诸如创建用户,角色,服务和端点等绝大多数的Leystone管理功能,是非常常用的CLI接口。
Keystone的验证过程
这里是一个用户创建实例的Keystone认证流程。
User wants to launch an instance 用户希望通过Service来启动一个实例
- User –> Credentials are sent –> Keystone
- User <– Temporary Token is created <– Keystone
- User <– Generic catalog is sent <– Keystone
User希望启动一个instance,首先User将自己的Credentials发送给Keystone,Keystone通过这个Credentials来确定User的身份。在User身份验证通过后,Keystone会将一个与User相对应的Temporary Token(含有对这个User的权限控制)和Generic catalog返回给User。
User requests all the tenants 用户请求获得所有租户的列表
- User –> The Temporary Token is provided along the request –> Keystone
- User <– A list of tenants is sent <– Keystone
User将包含有Temporary Token的请求发送给Keystone,请求访问tenants(这个Token决定了User是否有权限访问tenants,或者有访问那些tenants的权限),Keystone或根据Temporary Token来返回一个相应的tenants列表给User。
Keystone provides user with a list of services Keystone为用户提供一个Service的列表
- User –> Credentials are sent with desired tenants –> Keystone
- User <– Keystone sends a list of available services <– Keystone
- User <– The tenant token is provided <– Keystone
- User –> User determines the correct endpoint to launch a service–> Endpoint
- User –> The token is provided along the request –> Endpoint
User将Credentials发送给被包含在Keystone中的特定tenants,在通过验证后Keystone会将一个有效的服务列表和Tenant token返回给User(User在拥有了Tenant token之后才能够访问tenant所包含的service)。在用户在启动一个service之前,还需要确定这个service的位置,即User首先需要获取这个service正确的Endpoint。所以User需要将包含有与service对应的Tenant Token的请求发送到Endpoint,以此来确定service的位置。
The service verifies the user’s token Service验证用户提供的Tenant Token
- Endpoint –> Is the Token correct? –> Keystone
- Endpoint –> Does it allow that service usage? –> Keystone
Endpoint将User发送的Tenant Token转发到Keystone之后,需要Keystone去确定两件事情。1.这个Tenant Token是否正确;2.用户是否能通过这个Tenant Token去访问指定service?
Keystone provides extra infos along the token Keystone提供附加信息和Tenant Token给Service
- Keystone –> user’s tenant is authorized to access the service –> Service
- Keystone –> the token matches with the request –> Service
- Keystone –> That token belong to thr user –> Service
- Service –> the service validates the request against its own policy –> Service
在确定了上述两个问题后,Keystone将结果(1.User的tenant有权访问service;2.Tenant Token与User请求匹配;3.这个Tenant Token属于发出请求的User)发送给service。在service确定能够被User所操作之前,service还需要先确定User请求的操作内容。
The service executes the request Service执行用户的请求
- the service create a new instance
service执行用户新建了一个instance的请求。
- the service create a new instance
The service reports the status back to the user 服务将执行结果状态返回给用户
- The instance has been created
- The instance is reacheable here
告诉User instance已经创建好了。
注意:在上述过程中,常见的灰触发两个ERROR
1. 如果User发出的请求中所包含的Token在经过Keystone的验证后无效(Invalid),则会出发401错误代码。
2. 如果Token有效,但Keystone却不能提供服务,则会返回503错误代码。
简单来说
- User 使用凭证(username/password) 到 keystone 验证并获得一个临时的 Token 和 Generic catalog(全局目录)
,临时的 Token 会存储在 keystone-client(cache UUID locally) 和 keystone-backend 中。 - User 使用这个临时 Token 发送给 keystone 并获得一个该 User 能访问的 Tenants 列表
- User 再跟 keystone 发送一个请求,表明希望访问的 Tenants
- keystone 就会向 User 发送一个管理这个 Tenants 的 Services 列表和允许访问这个 Tenants 的 Token (Tenants Token)
- User 会通过这个 Services 和 Generic catalog(全局目录) 映射找到 Services 的 endpoint,并通过 endpoint 找到实际 Services 组件的位置
- 然后 User 再拿着 Tenant Token 和 endpoint 来访问实际上的 Service 组件
- Service 组件会拿着这个 User-Tennat Token 对到 keystone 做进一步的验证(Openstack 要保证每一步操作都是安全的)
- 如果通过了 7. 的验证的话,keystone 会返回一系列的确认信息和附加信息(User 希望操作的内容)给 Services
- 最后 Services 执行一系列的操作
Openstack组件部署 — Keystone功能介绍与认证实现流程的更多相关文章
- Openstack组件部署 — keystone(domain, projects, users, and roles)
目录 目录 前文列表 Create a domain projects users and roles domain projects users and roles的意义和作用 Create the ...
- Openstack组件部署 — Keystone Install & Create service entity and API endpoints
目录 目录 前文列表 Install and configure Prerequisites 先决条件 Create the database for identity service 生成一个随机数 ...
- Openstack组件部署 — Netwotking service组件介绍与网络基本概念
目录 目录 前文列表 Openstack Networking serivce 基本的Neutron概念 Neutron的抽象对象 网络networks 子网subnets 路由器routers 端口 ...
- Openstack组件部署 — Networking service_Compute Node
目录 目录 前文列表 安装组件 配置通用组件 配置自服务网络选项 配置Linux 桥接代理 配置Nova使用网络 完成安装 验证操作Execute following commands on Cont ...
- Openstack组件部署 — Networking service_安装并配置Controller Node
目录 目录 前文列表 前提条件 网络环境 完成下面的步骤以创建数据库 创建service credentials服务凭证 创建Neutron的API Endpoints 配置自服务网络 安装网络组件 ...
- Openstack组件部署 — Nova_Install and configure a compute node
目录 目录 前文列表 Prerequisites 先决条件 Install and configure a compute node Install the packages Edit the etc ...
- Openstack组件部署 — Nova_安装和配置Controller Node
目录 目录 前文列表 Prerequisites 先决条件 To create the databases To create the service credentials Create the C ...
- Openstack组件部署 — Nova overview
目录 目录 前文列表 前言 Compute service overview Nova 的组件 nova-api service nova-api-metadata service nova-comp ...
- openstack组件之keystone
一 什么是keystone keystone是 OpenStack Identity Service 的项目名称.它在整个体系中充当一个授权者的角色. Keystone项目的主要目的是给整个opens ...
随机推荐
- R 数据分析
目录: windows命令行中执行R dataframe 常用函数.变量 1.windows命令行中执行R 前提:已经把R的命令目录加入了系统路径中. 在windows中,命令行执行R可以用以下两种方 ...
- Nginx反向代理维基百科镜像制作全解析
近日做的Ngnx代理测试,基于Nginx的ngx_http_substitutions_filter_module模块,并利用UA跳转实现PC/移动端不同站点跳转. 1. 关于Nginx的代理详细请转 ...
- 测开之路三十:Flask基础之jinja2模板继承
实现某些位置的内容固定,某些位置的内容动态展示,如: 中文文档地址:http://docs.jinkan.org/docs/jinja2/templates.html#template-inherit ...
- CentOS安装系统时硬盘分区建议
一.常见挂载点的情况说明一般来说,在linux系统中都有最少两个挂载点,分别是/ (根目录)及 swap(交换分区),其中,/ 是必须的: 详细内容见下文: 安装系统时选择creat custom ...
- (转)微信调用扫码和支付功能是都报错 the permission value is offline verifying
原文地址:https://blog.csdn.net/qq_34794885/article/details/98504970
- leetcode.排序.215数组中的第k个最大元素-Java
1. 具体题目 在未排序的数组中找到第 k 个最大的元素.请注意,你需要找的是数组排序后的第 k 个最大的元素,而不是第 k 个不同的元素. 示例 : 输入: [3,2,1,5,6,4] 和 k = ...
- UVALive 4728 Squares(旋转卡壳)
Squares The famous Korean IT company plans to make a digital map of the Earth with help of wireless ...
- RabbitMq--3--案例
https://blog.csdn.net/hellozpc/article/details/81436980
- saltstack基本操作第一篇章
一.安装saltstack 1)官网安装 http://repo.saltstack.com/#rhel saltstack的模块: https://www.unixhot.com/docs/sa ...
- 2018-8-10-wpf-绑定-DataGridTextColumn-
title author date CreateTime categories wpf 绑定 DataGridTextColumn lindexi 2018-08-10 19:16:53 +0800 ...