<div dir="ltr"><div><div>Heiko --<br><br></div>Guang's response provides the hint that could get you where you want to go -- try using the V3 Identity API rather than the V2 admin API. The V2 admin API essentially ignores policy and only allows admin role. Here's docs on the V3 API: <a href="https://github.com/openstack/identity-api/blob/master/openstack-identity-api/src/markdown/identity-api-v3.md">https://github.com/openstack/identity-api/blob/master/openstack-identity-api/src/markdown/identity-api-v3.md</a> . The openstack client may provide a CLI for the commands you want to run.<br>
<br></div>-- Brant<br><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jun 7, 2013 at 3:07 AM, Heiko Krämer <span dir="ltr"><<a href="mailto:info@honeybutcher.de" target="_blank">info@honeybutcher.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
<div>Hi Guang, <br>
<br>
thx for your hint but that's not the reason because in your
example all users with the KeystoneAdmin role have the same rights
as the admin and thats useless.<br>
<br>
@Adam so i've no chance to get the policy management working ? I
can't say the KeystoneAdmin role is only allowed to create and
delete users and nothing more ?<br>
I saw instead of the file a mysql base policy management but thers
no cli commands available right ?<br>
<br>
<br>
Thx and Greetings<span class="HOEnZb"><font color="#888888"><br>
Heiko</font></span><div><div class="h5"><br>
<br>
On 07.06.2013 07:59, Yee, Guang wrote:<br>
</div></div></div><div><div class="h5">
<blockquote type="cite">
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">I
think keystone client is still V2 by default, which is
enforcing admin_required. <u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Try
this<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal">"admin_required": [["role:KeystoneAdmin"],
["role:admin"], ["is_admin:1"]],<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Guang<u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<div>
<div style="border:none;border-top:solid #b5c4df 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext">
Openstack
[<a href="mailto:openstack-bounces+guang.yee=hp.com@lists.launchpad.net" target="_blank">mailto:openstack-bounces+guang.yee=hp.com@lists.launchpad.net</a>]
<b>On Behalf Of </b>Adam Young<br>
<b>Sent:</b> Thursday, June 06, 2013 7:28 PM<br>
<b>To:</b> Heiko Krämer; openstack<br>
<b>Subject:</b> Re: [Openstack] [Keystone] Policy
settings not working correctly<u></u><u></u></span></p>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">What is the actualy question here? Is it
"why is this failing" or "why was it done that way?"<br>
<br>
<br>
On 06/04/2013 07:47 AM, Heiko Krämer wrote:<u></u><u></u></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal">Heyho guys :)<br>
<br>
I've a little problem with policy settings in keystone. I've
create a new rule in my policy-file and restarts keystone
but keystone i don't have privileges. <u></u><u></u></p>
</blockquote>
<p class="MsoNormal"><br>
What is the rule?<br>
<br>
<u></u><u></u></p>
<p class="MsoNormal"><br>
Example:<br>
<br>
<br>
keystone user-create --name kadmin --pw lala <br>
keystone user-role-add --<br>
<br>
keystone role-list --user kadmin --role KeystoneAdmin --tenant
admin<br>
<br>
+----------------------------------+----------------------+<br>
| id | name |<br>
+----------------------------------+----------------------+<br>
| 3f5c0af585db46aeaec49da28900de28 | KeystoneAdmin |<br>
| dccfed0bd790420bbf1982686cbf7e31 | KeystoneServiceAdmin |<br>
<br>
<br>
cat /etc/keystone/policy.json<br>
<br>
{<br>
"admin_required": [["role:admin"], ["is_admin:1"]],<br>
"owner" : [["user_id:%(user_id)s"]],<br>
"admin_or_owner": [["rule:admin_required"],
["rule:owner"]],<br>
"admin_or_kadmin": [["rule:admin_required"],
["role:KeystoneAdmin"]],<br>
<br>
"default": [["rule:admin_required"]],<br>
[.....]<br>
"identity:list_users": [["rule:admin_or_kadmin"]],<br>
[....]<br>
<br>
<loading kadmin creds><br>
<br>
keystone user-list<br>
Unable to communicate with identity service: {"error":
{"message": "You are not authorized to perform the requested
action: admin_required", "code": 403, "title": "Not
Authorized"}}. (HTTP 403)<br>
<br>
<br>
In log file i see:<br>
DEBUG [keystone.policy.backends.rules] enforce admin_required:
{'tenant_id': u'b33bf3927d4e449a98cec4a883148110', 'user_id':
u'46a6a9e429db483f8346f0259e99d6a5', u'roles':
[u'KeystoneAdmin']}<br>
<br>
<br>
<br>
<br>
Why does keystone enforce <i>admin_required</i> rule instead
of the defined rule (<i>admin_or_kadmin</i>).<u></u><u></u></p>
<p class="MsoNormal"><br>
Historical reasons. We are trying to clean this up. <br>
<br>
<br>
<u></u><u></u></p>
<p class="MsoNormal"><br>
<br>
<br>
Keystone conf:<br>
[...]<br>
<br>
# Path to your policy definition containing identity actions<br>
policy_file = policy.json<br>
[..]<br>
[policy]<br>
driver = keystone.policy.backends.rules.Policy<br>
<br>
<br>
<br>
<br>
Any have an idea ?<br>
<br>
Thx and greetings<br>
Heiko<br>
<br>
<br>
<br>
<br>
<u></u><u></u></p>
<pre>_______________________________________________<u></u><u></u></pre>
<pre>Mailing list: <a href="https://launchpad.net/%7Eopenstack" target="_blank">https://launchpad.net/~openstack</a><u></u><u></u></pre>
<pre>Post to : <a href="mailto:openstack@lists.launchpad.net" target="_blank">openstack@lists.launchpad.net</a><u></u><u></u></pre>
<pre>Unsubscribe : <a href="https://launchpad.net/%7Eopenstack" target="_blank">https://launchpad.net/~openstack</a><u></u><u></u></pre>
<pre>More help : <a href="https://help.launchpad.net/ListHelp" target="_blank">https://help.launchpad.net/ListHelp</a><u></u><u></u></pre>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</blockquote>
<br>
</div></div></div>
<br>_______________________________________________<br>
Mailing list: <a href="https://launchpad.net/~openstack" target="_blank">https://launchpad.net/~openstack</a><br>
Post to : <a href="mailto:openstack@lists.launchpad.net">openstack@lists.launchpad.net</a><br>
Unsubscribe : <a href="https://launchpad.net/~openstack" target="_blank">https://launchpad.net/~openstack</a><br>
More help : <a href="https://help.launchpad.net/ListHelp" target="_blank">https://help.launchpad.net/ListHelp</a><br>
<br></blockquote></div><br></div>