Loading
Publish the IAM permissions each engine verb needs
Closes #57 (closed)
What
A caller that hands the lab a scoped Google identity has to write a custom role for it, and today learns each permission from a 403. This publishes the permissions as data and checks them.
providers/gce-permissions.json: the IAM permissions each provider verb inproviders/gce.shneeds, from Google's documented permission per API method. A permission not yet proved live carries"verify": true.providers/gce-engine-verbs.json: which provider verbs eachjust labverb calls, for a hosted single lab (token mode,SIM_LAB_SERVICE_ACCOUNT=none,SIM_FIREWALL=verify) and the default mode.gce/permissions.shgenerates the per-verb, per-mode rollup from the two files, andjust lab permissions [--verb up] [--mode hosted]prints it.- Drift gate in
provider-selftest.sh: a provider function that calls gcloud or curl with no entry fails, and so does an entry that names no function or an engine-table row that names no entry. - Preflight in token mode tests the set
upanddownneed with Cloud Resource ManagertestIamPermissions(the existingtoken_iam_test) and names each missing permission. It enables and lists no service. - One paragraph in
operations.md, paid for with the same number of words elsewhere in that file.
Proof
See the comment on this MR for the live run against a real project through an impersonated token.
Checks
provider-selftest.shandpreflight-selftest.shpass; the new gate and the preflight step are each red on a synthetic miss.just word-budgetis at its ceiling, 40489, unchanged.just vale-checkpasses.