此内容没有您所选择的语言版本。
Users and Identity Management Guide
Managing users and authentication mechanisms
Abstract
Making open source more inclusive 复制链接链接已复制到粘贴板!
Red Hat is committed to replacing problematic language in our code, documentation, and web properties. We are beginning with these four terms: master, slave, blacklist, and whitelist. Because of the enormity of this endeavor, these changes will be implemented gradually over several upcoming releases. For more details, see our CTO Chris Wright’s message.
Identity service
As a cloud administrator, you can manage projects, users, and roles. Projects are organizational units in the cloud to which you can assign users. Projects(tenants) are also known as accounts. Users can be members of one or more projects. Roles define the actions that users can perform.
Each OpenStack deployment must include at least one project, one user, and one role, linked together. As a cloud administrator, you can add, update, and delete projects and users, assign users to one or more projects, and change or remove these assignments. You can manage projects and users independently from each other.
You can also configure user authentication with the Keystone identity service to control access to services and endpoints. Keystone provides token-based authentication and can integrate with LDAP and Active Directory, so you can manage users and identities externally and synchronize the user data with Keystone.
Keystone v2 was deprecated in Red Hat OpenStack Platform 11 (Ocata). It was removed in Red Hat OpenStack Platform 13 (Queens), leaving only Keystone v3 available.
Chapter 1. User Management 复制链接链接已复制到粘贴板!
1.1. User Management 复制链接链接已复制到粘贴板!
As a cloud administrator, you can add, modify, and delete users in the dashboard. Users can be members of one or more projects. You can manage projects and users independently from each other.
1.1.1. Create a User 复制链接链接已复制到粘贴板!
Use this procedure to create users in the dashboard. You can assign a primary project and role to the user. Note that users created in the dashboard are Keystone users by default. To integrate Active Directory users, you can configure the LDAP provider included in the Red Hat OpenStack Platform Identity service.
- As an admin user in the dashboard, select Identity > Users.
- Click Create User.
- Enter a user name, email, and preliminary password for the user.
- Select a project from the Primary Project list.
-
Select a role for the user from the Role list (the default role is
_member_). - Click Create User.
1.1.2. Edit a User 复制链接链接已复制到粘贴板!
Use this procedure to update the user’s details, including the primary project.
- As an admin user in the dashboard, select Identity > Users.
- In the User’s Actions column, click Edit.
- In the Update User window, you can update the User Name, Email, and Primary Project.
- Click Update User.
1.1.3. Enable or Disable a User 复制链接链接已复制到粘贴板!
Use this procedure to enable or disable a user. You can disable or enable only one user at a time. A disabled user cannot log in to the dashboard, and does not have access to any OpenStack services. Also, a disabled user’s primary project cannot be set as active. A disabled user can be enabled again, unlike deleting a user where the action cannot be reversed. A disabled user must be re-enabled for any user-project action in the dashboard.
- As an admin user in the dashboard, select Identity > Users.
-
In the Actions column, click the arrow, and select Enable User or Disable User. In the Enabled column, the value then updates to either
TrueorFalse.
1.1.4. Delete a User 复制链接链接已复制到粘贴板!
As an admin user, use this procedure to delete a user using the dashboard. This action cannot be reversed, unlike disabling a user. Deleted users get delisted from a project’s members' list for projects it belongs to. All roles associated with the user-project pair are also lost.
- As an admin user in the dashboard, select Identity > Users.
- Select the users you want to delete.
- Click Delete Users. The Confirm Delete Users window is displayed.
- Click Delete Users to confirm the action.
Chapter 2. Role Management 复制链接链接已复制到粘贴板!
2.1. Role Management 复制链接链接已复制到粘贴板!
OpenStack uses a role-based access control (RBAC) mechanism to manage access to its resources. Roles define which actions users can perform. By default, there are two predefined roles: a member role that gets attached to a tenant, and an administrative role to enable non-admin users to administer the environment. Note that there are abstract levels of permission, and it is possible to create the roles the administrator needs, and configure services adequately.
2.1.1. View Roles 复制链接链接已复制到粘贴板!
Use the following command to list the available predefined roles.
To get details for a specified role, run:
openstack role show admin
$ openstack role show admin
Example
2.1.2. Create and Assign a Role 复制链接链接已复制到粘贴板!
As a cloud administrator, you can create and manage roles on the Keystone client using the following set of commands. Each OpenStack deployment must include at least one project, one user, and one role, linked together. However, users can be members of multiple projects. To assign users to multiple projects, create a role and assign that role to a user-project pair. Note that you can create a user and assign a primary project and default role in the dashboard.
Either the name or ID can be used to specify users, roles, or projects.
Create the
new-rolerole:openstack role create [ROLE_NAME]
$ openstack role create [ROLE_NAME]Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example
Copy to Clipboard Copied! Toggle word wrap Toggle overflow To assign a user to a project, you must assign the role to a user-project pair. To do this, obtain the user, role, and project names or IDs:
List users:
openstack user list
$ openstack user listCopy to Clipboard Copied! Toggle word wrap Toggle overflow List roles:
openstack role list
$ openstack role listCopy to Clipboard Copied! Toggle word wrap Toggle overflow List projects:
openstack project list
$ openstack project listCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Assign a role to a user-project pair.
openstack role add --project [PROJECT_NAME] --user [USER_ID] [ROLE_ID]
openstack role add --project [PROJECT_NAME] --user [USER_ID] [ROLE_ID]Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example
In this example, you assign the
adminrole to theadminuser in thedemoproject:openstack role add --project demo --user 895e43465b9643b9aa29df0073572bb2 ae49e2b796ea4820ac51637be27650d8
$ openstack role add --project demo --user 895e43465b9643b9aa29df0073572bb2 ae49e2b796ea4820ac51637be27650d8Copy to Clipboard Copied! Toggle word wrap Toggle overflow Verify the role assignment for the user
admin:openstack role assignment list --user [USER_ID] --project [PROJECT_ID]
$ openstack role assignment list --user [USER_ID] --project [PROJECT_ID]Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
2.2. Implied Roles 复制链接链接已复制到粘贴板!
2.2.1. Implied roles 复制链接链接已复制到粘贴板!
In OpenStack, access control is enforced by confirming that a user is assigned to a specific role. Until recently, those roles had to be explicitly assigned to either a user, or to a group in which the user was a member. Identity Service (keystone) has now added the concept of implied role assignments: If a user is explicitly assigned to a role, then the user could be implicitly assigned to additional roles as well.
2.2.2. Inference Rules 复制链接链接已复制到粘贴板!
Implied assignment is managed by role inference rules. An inference rule is written in the form superior implies subordinate. For example, a rule might state that the admin role implies the _member_ role. As a result, a user assigned to admin for a project would implicitly be assigned to the _member_ role as well.
With implied roles, a user’s role assignments are processed cumulatively, allowing the user to inherit the subordinate roles. This result is dependent on an inference rule being created that specifies this outcome.
2.2.2.1. Keystone Configuration 复制链接链接已复制到粘贴板!
For keystone to observe implied roles, the infer_roles setting must be enabled in /etc/keystone/keystone.conf:
[token] infer_roles = true
[token]
infer_roles = true
Implied roles are governed by a defined set of inference rules. These rules determine how a role assignment can result in the implied membership of another role. See Section 2.2.3.1, “Demonstration of Implied Roles” for an example.
2.2.3. Prevent Certain Roles From Being Implied 复制链接链接已复制到粘贴板!
You can prevent certain roles from being implied onto a user. For example, in /etc/keystone/keystone.conf, you can add a ListOpt of roles:
[assignment] prohibited_implied_role = admin
[assignment]
prohibited_implied_role = admin
This will prevent a user from ever being assigned a role implicitly. Instead, the user will need to be explicitly granted access to that role.
2.2.3.1. Demonstration of Implied Roles 复制链接链接已复制到粘贴板!
This section describes how to create an inference rule, resulting in an implied role. These rules control how one role can imply membership of another. The example rule used in the following procedure will imply that members of the admin role also have _member_ access:
2.2.3.1.1. Assign a Role to the User 复制链接链接已复制到粘贴板!
Retrieve the ID of a user that will have the
_member_role implied. For example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Retrieve the ID of the
demoproject:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Retrieve the ID of the
adminrole:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Give the
User1useradminprivileges to thedemoproject:openstack role add --user User1 --project demo admin
$ openstack role add --user User1 --project demo adminCopy to Clipboard Copied! Toggle word wrap Toggle overflow Confirm the
adminrole assignment:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
2.2.3.1.2. Create the Inference Rule 复制链接链接已复制到粘贴板!
Now that you have granted the admin role to User1, run the following steps to create the inference rule:
First, confirm User1’s current role membership:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Retrieve the list of role IDs:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create the inference rule. These are currently created using
curl. This example uses the IDs of the roles returned in the previous step. It also runs the command using theadmin_tokenin keystone.conf:source overcloudrc export OS_TOKEN=`grep ^admin_token /etc/keystone/keystone.conf | awk -F'=' '{print $2}'` curl -X PUT -H "X-Auth-Token: $OS_TOKEN" -H "Content-type: application/json" $OS_AUTH_URL/roles/9b821b2920544be7a4d8f71fa99fcd35/implies/9fe2ff9ee4384b1894a90878d3e92babsource overcloudrc export OS_TOKEN=`grep ^admin_token /etc/keystone/keystone.conf | awk -F'=' '{print $2}'` curl -X PUT -H "X-Auth-Token: $OS_TOKEN" -H "Content-type: application/json" $OS_AUTH_URL/roles/9b821b2920544be7a4d8f71fa99fcd35/implies/9fe2ff9ee4384b1894a90878d3e92babCopy to Clipboard Copied! Toggle word wrap Toggle overflow Review the results using the CLI. In this example, User1 has received implied access to the
_member_role, as indicated by ID9fe2ff9ee4384b1894a90878d3e92bab:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Review your inference rules using curl:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Chapter 3. Group Management 复制链接链接已复制到粘贴板!
3.1. Manage Keystone Groups 复制链接链接已复制到粘贴板!
3.1.1. Using the Command-line 复制链接链接已复制到粘贴板!
You can use Identity Service (keystone) groups to assign consistent permissions to multiple user accounts. This example creates a group and then assigns permissions to the group. As a result, members of the group will inherit the same permissions that were assigned to the group:
The openstack group subcommands require keystone v3.
Create the group
grp-Auditors:Copy to Clipboard Copied! Toggle word wrap Toggle overflow View a list of keystone groups:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Grant the
grp-Auditorsgroup permission to access thedemoproject, while using the_member_role:openstack role add _member_ --group grp-Auditors --project demo
$ openstack role add _member_ --group grp-Auditors --project demoCopy to Clipboard Copied! Toggle word wrap Toggle overflow Add the existing user
user1to thegrp-Auditorsgroup:openstack group add user grp-Auditors user1 user1 added to group grp-Auditors
$ openstack group add user grp-Auditors user1 user1 added to group grp-AuditorsCopy to Clipboard Copied! Toggle word wrap Toggle overflow Confirm that
user1is a member ofgrp-Auditors:openstack group contains user grp-Auditors user1 user1 in group grp-Auditors
$ openstack group contains user grp-Auditors user1 user1 in group grp-AuditorsCopy to Clipboard Copied! Toggle word wrap Toggle overflow Review the effective permissions that have been assigned to
user1:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
3.1.2. Using Dashboard 复制链接链接已复制到粘贴板!
You can use the dashboard to manage the membership of keystone groups. You will need to use the command-line to assign role permissions to a group, as covered in the previous example.
3.1.2.1. Create a Group 复制链接链接已复制到粘贴板!
- As an admin user in the dashboard, select Identity > Groups.
- Click +Create Group.
- Enter a name and description for the group.
- Click Create Group.
3.1.2.2. Manage Group Membership 复制链接链接已复制到粘贴板!
You can use the dashboard to manage the membership of keystone groups.
- As an admin user in the dashboard, select Identity > Groups.
- Click Manage Members for the group you need to edit.
- Use Add users to add a user to the group. If you need to remove a user, mark its checkbox and click or Remove users.
Chapter 4. Quota Management 复制链接链接已复制到粘贴板!
4.1. Quota Management 复制链接链接已复制到粘贴板!
As a cloud administrator, you can set and manage quotas for a project. Each project is allocated resources, and project users are granted access to consume these resources. This enables multiple projects to use a single cloud without interfering with each other’s permissions and resources. A set of resource quotas are preconfigured when a new project is created. The quotas include the amount of VCPUs, instances, RAM, floating IPs, that can be assigned to projects. Quotas can be enforced at both the project and the project-user level. Note that you can set or modify Compute and Block Storage quotas for new and existing projects using the dashboard. See Chapter 5, Project Management for the procedure on how to set and update project quotas within the dashboard.
4.1.1. View Compute Quotas for a User 复制链接链接已复制到粘贴板!
Run the following command to list the currently set quota values for a user:
nova quota-show --user [USER] --tenant [TENANT]
$ nova quota-show --user [USER] --tenant [TENANT]
Example
4.1.2. Update Compute Quotas for a User 复制链接链接已复制到粘贴板!
Run the following commands to update a particular quota value:
nova quota-update --user [USER] --[QUOTA_NAME] [QUOTA_VALUE] [TENANT] nova quota-show --user [USER] --tenant [TENANT]
$ nova quota-update --user [USER] --[QUOTA_NAME] [QUOTA_VALUE] [TENANT]
$ nova quota-show --user [USER] --tenant [TENANT]
Example
To view a list of options for the quota-update command, run:
nova help quota-update
$ nova help quota-update
4.1.3. Set Object Storage Quotas for a User 复制链接链接已复制到粘贴板!
Object Storage quotas can be classified under the following categories:
- Container quotas - Limits the total size (in bytes) or number of objects that can be stored in a single container.
- Account quotas - Limits the total size (in bytes) that a user has available in the Object Storage service.
To set either container quotas or the account quotas, the Object Storage proxy server must have the parameters container_quotas or account_quotas (or both) added to the [pipeline:main] section of the proxy-server.conf file:
Use the following command to view and update the Object Storage quotas. All users included in a project can view the quotas placed on the project. To update the Object Storage quotas on a project, you must have the role of a ResellerAdmin in the project.
To view account quotas:
To update quotas:
swift post -m quota-bytes:<BYTES>
# swift post -m quota-bytes:<BYTES>
For example, to place a 5 GB quota on an account:
swift post -m quota-bytes:5368709120
# swift post -m quota-bytes:5368709120
To verify the quota, run the swift stat command again:
Chapter 5. Project Management 复制链接链接已复制到粘贴板!
5.1. Project Management 复制链接链接已复制到粘贴板!
As a cloud administrator, you can create and manage projects (tenants). A tenant describes a project with an assigned number of OpenStack users and resources. It is possible to set up quotas for each tenant. This enables multiple projects to use a single cloud without interfering with each other’s permissions and resources. The words project and tenant are used interchangeably. Users can be associated with more than one project. Each user-project pairing must have a role associated with it.
5.1.1. Create a Project 复制链接链接已复制到粘贴板!
Use this procedure to create projects, add members to the project, and set resource limits for the project.
- As an admin user in the dashboard, select Identity > Projects.
- Click Create Project.
- On the Project Information tab, enter a name and description for the project (the Enabled check box is selected by default).
- On the Project Members tab, add members to the project from the All Users list.
- On the Quotas tab, specify resource limits for the project.
- Click Create Project.
5.1.2. Edit a Project 复制链接链接已复制到粘贴板!
You can edit a project to change its name or description, enable or temporarily disable it, or update its members.
- As an admin user in the dashboard, select Identity > Projects.
- In the project’s Actions column, click the arrow, and click Edit Project.
- In the Edit Project window, you can update a project to change its name or description, and enable or temporarily disable the project.
- On the Project Members tab, add members to the project, or remove them as needed.
- Click Save.
The Enabled check box is selected by default. To temporarily disable the project, clear the Enabled check box. To enable a disabled project, select the Enabled check box.
5.1.3. Delete a Project 复制链接链接已复制到粘贴板!
- As an admin user in the dashboard, select Identity > Projects.
- Select the project you want to delete.
- Click Delete Projects. The Confirm Delete Projects window is displayed.
- Click Delete Projects to confirm the action.
The project gets deleted and any user pairing will be disassociated.
5.1.4. Update Project Quotas 复制链接链接已复制到粘贴板!
Quotas are operational limits that can be set per project to optimize cloud resources. You can set quotas to prevent project resources from being exhausted without notification. Quotas can be enforced at both the project and the project-user level.
- As an admin user in the dashboard, select Identity > Projects.
- In the project’s Actions column, click the arrow, and click Modify Quotas.
- In the Quota tab, modify project quotas as needed.
- Click Save.
5.1.5. Change Active Project 复制链接链接已复制到粘贴板!
A user can set a project as the active project only of which they are a member. It is also necessary for the user to be a member of more than one project to have the Set as Active Project option be enabled. Setting a project as an active project enables you to access objects in the dashboard for the active project. Note that a disabled project cannot be set as active, unless it is re-enabled.
- As an admin user in the dashboard, select Identity > Projects.
- In the project’s Actions column, click the arrow, and click Set as Active Project.
- Alternatively, as a non-admin user, in the project’s Actions column, click Set as Active Project which becomes the default action in the column.
5.2. Project Hierarchies 复制链接链接已复制到粘贴板!
Projects can be nested using multitenancy in keystone. Multitenancy allows subprojects to inherit role assignments from a parent project.
5.2.1.1. Create the Project and Subprojects 复制链接链接已复制到粘贴板!
You can implement Hierarchical Multitenancy (HMT) using keystone domains and projects. Begin by creating a new domain and then creating a project within that domain. You can then add subprojects to that project. You can also promote a user to administrator of a subproject by adding the user to the admin role for that subproject.
The HMT structure used by keystone is not currently represented in the dashboard.
For example:
1. Create a new keystone domain called corp:
2. Create the parent project (private-cloud) within the corp domain:
3. Create a subproject (dev) within the private-cloud parent project, while also specifying the corp domain:
4. Create another subproject called qa:
You can use the Identity API to view the project hierarchy. For more information, see https://developer.openstack.org/api-ref/identity/v3/index.html?expanded=show-project-details-detail
5.2.1.2. Granting Access to Users 复制链接链接已复制到粘贴板!
By default, a newly-created project has no assigned roles. When you assign role permissions to the parent project, you can include the --inherited flag to instruct the subprojects to inherit the assigned permissions from the parent project. For example, a user with admin role access to the parent project will also have admin access to the subprojects.
1. View the existing permissions assigned to a project:
openstack role assignment list --project private-cloud
$ openstack role assignment list --project private-cloud
2. View the existing roles:
3. Grant the user account user1 access to the private-cloud project:
openstack role add --user user1 --user-domain corp --project private-cloud _member_
$ openstack role add --user user1 --user-domain corp --project private-cloud _member_
Re-run the command above using the --inherited flag. As a result, user1 also has access to the private-cloud subprojects, which have inherited the role assignment:
openstack role add --user user1 --user-domain corp --project private-cloud _member_ --inherited
$ openstack role add --user user1 --user-domain corp --project private-cloud _member_ --inherited
4. Review the result of the permissions update:
You will see in the results that user1 has inherited access to the qa and dev projects. In addition, because the --inherited flag was applied to the parent project, user1 will also automatically get access to any subprojects that are created later.
5.2.2. Removing access 复制链接链接已复制到粘贴板!
Explicit and inherited permissions must be separately removed. For example:
1. Remove a user from an explicitly assigned role:
openstack role remove --user user1 --project private-cloud _member_
$ openstack role remove --user user1 --project private-cloud _member_
2. Review the result of the change. Notice that the inherited permissions are still present:
3. Remove the inherited permissions:
openstack role remove --user user1 --project private-cloud _member_ --inherited
$ openstack role remove --user user1 --project private-cloud _member_ --inherited
4. Review the result of the change. The inherited permissions have been removed, and the resulting output is now empty:
openstack role assignment list --effective --user user1 --user-domain corp
$ openstack role assignment list --effective --user user1 --user-domain corp
5.2.3. Nested Quotas 复制链接链接已复制到粘贴板!
At present, nested quotas are not yet supported. As such, you will need to manage quotas individually against projects and subprojects.
5.2.4. Reseller Overview 复制链接链接已复制到粘贴板!
With the Reseller project, the goal is to have a hierarchy of domains; these domains will eventually allow you to consider reselling portions of the cloud, with a subdomain representing a fully-enabled cloud. This work has been split into phases, with phase 1 described below:
5.2.4.1. Phase 1 of Reseller 复制链接链接已复制到粘贴板!
Reseller (phase 1) is an extension of Hierarchical Multitenancy (HMT), described here: Section 5.2.1, “Hierarchical Multitenancy (HMT) in Identity Service”. Previously, keystone domains were originally intended to be containers that stored users and projects, with their own table in the database back-end. As a result, domains are now no longer stored in their own table, and have been merged into the project table:
-
A domain is now a type of project, distinguished by the
is_domainflag. - A domain represents a top-level project in the project hierarchy: domains are roots in the project hierarchy
APIs have been updated to create and retrieve domains using the
projectssubpath:-
Create a new domain by creating a project with the
is_domainflag set to true -
List projects that are domains: get projects including the
is_domainquery parameter.
-
Create a new domain by creating a project with the
Phase 1 does not allow you to create a hierarchy of domains, meaning that the subdomains are not yet available. In addition, this does not change the scope of tokens, neither does it include the hierarchy support necessary for projects other than keystone.
5.3. Project Security Management 复制链接链接已复制到粘贴板!
Security groups are sets of IP filter rules that can be assigned to project instances, and which define networking access to the instance. Security groups are project specific; project members can edit the default rules for their security group and add new rule sets.
All projects have a default security group that is applied to any instance that has no other defined security group. Unless you change the default values, this security group denies all incoming traffic and allows only outgoing traffic to your instance.
5.3.1. Create a Security Group 复制链接链接已复制到粘贴板!
- In the dashboard, select Project > Compute > Access & Security.
- On the Security Groups tab, click Create Security Group.
- Provide a name and description for the group, and click Create Security Group.
5.3.2. Add a Security Group Rule 复制链接链接已复制到粘贴板!
By default, rules for a new group only provide outgoing access. You must add new rules to provide additional access.
- In the dashboard, select Project > Compute > Access & Security.
- On the Security Groups tab, click Manage Rules for the security group that you want to edit.
- Click Add Rule to add a new rule.
Specify the rule values, and click Add.
The following rule fields are required:
- Rule
Rule type. If you specify a rule template (for example, SSH), its fields are automatically filled in:
- TCP: Typically used to exchange data between systems, and for end-user communication.
- UDP: Typically used to exchange data between systems, particularly at the application level.
- ICMP: Typically used by network devices, such as routers, to send error or monitoring messages.
- Direction
- Ingress (inbound) or Egress (outbound).
- Open Port
For TCP or UDP rules, the Port or Port Range (single port or range of ports) to open:
- For a range of ports, enter port values in the From Port and To Port fields.
- For a single port, enter the port value in the Port field.
- Type
- The type for ICMP rules; must be in the range -1:255.
- Code
- The code for ICMP rules; must be in the range -1:255.
- Remote
The traffic source for this rule:
- CIDR (Classless Inter-Domain Routing): IP address block, which limits access to IPs within the block. Enter the CIDR in the Source field.
- Security Group: Source group that enables any instance in the group to access any other group instance.
5.3.3. Delete a Security Group Rule 复制链接链接已复制到粘贴板!
- In the dashboard, select Project > Compute > Access & Security.
- On the Security Groups tab, click Manage Rules for the security group.
- Select the security group rule, and click Delete Rule.
- Click Delete Rule again.
You cannot undo the delete action.
5.3.4. Delete a Security Group 复制链接链接已复制到粘贴板!
- In the dashboard, select Project > Compute > Access & Security.
- On the Security Groups tab, select the group, and click Delete Security Groups.
- Click Delete Security Groups.
You cannot undo the delete action.
Chapter 6. Domain Management 复制链接链接已复制到粘贴板!
Identity Service (keystone) domains are additional namespaces you can create in keystone. You would use keystone domains to partition users, groups, and projects. These separate domains can also be configured to authenticate users in different LDAP or Active Directory environments. For more information see Integrate with Identity Service.
Identity Service includes a built-in domain called Default. It is suggested you reserve this domain only for service accounts, and create a separate domain for user accounts.
6.1. View a List of Domains 复制链接链接已复制到粘贴板!
You can view a list of domains using openstack domain list. For example:
If this command is not available, check you have enabled keystone v3 for your command line session.
6.2. Create a New Domain 复制链接链接已复制到粘贴板!
You can create a new domain using openstack domain create. For example:
6.3. View the Details of a Domain 复制链接链接已复制到粘贴板!
You can view the details of a domain using openstack domain show. For example:
6.4. Disable a Domain 复制链接链接已复制到粘贴板!
You can disable a domain using
--disable. For example:openstack domain set TestDomain --disable
$ openstack domain set TestDomain --disableCopy to Clipboard Copied! Toggle word wrap Toggle overflow Confirm the domain has been disabled:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow You can then re-enable the domain, if required:
openstack domain set TestDomain --enable
$ openstack domain set TestDomain --enableCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Chapter 7. Identity Management 复制链接链接已复制到粘贴板!
7.1. Secure LDAP Communication 复制链接链接已复制到粘贴板!
If you have configured the Identity service (keystone) to authenticate against or to retrieve identity information from an LDAP server, you can secure LDAP communication for the Identity service using a CA certificate.
This section outlines how to obtain the CA certificate from Active Directory, how to convert the CA certificate file into Privacy Enhanced Mail (PEM) file format, and the three methods for configuring secure LDAP communication for the Identity service. The procedure in each method must be performed depending on where and how the CA trust is configured.
The following code shows an example of how to query Active Directory to obtain the CA certificate. The CA_NAME is the name of the certificate (you can see it in mmc.exe) and the rest of the parameters can be changed according to your setup:
Create a file called /path/cacert.pem and include the contents of the LDAP query — that obtained the CA certificate from Active Directory, within the header and footer, as shown in the example below:
-----BEGIN CERTIFICATE----- MIIDbzCCAlegAwIBAgIQQD14hh1Yz7tPFLXCkKUOszANB... -----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
MIIDbzCCAlegAwIBAgIQQD14hh1Yz7tPFLXCkKUOszANB... -----END
CERTIFICATE-----
For troubleshooting, you can execute the following query to check if LDAP is working, and to ensure the PEM certificate file was created correctly.
LDAPTLS_CACERT=/path/cacert.pem ldapsearch -xLLL -ZZ -H $LDAPURL -s base -b "" "objectclass=*" currenttime
LDAPTLS_CACERT=/path/cacert.pem ldapsearch -xLLL -ZZ -H $LDAPURL -s base -b "" "objectclass=*" currenttime
The query should return a result similar to:
dn: currentTime: 20141022050611.0Z
dn: currentTime:
20141022050611.0Z
You can run the following command to get a CA certificate if it was hosted by a web server.
Example
- $HOST=redhat.com
- $PORT=443
echo Q | openssl s_client -connect $HOST:$PORT | sed -n -e '/BEGIN CERTIFICATE/,/END CERTIFICATE/ p'
# echo Q | openssl s_client -connect $HOST:$PORT | sed -n -e '/BEGIN CERTIFICATE/,/END CERTIFICATE/ p'
7.1.3.1. Method 1 复制链接链接已复制到粘贴板!
Use this method if the CA trust is configured at the LDAP level using a PEM file. Manually specify the location of a CA certificate file. The following procedure secures LDAP communication not only for the Identity service, but for all applications that use the OpenLDAP libraries.
-
Copy the file containing your CA certificate chain in PEM format to the
/etc/openldap/certsdirectory. Edit
/etc/openldap/ldap.confand add the following directive, replacing [CA_FILE] with the location and name of the CA certificate file:TLS_CACERT /etc/openldap/certs/[CA_FILE]
TLS_CACERT /etc/openldap/certs/[CA_FILE]Copy to Clipboard Copied! Toggle word wrap Toggle overflow Restart the httpd service:
systemctl restart httpd.service
# systemctl restart httpd.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow
7.1.3.2. Method 2 复制链接链接已复制到粘贴板!
Use this method if the CA trust is configured at the LDAP library level using a Network Security Services (NSS) database. Use the certutil command to import and trust a CA certificate into the NSS certificate database used by the OpenLDAP libraries. The following procedure secures LDAP communication not only for the Identity service, but for all applications that use the OpenLDAP libraries.
Import and trust the certificate, replacing [CA_FILE] with the location and name of the CA certificate file:
certutil -d /etc/openldap/certs -A -n "My CA" -t CT,, -a -i [CA_FILE] certutil -d /etc/openldap/certs -A -n "My CA" -t CT,, -a -i [CA_FILE]
# certutil -d /etc/openldap/certs -A -n "My CA" -t CT,, -a -i [CA_FILE] # certutil -d /etc/openldap/certs -A -n "My CA" -t CT,, -a -i [CA_FILE]Copy to Clipboard Copied! Toggle word wrap Toggle overflow Confirm the CA certificate was imported correctly:
certutil -d /etc/openldap/certs -L
# certutil -d /etc/openldap/certs -LCopy to Clipboard Copied! Toggle word wrap Toggle overflow Your CA certificate is listed, and the trust attributes are set to CT,,.
Restart the httpd service:
systemctl restart httpd.service
# systemctl restart httpd.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow
7.1.3.3. Method 3 复制链接链接已复制到粘贴板!
Use this method if the CA trust is configured at the Keystone level using a PEM file. The final method of securing communication between the Identity service and an LDAP server is to configure TLS for the Identity service.
However, unlike the two methods above, this method only secures LDAP communication for the Identity service and does not secure LDAP communication for other applications that use the OpenLDAP libraries.
The following procedure uses the openstack-config command to edit values in the /etc/keystone/keystone.conf file.
Enable TLS:
openstack-config --set /etc/keystone/keystone.conf ldap use_tls True
# openstack-config --set /etc/keystone/keystone.conf ldap use_tls TrueCopy to Clipboard Copied! Toggle word wrap Toggle overflow Specify the location of the certificate, replacing [CA_FILE] with the name of the CA certificate:
openstack-config --set /etc/keystone/keystone.conf ldap tls_cacertfile [CA_FILE]
# openstack-config --set /etc/keystone/keystone.conf ldap tls_cacertfile [CA_FILE]Copy to Clipboard Copied! Toggle word wrap Toggle overflow Specify the client certificate checks performed on incoming TLS sessions from the LDAP server, replacing [CERT_BEHAVIOR] with one of the behaviors listed below:
- demand
- a certificate will always be requested from the LDAP server. The session will be terminated if no certificate is provided, or if the certificate provided cannot be verified against the existing certificate authorities file.
- allow
- a certificate will always be requested from the LDAP server. The session will proceed as normal even if a certificate is not provided. If a certificate is provided but it cannot be verified against the existing certificate authorities file, the certificate will be ignored and the session will proceed as normal.
- never
- a certificate will never be requested.
openstack-config --set /etc/keystone/keystone.conf ldap tls_req_cert [CERT_BEHAVIOR]
# openstack-config --set /etc/keystone/keystone.conf ldap tls_req_cert [CERT_BEHAVIOR]Copy to Clipboard Copied! Toggle word wrap Toggle overflow Restart the httpd service:
systemctl restart httpd.service
# systemctl restart httpd.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow