Milo cannot use service accounts |
|||||
Issue descriptionWhat steps will reproduce the problem? Posting to luci-milo.appspot.com/prpc/milo.BuildInfo/Get with a Bearer token from a user. This works. Posting to luci-milo.appspot.com/prpc/milo.BuildInfo/Get with a Bearer token from a service account (where the email is also added to milo-buildbot-internal, chrome-swarming-users and luci-logdog-chrome-readers (what trying all of them!) This failed with a 404 error. Sample 404 log: https://pantheon.corp.google.com/logs/viewer?project=luci-milo&minLogLevel=0&expandAll=false×tamp=2018-08-13T17:01:32.118000000Z&customFacets=&limitCustomFacetWidth=true&interval=PT1H&resource=gae_app%2Fmodule_id%2Fdefault&scrollTimestamp=2018-08-13T16:55:50.869991000Z&filters=path:prpc&filters=text:5b71b81600ff0d4667852dd56f0001737e6c7563692d6d696c6f0001333338332d32373962333030000100&logName=projects%2Fluci-milo%2Flogs%2Fappengine.googleapis.com%252Frequest_log&dateRangeStart=2018-08-13T16:29:53.537Z&dateRangeEnd=2018-08-13T17:29:53.537Z It looks like Milo uses https://chrome-internal.googlesource.com/chromeos/manifest-internal/+/0e5d594f284d332bcb2d36080981ae4e690d613e/project.cfg# for config, which limits ACLs to googlers, excluding the possibility of service account access.
,
Aug 13
Don, it looks like you're in the OWNERS file.
,
Aug 13
Note that Milo's auth is only set up to authorize at the project level: https://github.com/luci/luci-go/blob/master/milo/common/acl.go#L49 So, while adding this service account to the top-level project access list would presumably work, it isn't ideal from an access control perspective since it would give the service account broad rights.
,
Aug 13
> #3 correct. Using buildbucket v2 will resolve the problem. It checks only ACLs specified in cr-buildbucket.cfg -- Don, consider adding access: "the-em-drive@appspot.gserviceaccount.com" to https://chrome-internal.googlesource.com/chromeos/manifest-internal/+/0e5d594f284d332bcb2d36080981ae4e690d613e/project.cfg#
,
Aug 13
That's a ChromeOS repository, so the OWNERs file is not enforced in any way.
,
Aug 13
I can add it to the top level project, but is that an acceptable solution? Or are we agreeing that 'it will do for now' until we are 100% on Swarming and the CI API can take over? Buildbucket V2 does not support Steps for Buildbot, so cannot be used as of today for things like CQ. Hence why I need to get Milo data :)
,
Aug 13
project access is used in two places: 1) luci-config uses it to decide whether a requester is allowed to read configs of a particular project, or see the project existance 2) milo checks project access as the first step in all requests where project is available (/p/* URLs), and then it checks more fine-grained ACLs (buildbucket) i think adding the service account to project ACLs is acceptable. Buildbucket ACLs are more sensitive than the project ACL
,
Aug 13
OK I'll do this.
,
Aug 14
This worked, took a long time to propagate though. Thank you! |
|||||
►
Sign in to add a comment |
|||||
Comment 1 by tandrii@chromium.org
, Aug 13Owner: akes...@chromium.org
Status: Assigned (was: Untriaged)