Add guide for using workload identity federation#349
Open
IchordeDionysos wants to merge 1 commit intoFirebaseExtended:mainfrom
Open
Add guide for using workload identity federation#349IchordeDionysos wants to merge 1 commit intoFirebaseExtended:mainfrom
IchordeDionysos wants to merge 1 commit intoFirebaseExtended:mainfrom
Conversation
joehan
approved these changes
Aug 6, 2024
salomvary
reviewed
Aug 19, 2024
| - uses: actions/checkout@v2 | ||
|
|
||
| # Add these two steps to generate the credential to use with the `action-hosting-deploy` action. | ||
| - name: Prepare Google Cloud authentication |
There was a problem hiding this comment.
This step seems to be missing id: auth otherwise I think ${{ steps.auth.outputs.credentials_file_path }} won't work below.
Author
There was a problem hiding this comment.
Suggested change
| - name: Prepare Google Cloud authentication | |
| - name: Prepare Google Cloud authentication | |
| id: auth |
salomvary
reviewed
Aug 19, 2024
| create_credentials_file: true | ||
| - name: Get federated identity credentials file | ||
| run: | | ||
| echo "SERVICE_ACCOUNT_KEY=$(cat "${{ steps.auth.outputs.credentials_file_path }}" | tr -d '\n')" >> $GITHUB_ENV |
There was a problem hiding this comment.
FYI this will silently fail if ${{ steps.auth.outputs.credentials_file_path }} resolves to something invalid oder to ''.
IchordeDionysos
commented
Aug 20, 2024
| uses: 'google-github-actions/auth@v2' | ||
| with: | ||
| service_account: 'service-account@your-project.iam.gserviceaccount.com' | ||
| workload_identity_provider: 'projects/PROJECT_NUMBER/locations/global/workloadIdentityPools/github/providers/github-your-org' |
Author
There was a problem hiding this comment.
Suggested change
| workload_identity_provider: 'projects/PROJECT_NUMBER/locations/global/workloadIdentityPools/github/providers/github-your-org' | |
| workload_identity_provider: 'projects/PROJECT_NUMBER/locations/global/workloadIdentityPools/github/providers/github-your-org' | |
| token_format: 'access_token' | |
| access_token_scopes: 'email,openid,https://www.googleapis.com/auth/cloudplatformprojects.readonly,https://www.googleapis.com/auth/firebase,https://www.googleapis.com/auth/cloud-platform' |
This is what we are using 🤔
Author
There was a problem hiding this comment.
Not sure if all of the scopes are strictly necessary
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the current workaround for using workload identity federation so people more easily are able to find it and use security best practices.
Partially addresses #174