• keystone认证服务


    实验操作平台:OpenStack单节点操作

    一、相关概念

    1、认证(authentication)

    认证是确认允许一个用户访问的进程

    2、证书(credentials)

    用于确认用户身份的数据

    3、令牌(token)

    通常指的是一串比特值或者字符串,用来作为访问资源的记号。(令牌的有效期是有限的,可以随时被撤回)

    4、租户(tenant)

    早期版本又称为project,它是各服务中的一些可以访问的资源集合

    平台构建完毕会产生admin、service和demo三个租户。

    admin租户代表管理组,拥有平台的最高权限,可以更新、删除和修改系统的任何数据。

    service代表平台内所有的服务的总集合,平台安装的所有服务默认会加入到此租户中,为后期的统一管理提供帮助,此租户可以修改当期租户下所有服务的配置信息,提交租户的内容以及修改。

    demo则是一个演示测试租户

    5、用户(user)

    使用服务的用户,可以是人、服务或系统使用OpenStack相关服务的一个组织

    6、角色(role)

    代表一组用户可以访问的资源权限

    平台构建完毕,系统会创建_member_、admin两个用户权限,

    _member_表示系统的普通用户的权限,拥有系统的正常使用和对当前租户的管理权限

    admin角色是代表系统的管理员身份,对系统又绝对的管理权限

    7、关系

    OpenStack中项目(project)、用户(user)和角色(role)3者的关系如下:

    项目是用户的集合,项目又称为租户或accounts,用户可以属于一个或多个项目,角色决定了用户的权限,可以分配角色给user-project组

    8、认证服务流程

    用户请求云主机的流程涉及认证Keystone服务、计算Nova服务、镜像Glance服务,在服务流程中,令牌(Token)作为流程认证传递,具体服务申请认证机制流程,如图:

    服务申请认证机制流程

    二、配置keystone应用环境

    管理用户的环境变量:admin-openrc.sh

    来管理最终的凭证和终端

    主配置文件位置

    [root@controller ~]# cd /etc/keystone/
    [root@controller keystone]# ls
    admin-openrc.sh  default_catalog.templates  keystone.conf  logging.conf  policy.json  ssl

    请求身份令牌来验证服务

    [root@controller ~]# keystone --os-username=admin --os-password=000000 --os-auth-url=http://192.168.100.10:35357/v2.0 token-get
    +-----------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    |  Property |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Value                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
    +-----------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    |  expires  |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       2019-01-24T17:05:36Z                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
    |     id    | MIIM0gYJKoZIhvcNAQcCoIIMwzCCDL8CAQExCTAHBgUrDgMCGjCCCygGCSqGSIb3DQEHAaCCCxkEggsV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-Fb3nC7cG27QXfwzg== |
    | tenant_id |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 18e38545a20f4fbb8dba8944118d43bc                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
    |  user_id  |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 4dfa571804444b8684f42d25667e2e0c                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
    +-----------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    [root@controller ~]# 

     以admin用户访问http://172.24.0.10:35357/v2.0地址获取token值

    三、管理认证用户

    1、创建用户

    创建一个名称为“alice”账户,密码为“mypassword123”,邮箱为“alice@example.com”

     # keystone user-create --name=alice --pass=mypassword123 --email=alice@example.com

    格式如下

    keystone user-create --name <user-name> --tenant <tenant> --pass <pass> --email <email> --enabled <true|false>

    参数 <tenant>代表绑定租户

    [root@controller ~]# keystone user-create --name=alice --pass=mypassword123 --email=alice@example.com
    +----------+----------------------------------+
    | Property |              Value               |
    +----------+----------------------------------+
    |  email   |        alice@example.com         |
    | enabled  |               True               |
    |    id    | cf126a8e69574dd6ba48acff29046951 |
    |   name   |              alice               |
    | username |              alice               |
    +----------+----------------------------------+

     查看

    2、创建租户

     创建一个名为“acme”租户

    其他参数:

    租户描述名:[--description <tenant-description>]

    [--enabled <true|false>]

    # keystone tenant-create --name=acme

    [root@controller ~]# keystone tenant-create --name=acme
    +-------------+----------------------------------+
    |   Property  |              Value               |
    +-------------+----------------------------------+
    | description |                                  |
    |   enabled   |               True               |
    |      id     | 12ad967d5d6742328f007749917cc5b1 |
    |     name    |               acme               |
    +-------------+----------------------------------+

     

    3、创建角色

    角色限定了用户的操作权限。例如,创建一个角色“compute-user”。

    # keystone role-create --name=compute-user

    [root@controller ~]# keystone role-create --name=compute-user
    +----------+----------------------------------+
    | Property |              Value               |
    +----------+----------------------------------+
    |    id    | c26db3d217044f32a3f27fa88874eba6 |
    |   name   |           compute-user           |
    +----------+----------------------------------+

     4、绑定用户和租户权限

    把用户关联绑定到对应的租户和角色

    给用户“alice”分配“acme”租户下的“compute-user”角色

    # keystone user-role-add --user=alice --role=compute-user --tenant-id=12ad967d5d6742328f007749917cc5b1

    [root@controller ~]# keystone user-role-add --user=alice --role=compute-user --tenant-id=12ad967d5d6742328f007749917cc5b1
    [root@controller ~]#

    在OpenStack中验证服务的身份令牌也可以直接在admin-openrc.sh文件中定义系统用户、密码以及认证服务的endpoint等参数,在实际应用中,直接引用(source)环境变量,即可使用Keystone。

    四、OpenStack服务

    Nova、Glance、Swift、Heat、Ceilometer

    Nova提供云计算服务

    Glance提供镜像管理服务

    Swift提供对象存储服务

    Heat提供资源编排服务

    Ceilometer提供告警计费服务

    Cinder提供块存储服务

    OpenStack为每一个服务提供一个用于访问的端点(endpoint),如果需要访问服务,则必须知道它的端点,端点一般为url,我们知道服务的url,就可以访问它。

    端点的url具有public、private和admin三种权限。

    public url可以被全局访问

    private url只能被局域网访问

    admin url被从常规的访问中分离出来

    1、查询服务目录

    显示所有已有的service

    # keystone catalog

    [root@controller ~]# keystone catalog
    Service: compute
    +-------------+------------------------------------------------------------+
    |   Property  |                           Value                            |
    +-------------+------------------------------------------------------------+
    |   adminURL  | http://controller:8774/v2/18e38545a20f4fbb8dba8944118d43bc |
    |      id     |              457b385b70bc41028db398ddfb2c5853              |
    | internalURL | http://controller:8774/v2/18e38545a20f4fbb8dba8944118d43bc |
    |  publicURL  | http://controller:8774/v2/18e38545a20f4fbb8dba8944118d43bc |
    |    region   |                         regionOne                          |
    +-------------+------------------------------------------------------------+
    Service: network
    +-------------+----------------------------------+
    |   Property  |              Value               |
    +-------------+----------------------------------+
    |   adminURL  |      http://controller:9696      |
    |      id     | 7c49b4b273f6407db5b36fff0e23fea7 |
    | internalURL |      http://controller:9696      |
    |  publicURL  |      http://controller:9696      |
    |    region   |            regionOne             |
    +-------------+----------------------------------+
    Service: volumev2
    +-------------+------------------------------------------------------------+
    |   Property  |                           Value                            |
    +-------------+------------------------------------------------------------+
    |   adminURL  | http://controller:8776/v2/18e38545a20f4fbb8dba8944118d43bc |
    |      id     |              42f20219639e47688ebdc36fc0019bbc              |
    | internalURL | http://controller:8776/v2/18e38545a20f4fbb8dba8944118d43bc |
    |  publicURL  | http://controller:8776/v2/18e38545a20f4fbb8dba8944118d43bc |
    |    region   |                         regionOne                          |
    +-------------+------------------------------------------------------------+
    Service: image
    +-------------+----------------------------------+
    |   Property  |              Value               |
    +-------------+----------------------------------+
    |   adminURL  |      http://controller:9292      |
    |      id     | 297186152dd84251979cdbea065ec688 |
    | internalURL |      http://controller:9292      |
    |  publicURL  |      http://controller:9292      |
    |    region   |            regionOne             |
    +-------------+----------------------------------+
    Service: volume
    +-------------+------------------------------------------------------------+
    |   Property  |                           Value                            |
    +-------------+------------------------------------------------------------+
    |   adminURL  | http://controller:8776/v1/18e38545a20f4fbb8dba8944118d43bc |
    |      id     |              317cafaa9bf04ba6856292a2d24ccb0b              |
    | internalURL | http://controller:8776/v1/18e38545a20f4fbb8dba8944118d43bc |
    |  publicURL  | http://controller:8776/v1/18e38545a20f4fbb8dba8944118d43bc |
    |    region   |                         regionOne                          |
    +-------------+------------------------------------------------------------+
    Service: object-store
    +-------------+-----------------------------------------------------------------+
    |   Property  |                              Value                              |
    +-------------+-----------------------------------------------------------------+
    |   adminURL  | http://controller:8080/v2/AUTH_18e38545a20f4fbb8dba8944118d43bc |
    |      id     |                 3d9e5f3ba5be4839ae65e8f064170951                |
    | internalURL | http://controller:8080/v2/AUTH_18e38545a20f4fbb8dba8944118d43bc |
    |  publicURL  | http://controller:8080/v2/AUTH_18e38545a20f4fbb8dba8944118d43bc |
    |    region   |                            regionOne                            |
    +-------------+-----------------------------------------------------------------+
    Service: identity
    +-------------+----------------------------------+
    |   Property  |              Value               |
    +-------------+----------------------------------+
    |   adminURL  |   http://controller:35357/v2.0   |
    |      id     | 05c22577025a409393ee64f46e97ac40 |
    | internalURL |   http://controller:5000/v2.0    |
    |  publicURL  |   http://controller:5000/v2.0    |
    |    region   |            regionOne             |
    +-------------+----------------------------------+
    [root@controller ~]# 

    2、显示某个service信息

    keystone catalog --service <service-type>

    [root@controller ~]# keystone catalog --service network
    Service: network
    +-------------+----------------------------------+
    |   Property  |              Value               |
    +-------------+----------------------------------+
    |   adminURL  |      http://controller:9696      |
    |      id     | 7c49b4b273f6407db5b36fff0e23fea7 |
    | internalURL |      http://controller:9696      |
    |  publicURL  |      http://controller:9696      |
    |    region   |            regionOne             |
    +-------------+----------------------------------+

    3、查询Keystone服务器和授权协议

    # keystone discover

    [root@controller ~]# keystone discover
    Keystone found at http://controller:35357/v2.0
        - supports version v2.0 (stable) here http://controller:35357/v2.0/
            - and s3tokens: OpenStack S3 API
            - and OS-EP-FILTER: OpenStack Keystone Endpoint Filter API
            - and OS-FEDERATION: OpenStack Federation APIs
            - and OS-KSADM: OpenStack Keystone Admin
            - and OS-SIMPLE-CERT: OpenStack Simple Certificate API
            - and OS-EC2: OpenStack EC2 API
    [root@controller ~]# 

    4、创建服务

    格式:

    keystone service-create --name <name> --type <type> --description <service-description>

    参数说明:

    --name <name>:创建的服务名称。

    --type <type>:创建服务类型。

    --description <service-description> 创建服务描述

    5、创建服务访问端点

    格式:

    keystone endpoint-create --region <endpoint-region> --service <service> --publicurl <public-url> --adminurl <admin-url> --internalurl <internal-url>

    参数说明:

    --region <endpoint-region>:创建端点的区域名称。

    --service <service>:端点创建的使用服务名称。

    --publicurl <public-url>:对外服务的URL地址。

    --adminurl <admin-url>:管理网络访问的URL地址。

    --internalurl <internal-url>:内部访问的URL地址。

    6、其他常用的keystone命令

    # keystone bash-completion

    输出可选的命令,即选项

    [root@controller ~]# keystone bash-completion
    --enabled --tenant_id --value --role help --region tenant-get --user-id user-list discover ec2-credentials-create --tenant-id --role-name user-role-add --pass user-delete tenant-delete endpoint-delete --service-id --service_id role-create endpoint-create password-update --tenant-name service-create --user-name tenant-update --endpoint-type --new-password  -h user-create --tenant --service --description --wrap endpoint-list ec2-credentials-delete --role_id user-role-remove role-get tenant-list ec2-credentials-list user-get --user --publicurl catalog --user_id user-role-list role-delete --endpoint_type --attr user-update endpoint-get --type --access ec2-credentials-get --name --internalurl --email bootstrap role-list user-password-update --help tenant-create --current-password token-get --adminurl service-delete service-get service-list --role-id
    [root@controller ~]# 

    end

  • 相关阅读:
    Kefa and Park
    分土地
    果园里的树
    分解质因数
    素数筛
    cantor的数表
    new一个二维数组
    基础练习 十六进制转八进制
    查函数功能
    concatenate函数
  • 原文地址:https://www.cnblogs.com/djlsunshine/p/10316361.html
Copyright © 2020-2023  润新知