目录

前文列表

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 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错误代码。

简单来说

  1. User 使用凭证(username/password) 到 keystone 验证并获得一个临时的 Token 和 Generic catalog(全局目录)

    ,临时的 Token 会存储在 keystone-client(cache UUID locally) 和 keystone-backend 中。
  2. User 使用这个临时 Token 发送给 keystone 并获得一个该 User 能访问的 Tenants 列表
  3. User 再跟 keystone 发送一个请求,表明希望访问的 Tenants
  4. keystone 就会向 User 发送一个管理这个 Tenants 的 Services 列表和允许访问这个 Tenants 的 Token (Tenants Token)
  5. User 会通过这个 Services 和 Generic catalog(全局目录) 映射找到 Services 的 endpoint,并通过 endpoint 找到实际 Services 组件的位置
  6. 然后 User 再拿着 Tenant Token 和 endpoint 来访问实际上的 Service 组件
  7. Service 组件会拿着这个 User-Tennat Token 对到 keystone 做进一步的验证(Openstack 要保证每一步操作都是安全的)
  8. 如果通过了 7. 的验证的话,keystone 会返回一系列的确认信息和附加信息(User 希望操作的内容)给 Services
  9. 最后 Services 执行一系列的操作

Openstack组件部署 — Keystone功能介绍与认证实现流程的更多相关文章

  1. Openstack组件部署 — keystone(domain, projects, users, and roles)

    目录 目录 前文列表 Create a domain projects users and roles domain projects users and roles的意义和作用 Create the ...

  2. Openstack组件部署 — Keystone Install & Create service entity and API endpoints

    目录 目录 前文列表 Install and configure Prerequisites 先决条件 Create the database for identity service 生成一个随机数 ...

  3. Openstack组件部署 — Netwotking service组件介绍与网络基本概念

    目录 目录 前文列表 Openstack Networking serivce 基本的Neutron概念 Neutron的抽象对象 网络networks 子网subnets 路由器routers 端口 ...

  4. Openstack组件部署 — Networking service_Compute Node

    目录 目录 前文列表 安装组件 配置通用组件 配置自服务网络选项 配置Linux 桥接代理 配置Nova使用网络 完成安装 验证操作Execute following commands on Cont ...

  5. Openstack组件部署 — Networking service_安装并配置Controller Node

    目录 目录 前文列表 前提条件 网络环境 完成下面的步骤以创建数据库 创建service credentials服务凭证 创建Neutron的API Endpoints 配置自服务网络 安装网络组件 ...

  6. Openstack组件部署 — Nova_Install and configure a compute node

    目录 目录 前文列表 Prerequisites 先决条件 Install and configure a compute node Install the packages Edit the etc ...

  7. Openstack组件部署 — Nova_安装和配置Controller Node

    目录 目录 前文列表 Prerequisites 先决条件 To create the databases To create the service credentials Create the C ...

  8. Openstack组件部署 — Nova overview

    目录 目录 前文列表 前言 Compute service overview Nova 的组件 nova-api service nova-api-metadata service nova-comp ...

  9. openstack组件之keystone

    一 什么是keystone keystone是 OpenStack Identity Service 的项目名称.它在整个体系中充当一个授权者的角色. Keystone项目的主要目的是给整个opens ...

随机推荐

  1. QT中用QStettings生成INI文件来记录QFileDialog::getOpenFileName上次的打开路径

    QSettings setting("./Setting.ini", QSettings::IniFormat); //QSettings能记录一些程序中的信息,下次再打开时可以读 ...

  2. ExportOptions.plis是什么?

    参考: 具体每个字段的说明,参考: https://group.cnblogs.com/topic/80752.html 为什么自动化打包时,需要用到ExportOptions.plis文件,参考: ...

  3. xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

    运行xcode命令报错: sh-3.2# xcodebuild xcode-select: error: tool 'xcodebuild' requires Xcode, but active de ...

  4. Python笔记(七)_全局变量与局部变量

    全局变量与局部变量:在函数外部或内部定义的变量 1. 函数内部的变量名首次出现,且在=号左边 不管这个变量在全局域中有没有定义该变量名,都被视为一个局部变量 例1: >>>num=1 ...

  5. 系统安装1---U盘启动器制作

    1.下载PE制作工具,现在有很多的PE制作工具,如老毛桃,大白菜等.下面我使用的是IT天空的U盘PE制作工具. 下载地址:https://www.itiankong.net/thread-369670 ...

  6. Robot Framework +钉钉通知(Dingding[钉钉] Plugin)构建通知

    1.点击钉钉个人头像进入[机器人管理] 2.添加自定义机器人 3.创建机器人,选择通知群 4.完善机器人信息 5.复制机器人token(只需要连接access_token后面token) 6.进入je ...

  7. 搭建 webpack、react 开发环境(二)

    配置处理样式文件   到目前为止,整个工程的配置已经差不多了,对于 React 更多相关的配置将在后面继续介绍,现在我们先来对目前的工程进行优化. 前面我们学习了搭建 webpack.react 开发 ...

  8. maven上传源码脚本

    mvn deploy:deploy-file -Dmaven.test.skip=true -Dfile=./target/bbc-common-1.0.0-source.jar -DgroupId= ...

  9. Jquery查找界面Html元素的方法(持续更新)

    1. 根据id来获取:$("#id") 2.根据class来获取:$(".class") 3.根据name来获取:$("[name=??]" ...

  10. “CreateRiaClientFilesTask”任务意外失败。 未能加载文件程序集“System.ComponentModel.DataAnnot...

    错误  77  “CreateRiaClientFilesTask”任务意外失败.  System.Web.HttpException (0x80004005): 未能加载文件或程序集“System. ...