16:00:09 #startmeeting policy 16:00:10 Meeting started Wed May 31 16:00:09 2017 UTC and is due to finish in 60 minutes. The chair is lbragstad. Information about MeetBot at http://wiki.debian.org/MeetBot. 16:00:11 Useful Commands: #action #agreed #help #info #idea #link #topic #startvote. 16:00:13 The meeting name has been set to 'policy' 16:00:13 ping lbragstad, raildo, ktychkova, rderose, htruta, hrybacki, atrmr, gagehugo, lamt, thinrichs, edmondsw, ruan, ayoung, morgan, raj_singh, johnthetubaguy, knikolla, nhelgeson 16:00:19 #link https://etherpad.openstack.org/p/keystone-policy-meeting 16:00:22 agenda ^ 16:00:23 o/ 16:00:27 o/ 16:00:48 o/ 16:00:48 o/ 16:00:53 o/ 16:01:17 looks like we have the same agenda that we did last week 16:01:22 o/ 16:01:42 #topic RBAC in middleware 16:01:44 * morgan lurks 16:01:59 I've been reviewing the original and reproposed spec for the last 24 hours 16:02:06 i'm still in the process of reviewing 16:02:49 I think one thing that is becoming apparent to me for that work is the isolation of the scope check from the RBAC check in each of the projects 16:03:11 the part that worries me is the release or two where we have both in place in the policy file and in keystone 16:03:35 while other projects work to remove the RBAC checks from policy and move scope checks completely into code 16:03:57 i'm not sure if anyone else shares that view point or has given that any thought and wants to air it out here 16:04:14 I'm not sure I completely followed 16:04:24 lbragstad: no matter how you look at it, there's bound to be a transition period 16:04:42 lbragstad what exactly concerned you about the transition period? 16:04:44 edmondsw: something clicked for me yesterday 16:04:51 :) 16:05:10 and i realized that there wouldn't be any sort of role check in the policy files *eventually* 16:05:19 yes 16:05:24 edmondsw: does that make sense 16:05:42 because the proposal says that needs to be pulled into keystone 16:05:48 lbragstad yes, that's the theory... unproven theory, but it's the theory 16:06:01 lbragstad: role check pulled into keystone. not scope check 16:06:13 knikolla: correct 16:06:25 both are currently done in the policy file 16:06:26 lbragstad: scope check moved into code, which is what is happening. 16:06:45 knikolla: but - that is something that is driven by the project 16:07:00 lbragstad I'm still not convinced we'll ever be able to get all role checks into the middleware... but we should be able to get at least most there 16:07:12 lbragstad: fully agreed. 16:07:30 lbragstad: but all can be disabled until the project buys in. 16:07:36 edmondsw: ok - so here is my concern (real quick) 16:07:50 lbragstad: with nothing to aim towards, it's a chicken and egg buy in problem. 16:08:17 knikolla: sure - but we need more buy in, which i'm getting to 16:08:24 if a service has a policy file 16:08:35 and their operation -> role mapping is stored in keystone 16:08:39 we have a duplicated thing 16:08:42 makes sense, 16:09:04 what do we do with duplicated things? we have a migration or transition period, right? 16:09:04 yes 16:09:21 middleware is checked first, and then if it passes the policy is checked 16:09:21 that migration or transition is dependent on some level of service work 16:09:58 ideally - we want the middleware to check the role and if that passes the project should check the scope 16:10:08 yes 16:10:11 (if there isn't an overridden policy on disk somewhere) 16:11:06 the thing that I thought was important was ensuring we have project buy in so that they prioritze the work to move the role checks out of policies 16:11:16 that way we don't have duplicate storage of the same information 16:11:23 +1 16:11:25 to me - that is only going to lead to inconsistent user experience 16:11:54 i don't think the approach is wrong 16:12:12 but i want to make sure we don't let user experience degrade because we failed to convince or get proper project buy in 16:12:45 edmondsw: does that make more sense? 16:13:02 lbragstad: we can work with the projects to have a policy.json file without role checks in case operators want to enable the role check in middleware during the transition period 16:13:05 lbragstad: do you see an specific projects that might need a little extra encouragement? What ux issues are you foreseeing? 16:13:46 lbragstad: also this is something entirely up to ops to enable or not, with a "caution: these projects haven't reworked their policy yet" 16:14:37 lbragstad yes, it's going to be inconsistent 16:14:45 hrybacki: for example - if a project doesn't discourage the use of roles in policy.json files, then it's possible for an operator to make changes and not update keystone (i.e. the keystone check passes or a user sees that they can do something through keystone, but can't through the service API) 16:15:14 thank you for the clarification, makes sense 16:15:18 lbragstad by default, operators won't have anything set in middleware, right? 16:15:36 edmondsw: i don't think so? 16:15:50 edmondsw: it's disabled by default. 16:16:08 so they would need to set something before any of this matters 16:16:20 if it is enabled - the operator has to persist the role and routes in keystone in order for it to be useful 16:16:35 edmondsw: what lbragstad said. 16:16:37 but that doesn't change the fact that it could be confusing that, when they set middleware, it works to varying degrees for different projects 16:16:41 because that's what keystonemiddleware has to query in order to make a decision 16:16:53 right 16:17:07 edmondsw: elaborate on varying degrees a bit? 16:18:23 lbragstad I was thinking about different projects being at various stages in the rework of their policy files 16:18:34 oh - sure 16:18:36 moving scope checks into code, etc. 16:18:56 ideally - with the rbac in middleware bits, scope should be moved into the project 16:18:58 edmondsw: which is why it's enablement is on a service per service basis 16:19:13 and role checks should be moved into keystone, according to the proposal 16:20:46 edmondsw: you made a comment earlier about not all roles being enforced in middleware, can you walk me through that so i understand it? 16:21:20 lbragstad role checks can't ever move from default policy into middleware, though, unless we then require middleware be setup 16:21:31 is that something we can eventually do at some point? 16:21:46 edmondsw: that's a good question - i would expect operators to answer that for us 16:21:54 after some reasonable time in the wild 16:21:58 and looking at adoption 16:22:03 * lbragstad shrug 16:22:50 another thing that i noticed in the spec is that the routes api would be open to all users 16:22:58 lbragstad my earlier comment about not necessarily being able to do all role checks in middleware has to do with special cases like the actions APIs, a bunch of neutron APIs, etc. 16:23:07 oh - sure 16:23:11 where the body of the request is important 16:23:20 edmondsw: there is a follow up spec on the body 16:23:32 edmondsw: we wouldn't have to worry about that if we queried of the operation/policy 16:23:33 knikolla yeah... but I don't buy that it will solve all cases 16:23:56 knikolla do you have a link, or is that not written yet? 16:24:16 there is a section in the reproposed spec on that work 16:24:19 edmondsw: gimme a sec for the link. 16:24:31 i'm not sure if there is another spec proposed detailing those steps 16:24:38 #link https://review.openstack.org/#/c/452198/8 16:24:42 #link https://review.openstack.org/#/c/456974/ 16:24:52 edmondsw: ^^ 16:25:02 oh - there is one 16:25:20 knikolla yeah, that doesn't work as written 16:25:23 way too simplistic 16:25:25 but - i don't think we'd need that follow on spec if we replaced the URL with the operation 16:25:31 edmondsw: please comment on your concerns 16:25:34 will do 16:25:47 i.e. compute:create_service instead of POST /v2/servers/ 16:25:56 lbragstad how would you replace the url with the operation, since the middleware doesn't know the operation? 16:26:04 edmondsw: exactly 16:26:08 edmondsw: that's the tough part 16:26:22 you might be able to do it in the service, or oslo.policy somewhere 16:26:45 but i think the operation would be a better fit, since multiple URLs can map to the same API 16:26:50 edmondsw: we can work with nova to expand their actions api into separate urls. with their microversion support it shouldn't be hard. 16:27:23 could we have middleware-enabled services and non-middleware enabled services, and make the middleware-enabled ones provide a yaml or something that maps from POST /v2/servers to compute:create_service 16:27:50 then have the middleware expose compute:create_service to users, since that's what they know about? 16:27:50 yeah - that's an option 16:27:56 edmondsw: yes. the check is enabled in the service.conf 16:28:14 edmondsw: it's actually on an endpoint basis 16:28:23 either way - we wouldn't have to store the url information in keystone for other service APIs 16:28:58 which goes back to usability (i.e. if an operator updates a role requirement for booting a server on one API but doesn't on another, now we have an inconsistency) 16:29:18 edmondsw: lbragstad: during the transition period, role check in middleware is disabled by default, nothing changes unless explicitly changed. once services rework policy, they can guide their users to enable role check in middleware. 16:29:43 knikolla yeah, we got that 16:29:52 knikolla: sure - that makes sense, but does it address the url concerns? 16:29:55 no 16:30:13 dstanek: had a pile of them and i've been working with him to understand those 16:30:28 edmondsw: it's up to the services. 16:30:35 lbragstad: * 16:30:43 knikolla what is? 16:30:45 knikolla: what's up to the service? 16:31:42 in the future to have real REST-like apis instead of the actions api. 16:31:58 the only solution without their work is check in the json body. 16:32:16 knikolla: why couldn't we check the operation key? 16:32:35 lbragstad: that's the proposal, to check the operation key in the json. 16:32:42 knikolla: no 16:32:49 knikolla: the policy key, sorry 16:33:05 compute:create_server, compute:reboot_server, etc... 16:33:12 knikolla we're not suggesting they transition to "real REST-like apis"... not going to happen 16:33:22 lbragstad: middleware has no knowledge of the mapping 16:33:48 knikolla: what would it take to get your proposal to adhere to that requirement then? 16:34:49 because if we could come up with a way to do what you want and solve that requirement, then i think you'll get buy in from several of the people who had concerns 16:34:58 lbragstad: a mapping from urls into policy keys. which is still the issue in middleware because there are similar urls. 16:35:51 lbragstad: a mapping (url, json key in the body) might solve that. 16:35:52 knikolla: yes - that's the problem 16:36:15 which brings me back to the role check on body key proposal. please comment on that about your concerns. 16:36:16 that still requires keystone to store the URL 16:36:24 lbragstad: not necessarily. 16:36:46 lbragstad: it can be read from a conf file. but i think that is suboptimal. 16:37:00 since middleware is deployed with the service 16:37:26 why can't we wait to query keystone for the required role until later in the request? 16:37:27 it has access to the service configuration, including policy.json 16:37:44 like - why can't the service call out to keystone for that information once it knows exactly which operation it's doing 16:38:35 lbragstad: what would it benefit from for doing it that late? 16:38:58 because then the service knows the policy key it needs since it's processing the request (URL, body, method, etc..) 16:39:21 lbragstad: then the only thing that changes is that policy.json is stored as it is in keystone 16:39:35 lbragstad: however it has roles instead of overcomplicated rules 16:39:37 so instead of storing a bunch of URL for other services in keystone (which can be fragile) keystone only has to say "compute:create_server requires the member" role 16:40:07 then we don't need a follow on spec for supporting json body parsing for complex (non-restful) APIs 16:40:35 lbragstad: i don't have an argument against or pro, i defer to ayoung to answer that. 16:41:15 fair enough - it was just something that came up as i was reviewing it and reflecting on feedback about the storage or URLs :) 16:41:51 lbragstad: i thought about that too. i know that at some point there was a centralized/dynamic policy approach which was shut down. but that predates my keystone involvement. 16:42:31 the difference between that approach and this one is that the dynamic policy stuff was a push of all existing policy files into keystone 16:42:43 so when a service needed a policy, it fetched it from keystone 16:42:46 while this is role check, gotcha. 16:43:12 as i said. i don't have a strong argument against doing routes with policy keys instead of urls. 16:43:15 the only thing is that 16:43:21 now it needs to be in the service code 16:43:25 right 16:43:26 rather than keystonemiddleware code 16:43:29 so we don't own that 16:43:30 yep 16:43:42 which is going to require cross-project communication in order to work 16:43:44 which isn't a bad thing 16:44:02 and that's something we can use project tags and community goals to get traction on if the TC thinks it's worth while 16:44:04 lbragstad: the actionable plan to split role check from scope check is still there 16:44:30 task* 16:44:37 no matter how you look at it, that has to be done 16:44:46 agree - that makes sense 16:44:52 and some projects have already started working on that 16:45:01 (maybe just nova, but it's a start) 16:45:05 and no matter how you look at it, that might break backwards compat with policy.sjon 16:45:19 knikolla why do you say that? 16:45:54 edmondsw: emphasis on might. 16:45:57 moving scope checks into code doesn't break backward compate 16:46:23 edmondsw: it depends 16:46:30 not really 16:46:39 there might be complex rules that mix roles and scopes 16:46:46 yes... 16:46:48 edmondsw: depends on if you allow them to be ovewritten. if you don't, and someone used that, it will. 16:46:59 splitting them might end up losing the power of defining those complex rules 16:46:59 what is "them" in that sentence? 16:47:20 edmondsw: policy rules with mixed scope and role. 16:47:21 in my sentence it's role+scope 16:47:54 I haven't heard anyone propose that policy.json goes away, or that you can no longer do scope checks there 16:48:21 it would be possible for it to go away - but i'm not sure we could ever remove it 16:48:29 yes I believe by default it will be better, even if we change what we have to allow splitting role from scope 16:48:49 however people could still continue doing complex/complicated in their overrides in their policy.json, correct/ 16:48:54 edmondsw: then it's removing role checks from there. either way, something will change. 16:49:19 but - that's something that needs to be done on a per service basis 16:49:20 knikolla I'm not following 16:49:24 knikolla: from the default, I expect it to continue allowing it 16:49:58 edmondsw: i'm moving too far head after the transition period. 16:50:19 that's fine... I'm thinking way ahead to.. but I'm not following your line of reasoning 16:51:20 edmondsw: do we agree that policy.json needs to evolve eventually if we split role check? 16:51:31 edmondsw: if we store it in keystone it will be there 16:52:01 knikolla what is "there"? 16:52:39 edmondsw: role check in keystone. either as a mapping with policy key -> role. or url -> verb -> etc -> role. 16:52:53 knikolla default policy.json is going away, as we move policy defaults into code 16:53:13 using policy.json to override things, whether that is scope checks in code or role checks in middleware, is not going away 16:54:03 edmondsw: including long after the transition period? 16:54:12 knikolla yes 16:54:19 ever 16:54:25 moving into code means moving into projects code 16:54:30 yes 16:54:32 not moving them all into keystone code 16:54:40 right 16:54:48 correct - keystone should never have to deal with scope checks 16:54:51 IMO 16:55:04 lbragstad: i never mentioned scope checks into keystone 16:55:11 knikolla: just clarifying 16:55:50 lbragstad: except for its own scope checks that goes into its code :-) 16:55:59 edmondsw: what i'm pointing to is: right now policy.json can override both role and scope. in response to lbragstad's concern about having two sources of truth for role checks, would we deprecate the possibility of having role checks in policy.json 16:56:24 emphasis on eventually (which i forgot to write) 16:56:55 knikolla I don't think so 16:57:07 4 minutes remaining 16:57:11 I think we still allow scope+roles checks in the policy.json files, for the sack of backward compatibility, even if we do not do it upstream (or do not advise it) 16:57:21 edmondsw: lbragstad is that correct? 16:57:40 knikolla maybe if we really solve things in middleware... but again, I don't think bodykeys necessarily do that 16:57:43 probably? but i'll defer to edmondsw 16:58:11 edmondsw: that is fine. 16:58:17 edmondsw: more ops choice :) 16:58:22 ok - real quick 16:58:29 edmondsw: as long as they don't mix them… 16:58:51 there are a couple general documents i've proposed to specs that i'd like get reviews on (and i need to address samueldmq's comments) 16:58:54 #link https://review.openstack.org/#/q/status:open+project:openstack/keystone-specs+branch:master+topic:460344 16:59:12 lbragstad: ++ I will review the others too 16:59:27 and we're out of time, thanks lbragstad knikolla edmondsw o/ 16:59:35 they are in a linear series and i attempted to make it clear that they build on each other 16:59:43 thanks for coming - today was good 16:59:44 please reach out to me in -keystone for more rbac middleware concerns 16:59:49 i really want this merged :) 16:59:50 thanks all o/ 16:59:50 knikolla: will do 16:59:57 #endmeeting