-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add workload identity federation docs #160
Conversation
1e155b8
to
b8d92fa
Compare
1. Access the `development` service account you previously set up | ||
1. Go to the keys tab, click on "Add key" > "Create new key" | ||
1. Create a JSON private key. This file will be downloaded to your local system. | ||
Set the following environment variables for your Rails app. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe .....Rails app:
### 3. BigQuery authentication method | ||
|
||
### 3.1 Workload Identity Federation | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe #### for 3.1
docs/google_cloud_bigquery_setup.md
Outdated
top right. | ||
2. Click "ADD PRINCIPAL". | ||
3. Paste in the email address of the service account you created into the "New | ||
principals" box. | ||
4. Select the "BigQuery Appender Custom" role you created previously. | ||
5. Click "SAVE" to finish. | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra line (unless this follows formatting pattern)
docs/google_cloud_bigquery_setup.md
Outdated
|
||
![[azure-gcp-wif.svg]] | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra line (unless this follows formatting pattern)
`AZURE_CLIENT_ID` | ||
`AZURE_FEDERATED_TOKEN_FILE` | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra line (unless this follows formatting pattern)
docs/google_cloud_bigquery_setup.md
Outdated
|
||
The service account defined in step 4 above should be granted access using service account impersonation. | ||
|
||
If this does not exist then access can be granted with either the [update wif service account permissions ](https://github.com/DFE-Digital/teacher-services-analytics-cloud/blob/main/scripts/gcloud/update-wif-service-account-permissions.sh) gcloud script or from the [IAM](https://console.cloud.google.com/iam-admin/workload-identity-pools/pool/azure-cip-identity-pool) gcloud console, by navigating to the "GRANT ACCESS" window. Use the attributes specified in the gcloud script. Note that the subject must be set to the Managed Identity Object ID from azure for each environment (see Step 1 above). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from 'Azure'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Looks good
README.md
Outdated
|
||
#### 3.1 Workload Identity Federation | ||
|
||
We recommend using Workload identity federation as your authentication method as detailed in the [Workload Identity Federation Setup](docs/google_cloud_bigquery_setup.md#workload-identity-federation-setup) guide. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@asatwal worth saying why briefly? e.g. 'to avoid security risks associated with use of long-lived JSON keys' or something?
docs/google_cloud_bigquery_setup.md
Outdated
|
||
With DfE::Analytics our strong preference is to use WIF where possible. Where WIF is not possible to use then OAuth should be considered. The use of service account API Keys is discouraged. | ||
|
||
The diagram below demonstrates our use of WIF within DfE Analytics connecting from an Azure client to BigQuery. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"with dfe-analytics" instead of "within DfE Analytics" to be precise?
docs/google_cloud_bigquery_setup.md
Outdated
`AZURE_CLIENT_ID` | ||
`AZURE_FEDERATED_TOKEN_FILE` | ||
|
||
Within Azure a managed identity will also exist for each namespace. The managed identity will have the text `gcp-wif` within it's name. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
its not it's
docs/google_cloud_bigquery_setup.md
Outdated
|
||
Within Azure a managed identity will also exist for each namespace. The managed identity will have the text `gcp-wif` within it's name. | ||
|
||
Please note the Managed Identity Object ID for each namespace (environment). This is a uuid that will be required in later steps below. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'take note of' rather than 'note'? 'note' to me implies something I need to read not an ID I need to copy
docs/google_cloud_bigquery_setup.md
Outdated
|
||
### 3. Workload identity pool provider | ||
|
||
For each project a workload identity pool with the name `azure-cip-oidc-provider` should exist. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
provider not pool?
docs/google_cloud_bigquery_setup.md
Outdated
|
||
`GOOGLE_CLOUD_CREDENTIALS` | ||
|
||
Download the JSON WIF Credentials file either the [create wif client credentials](https://github.com/DFE-Digital/teacher-services-analytics-cloud/blob/main/scripts/gcloud/create-wif-client-credentials.sh) gcloud script or from the [IAM](https://console.cloud.google.com/iam-admin/workload-identity-pools/pool/azure-cip-identity-pool) gcloud console, by navigating to the "CONNECTED SERVICE ACCOUNTS" tab. Use the the attributes specified in the gcloud script. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing a word or two in this sentence I think
Context
Add workload identity federation documentation to allow teams to setup on their own projects.
Trello tickets:
https://trello.com/c/F7WrGYYq
Changes proposed in this pull request
Documentation only with full WIF instructions.