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 in providers/gce.sh needs, 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 each just lab verb calls, for a hosted single lab (token mode, SIM_LAB_SERVICE_ACCOUNT=none, SIM_FIREWALL=verify) and the default mode.
  • gce/permissions.sh generates the per-verb, per-mode rollup from the two files, and just 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 up and down need with Cloud Resource Manager testIamPermissions (the existing token_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.sh and preflight-selftest.sh pass; the new gate and the preflight step are each red on a synthetic miss.
  • just word-budget is at its ceiling, 40489, unchanged. just vale-check passes.

Merge request reports

Loading
Loading