zoukankan      html  css  js  c++  java
  • [原]Openstack之identity server(keystone)

    本博客已经添加"打赏"功能,"打赏"位置位于右边栏红色框中,感谢您赞助的咖啡.

    重新温习keystone的概念和理解

    -------------------------------↓个人对官方文档中概念的理解------------

    User

    Digital representation of a person, system, or service who uses
    OpenStack cloud services. The Identity service validates that incoming
    requests are made by the user who claims to be making the call.
    Users have a login and may be assigned tokens to access resources.
    Users can be directly assigned to a particular tenant and behave as if
    they are contained in that tenant.

    可以理解为用户,系统或者一个服务


    Credentials

    Data that confirms the user's identity. For example: user name and
    password, user name and API key, or an authentication token provided
    by the Identity Service.

    可以理解为证书:包括用户名和密码,或者用户名和APIkey,或者身份验证服务颁发的token


    Authentication

    The process of confirming the identity of a user. OpenStack Identity
    confirms an incoming request by validating a set of credentials supplied
    by the user.
    These credentials are initially a user name and password, or a user
    name and API key. When user credentials are validated, OpenStack
    Identity issues an authentication token which the user provides in
    subsequent requests.

    可以理解为一个用户认证进程。由用户发送一组证书给openstack进行认证。

    证书的初始化由用户名和密码,或者用户名和APIkey。如果证书有效。openstack

    将颁发一个证书给authentication token给用户,用户将用这个authentication token来

    发起以后的请求。

    Token

    An alpha-numeric string of text used to access OpenStack APIs and
    resources. A token may be revoked at any time and is valid for a finite
    duration.While OpenStack Identity supports token-based authentication in

    this release, the intention is to support additional protocols in the future.
    Its main purpose is to be an integration service, and not aspire
    to be a full-fledged identity store and management solution.

    可以理解为一个由identity server 颁发的令牌,用户有token才能接入APIs 和资源

    这个令牌可以随时收回,也可以设置在一段时间有效。

    在未来支持附加的协议,keystone的主要目的是集成服务,而不是渴望成为一个完全

    的认证仓库和管理解决方案。

    Tenant

    A container used to group or isolate resources. Tenants also group
    or isolate identity objects. Depending on the service operator, a tenant
    may map to a customer, account, organization, or project.

    租户,可以理解为一个分组或者隔离资源和身份对象的容器。可以根据service的操作者

    容器和映射为一个用户,账号,组织或者项目

    Service

    An OpenStack service, such as Compute (nova), Object Storage
    (swift), or Image service (glance). It provides one or more endpoints
    in which users can access resources and perform operations

    理解为OpenStack service,可以通过一个或者多个endpoints来接入service执行相关操作

    Endpoint

    A network-accessible address where you access a service, usually a
    URL address. If you are using an extension for templates, an endpoint
    template can be created, which represents the templates of all
    the consumable services that are available across the regions.

    接入服务的一个URL地址,如果想扩展templates,会创建一个endpoint
    template。它能包含所有可用服务区域的接入口

    Role

    A personality with a defined set of user rights and privileges to perform
    a specific set of operations.

    In the Identity service, a token that is issued to a user includes the
    list of roles. Services that are being called by that user determine
    how they interpret the set of roles a user has and to which operations
    or resources each role grants access.

    一个操作者包含的一套权限和特权。

    在identity service 中,一个包含了roles 列表的token将被分给一个user,这个user请求的

    服务,将决定怎么去解释这个用户在这个服务中所拥有的操作和访问权限。

    Keystone Client

    A command line interface for the OpenStack Identity API. For example,

    users can run the keystone service-create and keystone endpoint-
    create commands to register services in their OpenStack installations.

    Openstack API的一个命令行接口,例如,用户可以在openstack的安装环境中运行service-create和keystone endpoint-
    create来注册服务

    ----------↑个人对官方文档中概念的理解----↓网友对keystone的一些理解--------------

    Keystone简介

      Keystone(OpenStack Identity Service)是OpenStack框架中,负责身份验证、

    服务规则和服务令牌的功能, 它实现了OpenStack的Identity API。Keystone类似一个服

    务总线, 或者说是整个Openstack框架的注册表, 其他服务通过keystone来注册其服务

    的Endpoint(服务访问的URL),任何服务之间相互的调用, 需要经过Keystone的身份

    验证, 来获得目标服务的Endpoint来找到目标服务。

    Keystone基本概念介绍

      1. User

      User即用户,他们代表可以通过keystone进行访问的人或程序。Users通过认证信息

    (credentials,如密码、API Keys等)进行验证。

      2. Tenant

      Tenant即租户,它是各个服务中的一些可以访问的资源集合。例如,在Nova中一个

    tenant可以是一些机器,在Swift和Glance中一个tenant可以是一些镜像存储,在Quantum中

    一个tenant可以是一些网络资源。Users默认的总是绑定到某些tenant上。

     
     

      3. Role

      Role即角色,Roles代表一组用户可以访问的资源权限,例如Nova中的虚拟机、Glance中

    的镜像。Users可以被添加到任意一个全局的 或 租户内的角色中。在全局的role中,用户的role

    权限作用于所有的租户,即可以对所有的租户执行role规定的权限;在租户内的role中,用户仅能

    在当前租户内执行role规定的权限。

      4. Service

      Service即服务,如Nova、Glance、Swift。根据前三个概念(User,Tenant和Role)一

    个服务可以确认当前用户是否具有访问其资源的权限。但是当一个user尝试着访问其租户内的

    service时,他必须知道这个service是否存在以及如何访问这个service,这里通常使用一些不

    同的名称表示不同的服务。在上文中谈到的Role,实际上也是可以绑定到某个service的。例如,

    当swift需要一个管理员权限的访问进行对象创建时,对于相同的role我们并不一定也需要对nova

    进行管理员权限的访问。为了实现这个目标,我们应该创建两个独立的管理员role,一个绑定到swift

    ,另一个绑定到nova,从而实现对swift进行管理员权限访问不会影响到Nova或其他服务。

      5. Endpoint

      Endpoint,翻译为“端点”,我们可以理解它是一个服务暴露出来的访问点,如果需要访问一个

    服务,则必须知道他的endpoint。因此,在keystone中包含一个endpoint模板(endpoint template,

    在安装keystone的时候我们可以在conf文件夹下看到这个文件),这个模板提供了所有存在的服务endpoints信息。

    一个endpoint template包含一个URLs列表,列表中的每个URL都对应一个服务实例的访问地址,并且具

    有public、private和admin这三种权限。public url可以被全局访问(如http://compute.example.com),

    private url只能被局域网访问(如http://compute.example.local),admin url被从常规的访问中分离。

    ----------------------------------------------------------↓引用 Aaron 的理解---------------------------------

    keystone 里面的概念很多,有:User,Credentials,Authentication,Token,Tenant,Service,Endpoint,Role。在这么多概念中,其实最主要的就是 User 和 Tenant 。由于一些安全,服务问题,才引发了其它的概念。
      那什么叫做 User ,Tenant 呢?这里我举个比较好理解的例子。我们去宾馆住的时候,我们自己就相当于 User ,而宾馆就是 Tenant 。这是最简单的情况,宾馆值提供房间,我们只需要住房。
      随着后来生活物质等的提高,这种现象就变了。我们去宾馆住的时候,很多东西都不一样,比如,开房间要身份证,房间的钥匙是一个可以当卡刷的牌子,我们进出宾馆的时候需要用自己的钥匙来开启宾馆的大门;还有就是,宾馆不仅仅是用来住的了,它可以给我们提供饮食,娱乐,健身等各种服务;而且服务层次的不同,房间也不同,房间里面的配置豪华程度也不一样。在这种情况下,描述我们和宾馆之间的关系就复杂一些了,这就引发了一些新的概念。
      举完这个例子, keystone 中的各种概念就可以和例子中的事物相挂钩了。

    User 住宾馆的人
    Credentials 开启房间的钥匙
    Authentication 宾馆为了拒绝不必要的人进出宾馆,专门设置的机制,只有拥有钥匙的人才能进出
    Token 也是一种钥匙,有点特别
    Tenant 宾馆
    Service 宾馆可以提供的服务类别,比如,饮食类,娱乐类
    Endpoint 具体的一种服务,比如吃烧烤,打羽毛球
    Role VIP 等级,VIP越高,享有越高的权限

    Keystone在OpenStack中的访问流程范例(注:下面是G版之前的情况,G版使用的是PKI)

       

  • 相关阅读:
    【BZOJ1492】【NOI2007】货币兑换(动态规划,CDQ分治,Splay)
    【CF311E】Biologist(网络流,最小割)
    【BZOJ1391】Order(网络流,最小割)
    【BZOJ2007】【NOI2010】海拔(最小割,平面图转对偶图,最短路)
    【BZOJ1001】狼抓兔子(平面图转对偶图,最短路)
    【BZOJ1458】【洛谷4311】士兵占领(网络流)
    【BZOJ2756】奇怪的游戏(二分,网络流)
    【BZOJ1143】祭祀(网络流)
    【BZOJ3504】危桥(网络流)
    【洛谷3852】小朋友(弦图)
  • 原文地址:https://www.cnblogs.com/horizonli/p/5536585.html
Copyright © 2011-2022 走看看