<div dir="ltr"><div>On Mon, Apr 27, 2015 at 6:05 AM, Jamie Lennox <span dir="ltr"><<a href="mailto:jamielennox@redhat.com" target="_blank">jamielennox@redhat.com</a>></span> wrote:<br></div>>Not to speak for Brant, but i think the confusion here is why you are doing this. >From my perspective you should never be in >a position where the admin has to enter a raw project id like that.<div><br></div><div>Sometimes you have to do just that. For e.g. adding a member to an image in glance. Glance does not verify whether the member being added is a valid project_id.<br><div class="gmail_extra"><br></div><div class="gmail_extra"><span style="font-size:12.8000001907349px">>I think the problem here is the assumption of an all powerful admin user, and i'd encourage you to change your policy files to >scrap that idea.</span></div><div class="gmail_extra"><span style="font-size:12.8000001907349px">If there is no powerful admin user then how do you deal with situations where a cloud user deletes a project and there are resources(vm, network, block, image) tied to this project across components.</span></div><div class="gmail_extra"><span style="font-size:12.8000001907349px"><br clear="all"></span><div><div class="gmail_signature"><div dir="ltr"><div>Cheers,<br></div>Ajaya<br></div></div></div>
<br><div class="gmail_quote"><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class=""><br>
<br>
----- Original Message -----<br>
> From: "German Eichberger" <<a href="mailto:german.eichberger@hp.com">german.eichberger@hp.com</a>><br>
> To: "OpenStack Development Mailing List (not for usage questions)" <<a href="mailto:openstack-dev@lists.openstack.org">openstack-dev@lists.openstack.org</a>><br>
> Sent: Saturday, 25 April, 2015 8:55:23 AM<br>
> Subject: Re: [openstack-dev] [Neutron][Keystone] [Nova] How to validate teanant-id for admin operation<br>
><br>
><br>
><br>
</span><span class="">> Hi Brant,<br>
><br>
><br>
><br>
> Sorry, for being confusing earlier. We have operations an<br>
> administrator/operator is performing on behalf of a user, e.g. “Create<br>
> Loadbalancer X for user tenant-id 123”. Now we are not checking the<br>
> tenant-id and are wondering how to make the operation more robust with<br>
> kesyone’s help.<br>
><br>
><br>
><br>
> Thanks,<br>
><br>
> German<br>
<br></span><br>
<br>
I think the problem here is the assumption of an all powerful admin user, and i'd encourage you to change your policy files to scrap that idea. A role is granted on a project and this project is mentioned in the token. If there is some role that is provided that lets you perform operations outside of the project id specified in that token please file a bug and i'd consider marking it a security issue.<br>
<br>
The X-Service-Token concept will allow for the combination of a user token and a service token to authenticate an action, so the user can ask for an action to be performed on it's behalf via a service - and in which case the user's project id is communicated via the token.<br>
<br>
In lieu of all this the quick answer is no. If you are taking a project id from the command line and you want to validate its existence then you have to ask keystone, but you should always be getting this information from a token.<br>
<span class=""><font color="#888888"><br>
Jamie<br>
</font></span><div class=""><div class="h5"><br>
><br>
> From: Brant Knudson [mailto:<a href="mailto:blk@acm.org">blk@acm.org</a>]<br>
> Sent: Friday, April 24, 2015 11:43 AM<br>
> To: OpenStack Development Mailing List (not for usage questions)<br>
> Subject: Re: [openstack-dev] [Neutron][Keystone] [Nova] How to validate<br>
> teanant-id for admin operation<br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
> On Fri, Apr 24, 2015 at 11:53 AM, Eichberger, German <<br>
> <a href="mailto:german.eichberger@hp.com">german.eichberger@hp.com</a> > wrote:<br>
><br>
> All,<br>
><br>
> Following up from the last Neutron meeting:<br>
><br>
> If Neutron is performing an operation as an admin on behalf of a user that<br>
> user's tenant-id (or project-id) isn't validated - in particular an admin<br>
> can mistype and create object on behalf of non existent users. I am<br>
> wondering how other projects (e.g. Nova) deal with that and if there is some<br>
> API support in keystone to save us a round trip (e.g. authenticate admin +<br>
> validate additional user-id).<br>
><br>
><br>
><br>
><br>
><br>
> Not to long ago we got support in the auth_token middleware for a "service"<br>
> token in addition to the user's token. The user token is sent in the<br>
> x-auth-token header and the service token is sent in the x-service-token,<br>
> and then fields from both tokens are available to the application (e.g., the<br>
> user project is in HTTP_X_PROJECT_ID and the service token roles are in<br>
> HTTP_X_SERVICE_ROLES). So you could potentially have a policy rule on the<br>
> server for the operation that required the service token to have the<br>
> 'service' role, and what neutron could do is send the original user token in<br>
> x-auth-token and send its own token as the service token. This seems to be<br>
> what you're asking for here.<br>
><br>
><br>
> - Brant<br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
> Thanks,<br>
> German<br>
><br>
> __________________________________________________________________________<br>
> OpenStack Development Mailing List (not for usage questions)<br>
> Unsubscribe: <a href="http://OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" target="_blank">OpenStack-dev-request@lists.openstack.org?subject:unsubscribe</a><br>
> <a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
><br>
><br>
><br>
><br>
> __________________________________________________________________________<br>
> OpenStack Development Mailing List (not for usage questions)<br>
> Unsubscribe: <a href="http://OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" target="_blank">OpenStack-dev-request@lists.openstack.org?subject:unsubscribe</a><br>
> <a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
><br>
<br>
__________________________________________________________________________<br>
OpenStack Development Mailing List (not for usage questions)<br>
Unsubscribe: <a href="http://OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" target="_blank">OpenStack-dev-request@lists.openstack.org?subject:unsubscribe</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
</div></div></blockquote></div><br></div></div></div>