Open
Description
[REQUIRED] Environment info
firebase-tools: 10.6.0
Platform: macOS
[REQUIRED] Steps to reproduce
- Create a new Google Cloud project / organization
- Enforce the organizational policy
constraints/iam.disableServiceAccountKeyCreation
. - Run
firebase init hosting
- Try to set up GitHub Actions deployments.
[REQUIRED] Expected behavior
There are several levels of support that I could be implemented:
- Soft-fail: Do not block the whole init just because this org-policy is enabled (this is the minimum that should be done)
- Skip adding the secret: Do not add the secret to Github, but add all other files for Github Actions (put a warning).
- Adjust template for Identity Federation: Detect that Workload Identity Federation is required here, so adjust the template for this, so that it's super easy to set up the rest for authentication (but do not yet set up Workflow Identity pools, etc. would be up for the user)
- Set up Workload Identity Federation: Set up everything for workload identity federation when key creation is not possible!
- Always use Workload Identity Federation: Never try to use a service account key, but always use Workload Identity Federation (as it's discouraged to use Service Account keys)
At least have 3. would be nice and should be fairly easy to build!
Background reading on Github Actions and Workload Identity federation:
https://cloud.google.com/blog/products/identity-security/enabling-keyless-authentication-from-github-actions
[REQUIRED] Actual behavior
The firebase init
command fails with the following error message as it's not possible to create a Service Account key:
...
? For which GitHub repository would you like to set up a GitHub workflow? (format: user/repository) octocat/repo
Error: HTTP Error: 400, Key creation is not allowed on this service account.