Tuesday, 2021-08-03

opendevreviewPranali Deore proposed openstack/glance master: Implement project personas for metadef objects  https://review.opendev.org/c/openstack/glance/+/80205405:31
opendevreviewPranali Deore proposed openstack/glance master: Implement project personas for metadef properties  https://review.opendev.org/c/openstack/glance/+/80205505:31
opendevreviewPranali Deore proposed openstack/glance master: Implement project personas for metadef tags  https://review.opendev.org/c/openstack/glance/+/80205606:14
*** mabrams is now known as mabrams|afk07:03
*** mabrams|afk is now known as mabrams07:04
opendevreviewPranali Deore proposed openstack/glance master: Implement project personas for metadef objects  https://review.opendev.org/c/openstack/glance/+/80205409:00
opendevreviewPranali Deore proposed openstack/glance master: Implement project personas for metadef properties  https://review.opendev.org/c/openstack/glance/+/80205509:00
opendevreviewPranali Deore proposed openstack/glance master: Implement project personas for metadef tags  https://review.opendev.org/c/openstack/glance/+/80205609:05
opendevreviewRajat Dhasmana proposed openstack/glance master: DNM: check grenade gate fix  https://review.opendev.org/c/openstack/glance/+/80332510:28
opendevreviewRajat Dhasmana proposed openstack/glance master: DNM: check grenade gate fix  https://review.opendev.org/c/openstack/glance/+/80332510:30
opendevreviewRajat Dhasmana proposed openstack/glance master: DNM: check grenade gate fix  https://review.opendev.org/c/openstack/glance/+/80332510:38
opendevreviewRajat Dhasmana proposed openstack/glance master: DNM: check grenade gate fix  https://review.opendev.org/c/openstack/glance/+/80332510:43
opendevreviewMridula Joshi proposed openstack/python-glanceclient master: Fix undesirable raw Python error  https://review.opendev.org/c/openstack/python-glanceclient/+/80332610:46
opendevreviewPranali Deore proposed openstack/glance master: Implement project personas for metadef objects  https://review.opendev.org/c/openstack/glance/+/80205411:22
opendevreviewPranali Deore proposed openstack/glance master: Implement project personas for metadef properties  https://review.opendev.org/c/openstack/glance/+/80205511:22
opendevreviewPranali Deore proposed openstack/glance master: Implement project personas for metadef tags  https://review.opendev.org/c/openstack/glance/+/80205611:22
abhishekk@all, glance gate is blocked due to grenade failure, kindly avoid rechecking until the fix https://review.opendev.org/c/openstack/grenade/+/803317 gets merged 13:43
dansmithabhishekk: sorry I had half-reviewed the objects one yesterday and god distracted.. just finished13:51
abhishekkdansmith, no problem13:52
abhishekkhmm, I will use comprehension, just avoided as it was going out of pep8 standard (line length)13:53
dansmithabhishekk: I'm not saying you definitely should,13:53
dansmithI'm just saying it because it would be better13:53
dansmithhow many metadef objects are people likely to have?13:53
abhishekkyes go it13:54
abhishekkI am not sure as there is no limit13:54
abhishekkper namespace I guess it will be less than 10 though13:54
dansmithokay, well, no need to change it, it's just that api stuff where "in testing I have two objects" can start to suck for real workloads when you have 2 million :)13:55
abhishekkhmm, right13:55
abhishekkI have fixed the spell mistake though (before your comment) :D13:56
dansmithheh13:56
abhishekkjust didn't pushed as gate is broken13:56
dansmithack13:56
abhishekktoday I will not be much around but will be keeping eye on mails and gate situation13:58
dansmithokay13:58
abhishekkdansmith, if you still around I want to highlight one issue14:15
dansmithsure14:16
abhishekknah, its not a issue, sorry 14:17
* abhishekk to much over thinking at the moment14:18
dansmithhah14:18
abhishekkupdate, the grenade fix is approved so we can recheck in short period of time14:20
croelandtAnything urgent to review once the CI works again?14:30
dansmithonce abhishekk pushes his metadef set, that would be next I think14:31
dansmithwaiting to push revs until the gate is fixed to avoid a bunch of useless checks14:31
abhishekkYeah14:31
croelandtthe grenade patch has just been approved14:32
croelandtabhishekk: can you check Rajat's email btw?14:32
abhishekkcroelandt, ack14:32
dansmithabhishekk: I think you could depends-on the grenade fix on your bottom patch and get a run with the new bits14:32
croelandtI can do the backports both upstream and downstream, but we just need to agree with Cinder on how to do it :)14:33
abhishekkdansmith, ack, then I will fix the comprehension and test change as next revision14:33
abhishekkcroelandt, right14:33
abhishekkcroelandt, I will push two patches in 15-20 minutes14:39
croelandtabhishekk: on which topic?14:40
abhishekkpolicy refactor + metadef14:40
croelandtok14:40
abhishekkwill ping you once done14:40
abhishekkI think grenade patch will take 4-5 hours to merge14:49
croelandterf :/14:51
croelandtShould I do night-time reviews? :)14:51
abhishekk:D14:52
opendevreviewAbhishek Kekane proposed openstack/glance master: Move metadef namespace policy checks in the API  https://review.opendev.org/c/openstack/glance/+/79963314:54
opendevreviewAbhishek Kekane proposed openstack/glance master: Move metadef object policy checks in the API  https://review.opendev.org/c/openstack/glance/+/79963414:54
abhishekkcroelandt, dansmith ^^14:55
abhishekkNow I need to replicate these comments in other three patches that will take another hour14:55
croelandtwhich comments?14:57
abhishekkon above two patches dansmith has given some comments which I have fixed and proposed new PS14:58
abhishekkthose comments I need to fix in my other patches as well as most of the code is common14:59
croelandtok ok15:00
* abhishekk going for dinner break16:02
abhishekkupdate, grenade patch is still in the gate and will take approx 4-5 hours more to merge16:46
dansmithyeah, I'm sure :/16:47
dansmithgmann: lbragstad: I have a API/policy question16:47
lbragstado/ 16:48
dansmithwe have several places where we currently raise 403 for an operation which might be forbidden by policy16:48
dansmithI think we have the proper behavior today, but only because it's all hard-coded in the DB, where we'd return 404 if you're not able to see the image,16:49
dansmithbut 403 if you can see it, but aren't allowed to delete it or something like that16:49
dansmithI'm realizing that converting all that to policy we might be doing the wrong thing in places,16:49
dansmithwhere we might convert the 403 to 404 to avoid exposing the image's existence to people that can't see it,16:50
dansmithbut a consequence is that we might show someone an image, but then return 404 when they try to delete it, if not allowed16:50
dansmithwhich surely isn't right16:50
dansmithso I'm thinking we probably need to, in all of our Forbidden handlers have some sort of "if can_get_image: return 403 else return 404"16:51
dansmithright?16:51
lbragstadi think that makes sense16:52
lbragstadi think we had a very similar discussion to this a while back that focused on the inverse, which is what we did in keystone 16:53
lbragstad(we return 403 instead of 404)16:53
dansmithyeah, well, if you read the glance code it looks like we return 403 in a lot of places that we don't, because it's hard-codes in the depths to do something different16:54
lbragstadi thought there was a utility method somewhere in the database layer that determines if a thing (like an image) is visible and then throws the right exception (404 or 403) based on that16:56
lbragstadis that what you mean by depths?16:56
dansmithI don't think there's a utility method for that, but that logic is spread all over the db yeah16:56
lbragstadi think i'm thinking of this - https://github.com/openstack/glance/blob/master/glance/db/sqlalchemy/api.py#L286-L29016:59
dansmithyeah, that's not really the same I don't think, because that's just the image fetch path17:00
opendevreviewAbhishek Kekane proposed openstack/glance master: Move metadef resource type association policy checks in the API  https://review.opendev.org/c/openstack/glance/+/79963717:16
opendevreviewAbhishek Kekane proposed openstack/glance master: Move metadef property policy checks in the API  https://review.opendev.org/c/openstack/glance/+/79963517:16
opendevreviewAbhishek Kekane proposed openstack/glance master: Move metadef tag policy checks in the API  https://review.opendev.org/c/openstack/glance/+/79963617:16
gmanndansmith: lbragstad +1 on checking image GET permission for other not allowed operation too.  17:25
dansmithack, I have a good solution that fits nicely into our new v2 layer I think17:26
dansmithwill push that up in a sec17:26
gmannand this issue is for other project also not only glance. like in nova we return 404 if server does not exist  to user who does not have permission for GET /servers17:26
dansmithright17:27
gmannbut is there case anyone want to restrict GET but not Delete ?17:28
gmannin that case, checking GET permission in Delete can break them17:28
gmanndansmith: lbragstad on rethinking, I am not 100% sure about checking GET permission in Delete or other operation. actually if we see getting 404 does not tell 100% that image does not exist. 404 can be from url not present or so. 17:33
gmannI think what we can do is not show the 'image not found' error message in such case17:34
gmannjust log17:34
dansmithgmann: there are cases where you want to restrict GET but allow DELETE, like project cleanup scripts that should not see image metadata with license keys17:34
dansmithand this doesn't change delete, it just changes the return code you get if you're not allowed to delete17:34
dansmithif you can delete, we never check get17:34
gmannyeah. and as we have granular policy so we can say yes there are use case17:34
dansmithwe only check it to determine 403/404 on fail17:35
gmanndansmith: ohk. still it has both point, 1. returning 403 can confuse API user and they ask for permission where actually they are requesting non-existing image 2. returning 404 can leak image non-exit info to user not having permission to GET or Delete.17:38
gmannsome tradeoff we have to do in any ways17:39
gmannbecause we cannot check delete permission without image_id right? so in case of 'image not exist' we actually do not know if delete is allowed or not17:41
dansmithgmann: no, we'll still return 404 for an image that doesn't exist17:41
gmannso which case you will convert it to 40317:42
dansmithimage exists, you're allowed to see image, you are not allowed to delete17:42
dansmithif not exists, 404, if exists but you cannot see it, 404, if it exists, you can see it, can delete it, 20017:43
gmannsorry I am confused. so in delete case what change you are proposing ?17:45
dansmithokay, right now what we have proposed will result in a user being able to GET an image, but if they are not allowed to DELETE, they would get 404, but then they could GET the image right after and see it still exists and be confused17:46
dansmithwhat I want is to make sure that if a user can GET an image, but not DELETE it, that they receive a 403 instead of a 404.17:47
dansmithif they cannot GET an image, then a DELETE on that image should still be a 40417:47
gmannohk, i thought 'able to GET an image, but if they are not allowed to DELETE, they would get 404' return 403 currently. +1. so the way how nova return. 17:48
gmannso no GET permission check in Delete basically and keep returning 404 if resource does not exist and we cannot check delete permission too17:49
dansmithgmann: currently that's true in glance too I think, but only because there is hard-coded python below the policy layer that subverts the actual policy behavior in the api17:49
dansmithgmann: right17:49
gmanni see. thanks17:49
gmannyeah moving them to API layer is nice. 17:50
opendevreviewDan Smith proposed openstack/glance master: Make image update check policy at API layer  https://review.opendev.org/c/openstack/glance/+/78991518:36
opendevreviewDan Smith proposed openstack/glance master: Check get_image(s) in the API  https://review.opendev.org/c/openstack/glance/+/79606718:36
opendevreviewDan Smith proposed openstack/glance master: Add a member field to Image when appropriate  https://review.opendev.org/c/openstack/glance/+/79606618:36
opendevreviewDan Smith proposed openstack/glance master: Check delete_image policy in the API  https://review.opendev.org/c/openstack/glance/+/79807318:36
opendevreviewDan Smith proposed openstack/glance master: POC: Check deactivate, reactivate policy in the API  https://review.opendev.org/c/openstack/glance/+/79826618:36
dansmithgmann: this summarizes the behavior: https://review.opendev.org/c/openstack/glance/+/798073/19/glance/tests/functional/v2/test_images_api_policy.py18:36
dansmithactually, let me add the not-exist case in there just to be sure18:37
opendevreviewDan Smith proposed openstack/glance master: Check delete_image policy in the API  https://review.opendev.org/c/openstack/glance/+/79807318:38
opendevreviewDan Smith proposed openstack/glance master: POC: Check deactivate, reactivate policy in the API  https://review.opendev.org/c/openstack/glance/+/79826618:38
dansmithgmann: https://review.opendev.org/c/openstack/glance/+/798073/20/glance/tests/functional/v2/test_images_api_policy.py18:38
abhishekkupdate, grenade fix is merged 18:39
dansmithabhishekk: sweet.. note slight change to image behavior starting in the image update patch18:39
dansmithper discussion above18:39
dansmithdidn't really think about it until I was writing a test for delete18:40
abhishekkyes, going through now18:40
dansmithabhishekk: fine to look tomorrow, I'm sure it's late18:40
gmanndansmith: L244, should not it be 403 ?18:40
dansmithgmann: no, because we can't see the image, so we should not be able to see that it's there by trying to delete18:41
gmanndansmith: but we should not check GET permission in Delete right18:41
abhishekkyeah18:41
dansmithwe should, but only to determine 403/40418:41
abhishekkdansmith, There are still some things that have to be resolved, like the image18:42
dansmithnot to determine if you can delete or not,18:42
abhishekkrepo will still check get_image even though we don't want it to.18:42
dansmithONLY for the return code18:42
abhishekkis this still the case or it is there and need to remove from commit message ?18:42
dansmithabhishekk: commit msg on which patch?18:43
gmanndansmith: but where you are checking that https://review.opendev.org/c/openstack/glance/+/798073/20/glance/api/v2/images.py18:43
abhishekkhttps://review.opendev.org/c/openstack/glance/+/78991518:43
dansmithgmann: https://review.opendev.org/c/openstack/glance/+/798073/20/glance/api/v2/policy.py line 7218:44
dansmithabhishekk: yeah, image repo still does that checking very low down, so that statement is still valid right?18:44
dansmithabhishekk: no change from last rev that was approved, in that regard18:45
abhishekkack18:45
gmanndansmith: I see. this looks good to me. 18:49
opendevreviewDan Smith proposed openstack/glance master: Check delete_image policy in the API  https://review.opendev.org/c/openstack/glance/+/79807318:49
opendevreviewDan Smith proposed openstack/glance master: POC: Check deactivate, reactivate policy in the API  https://review.opendev.org/c/openstack/glance/+/79826618:49
dansmithpep8 sorry ^18:49
abhishekknicely handled 18:50
abhishekkwill go through in detail tomorrow morning18:50
dansmithfor that delete test, I could also add a case where get_image is denied, but delete is allowed, to prove we don't check get_image unless we need to return an error18:50
dansmithabhishekk: ack thanks, have a good night18:50
abhishekkthanks, good day o/~18:51
abhishekkjust FYI I attended RBAC open hour but agenda was full so not able to discuss anything with lbragstad (may be next week)18:52
opendevreviewDan Smith proposed openstack/glance master: Check delete_image policy in the API  https://review.opendev.org/c/openstack/glance/+/79807318:52
opendevreviewDan Smith proposed openstack/glance master: POC: Check deactivate, reactivate policy in the API  https://review.opendev.org/c/openstack/glance/+/79826618:52
dansmithgmann: added that case ^18:52
dansmithabhishekk: ah cool, I know the special currency needed to bribe lbragstad to answer our questions first anyway, if need be :)18:53
abhishekk:D18:53
dansmithcrap, another typo18:54
* dansmith is in the patch revision olympics18:54
abhishekkI will get gold there :P18:55
dansmithhah18:55
opendevreviewDan Smith proposed openstack/glance master: Check delete_image policy in the API  https://review.opendev.org/c/openstack/glance/+/79807318:55
* abhishekk finally shutting down18:55
dansmitho/18:55
abhishekko/18:55
gmannperfect. 18:58
prometheanfirehttps://review.opendev.org/803113 shows that glance has some issues with the newer networkx release20:04

Generated by irclog2html.py 2.17.2 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!