summaryrefslogtreecommitdiffstats
path: root/meta-openstack
diff options
context:
space:
mode:
authorAmy Fong <amy.fong@windriver.com>2014-07-23 11:09:38 -0400
committerBruce Ashfield <bruce.ashfield@windriver.com>2014-07-30 00:50:59 -0400
commitceecd0d46de35111f4c3c1e65176e09cb2117ecb (patch)
tree4c436f5d60fa42600855b740e5c36da261ccd6e0 /meta-openstack
parentc9e43b535ca44d06fcd57c9c670af6da59d0edb3 (diff)
downloadmeta-cloud-services-ceecd0d46de35111f4c3c1e65176e09cb2117ecb.tar.gz
OpenLDAP README
Add a README file pertaining to the openldap/keystone/pam usage. Signed-off-by: Amy Fong <amy.fong@windriver.com>
Diffstat (limited to 'meta-openstack')
-rw-r--r--meta-openstack/Documentation/README.OpenLDAP165
1 files changed, 165 insertions, 0 deletions
diff --git a/meta-openstack/Documentation/README.OpenLDAP b/meta-openstack/Documentation/README.OpenLDAP
new file mode 100644
index 0000000..06e186e
--- /dev/null
+++ b/meta-openstack/Documentation/README.OpenLDAP
@@ -0,0 +1,165 @@
1OpenLDAP support for keystone and pam.
2
3This feature enables openldap users to login to keystone and to
4a controller/aio system via pam. To enable this feature, add
5OpenLDAP into DISTRO_FEATURES
6
7e.g. in conf/local.conf
8
9DISTRO_FEATURES_append += " OpenLDAP"
10
11A number of variables can be specified during the build phase that configures
12OpenLDAP specific options:
13
14 LDAP_DN - default DN for ldap
15 default: "dc=my-domain,dc=com"
16 LDAP_DATADIR - default directory for ldap's data directory
17 default: "/etc/openldap-data/"
18
19The OpenLDAP database by default is initialized with the trees required
20(/etc/openldap/ops-base.ldif)
21
22 dn: dc=my-domain,dc=com
23 objectclass: dcObject
24 objectclass: top
25 objectclass: organization
26 o: my-domain Company
27 dc: my-domain
28
29 dn: cn=Manager,dc=my-domain,dc=com
30 objectclass: organizationalRole
31 cn: Manager
32 description: LDAP administratior
33 roleOccupant: dc=my-domain,dc=com
34
35 dn: ou=Roles,dc=my-domain,dc=com
36 objectclass:organizationalunit
37 ou: Roles
38 description: generic groups branch
39
40 dn: ou=Users,dc=my-domain,dc=com
41 objectclass:organizationalunit
42 ou: Users
43 description: generic groups branch
44
45 dn: ou=Groups,dc=my-domain,dc=com
46 objectclass:organizationalunit
47 ou: Groups
48 description: generic groups branch
49
50A hybrid backend is added to the system which enables keystone to
51lookup users in both the sql and the LDAP database. For authentication,
52LDAP lookup happens if the user cannot be found in SQL. For other operations,
53the SQL backend is used.
54
55To enable ldap support in keystone, /etc/keystone/keystone.conf
56has been modified with the following:
57
58keystone.conf
59[identity]
60driver = keystone.identity.backends.hybrid_identity.Identity
61[assignment]
62driver = keystone.assignment.backends.hybrid_assignment.Assignment
63
64
65Sample Usage:
66
671. create the following ldif files:
68
69dn: uid=johndoe,ou=Users,dc=my-domain,dc=com
70objectClass: top
71objectClass: person
72objectClass: organizationalPerson
73objectClass: inetOrgPerson
74objectClass: posixAccount
75objectClass: shadowAccount
76uid: johndoe
77cn: John Doe
78sn: Doe
79givenName: John
80title: Guinea Pig
81telephoneNumber: +0 000 000 0000
82mobile: +0 000 000 0000
83labeledURI: https://archlinux.org/
84loginShell: /bin/bash
85uidNumber: 9999
86gidNumber: 9999
87homeDirectory: /home/johndoe/
88description: This is an example user
89ou: Users
90
912. Add to the LDAP database:
92ldapadd -D "cn=Manager,dc=my-domain,dc=com" -w secret -f ./user.ldif
93
943. Assign a password to the new user:
95
96ldappasswd -D "cn=Manager,dc=my-domain,dc=com" -w secret -s password "uid=johndoe,ou=Users,dc=my-domain,dc=com"
97
98At this point, you can attempt to login to horizon with the newly created
99user: johndoe and password: password
100
101At this point, the userid/password will be accept but since no role/tenant
102has been assigned, the user will see:
103
104"You are not authorized for any projects"
105
106Also, you can su/login/ssh into the system as the new user:
107
108root@controller:~# su - johndoe
109Creating directory '/home/johndoe/'.
110
1114. Assign the newly created user a role and a tenant/project:
112
113root@controller:~# keystone role-list
114kWARNING: Bypassing authentication using a token & endpoint (authentication credentials are being ignored).
115e+----------------------------------+-----------------+
116| id | name |
117+----------------------------------+-----------------+
118| 614bf212ecb146e8ad5c65bd8152e72e | Member |
119| cdbe49c05ca0402d832c585758418716 | ResellerAdmin |
120| 9fe2ff9ee4384b1894a90878d3e92bab | _member_ |
121| 35403ad1589148b3a2f83f78dc10365b | admin |
122| 37999e5be236488c874cdcb536b2bda1 | heat_stack_user |
123+----------------------------------+-----------------+
124root@controller:~# keystone tenant-list
125WARNING: Bypassing authentication using a token & endpoint (authentication credentials are being ignored).
126+----------------------------------+----------+---------+
127| id | name | enabled |
128+----------------------------------+----------+---------+
129| 69130c58b26c40898b46e4426dc3e1ba | admin | True |
130| e83f8d16384449e197aa8777d0d310c3 | alt_demo | True |
131| bce83b3fd5a14dd6bbb88438e27077a8 | demo | True |
132| 579a04e72b274afd81b2becc94c4661c | service | True |
133+----------------------------------+----------+---------+
134
135We add the user johndoe to the role Member (614bf212ecb146e8ad5c65bd8152e72e) and
136tenant (bce83b3fd5a14dd6bbb88438e27077a8)
137
138keystone user-role-add \
139 --tenant-id bce83b3fd5a14dd6bbb88438e2 7077a8 \
140 --user-id johndoe \
141 --role-id 614bf212ecb146e8ad5c65bd8152e72e
142
143Now we can login to horizon as johndoe and we see that the user is in the project
144demo.
145
146
147Note:
148
1491. If the LDAP server isn't running, keystone operations will fail
150with the following:
151
152An unexpected error prevented the server from fulfilling your request.
153{'desc': "Can't contact LDAP server"} (HTTP 500)
154
1552. If a role was created for a user in the ldap server and we're using
156the sql backend:
157
158root@controller:~# keystone user-role-list --user-id johndoe \
159 --tenant-id bce83b3 fd5a14dd6bbb88438e27077a8
160
161WARNING: Bypassing authentication using a token & endpoint (authentication credentials
162are being ignored).
163No user with a name or ID of 'johndoe' exists.
164
165