-
Notifications
You must be signed in to change notification settings - Fork 12
Alternative 3 for using WIF to access customer resources for MVP #75
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -171,6 +171,30 @@ This solution requires a method to run tasks in the Management Clusters, e.g. us | |||||||||||||
|
|
||||||||||||||
| This removes the need to deal with customer resources access from CLM components. | ||||||||||||||
|
|
||||||||||||||
| ## Alternative 3: Simplest WIF solution for MVP, customer allows all workloads on Hyperfleet GCP project | ||||||||||||||
|
|
||||||||||||||
| For our MVP phase, the simplest solution that works is for the customer to allow "All identities in a workload identity pool" ([google docs](https://docs.cloud.google.com/iam/docs/principal-identifiers#allow)). This means, all the adapter tasks that run in any cluster in the `hcm-hyperfleet` GCP project will be authorized. | ||||||||||||||
|
|
||||||||||||||
| In order to do this, customer project must allow permissions to: | ||||||||||||||
| ``` | ||||||||||||||
| principalSet://iam.googleapis.com/projects/PROJECT_NUMBER/locations/global/workloadIdentityPools/POOL_ID/* | ||||||||||||||
|
|
||||||||||||||
| #for hcm-hyperfleet | ||||||||||||||
| principalSet://iam.googleapis.com/projects/275239757837/locations/global/workloadIdentityPools/hcm-hyperfleet.svc.id.goog/* | ||||||||||||||
| ``` | ||||||||||||||
| As an example, for a customer project named `simulated-customer-project-1` ([link to console](https://console.cloud.google.com/iam-admin/iam?cloudshell=true&project=simulated-customer-project-1) | ||||||||||||||
| It contains a topic named `sample-topic` | ||||||||||||||
|
Comment on lines
+185
to
+186
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Improve sentence structure. The sentence is fragmented across these lines. Consider restructuring for clarity. 📝 Suggested fix-As an example, for a customer project named `simulated-customer-project-1` ([link to console](https://console.cloud.google.com/iam-admin/iam?cloudshell=true&project=simulated-customer-project-1)
-It contains a topic named `sample-topic`
+For example, consider a customer project named `simulated-customer-project-1` ([link to console](https://console.cloud.google.com/iam-admin/iam?cloudshell=true&project=simulated-customer-project-1)) that contains a topic named `sample-topic`.📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||
|
|
||||||||||||||
| Assign "pubsub viewer permissions" to the principalSet | ||||||||||||||
| The following command will run a k8s job that list the topics in the project. It should succeed in every cluster and any namespace in the `hcm-hyperfleet` project | ||||||||||||||
|
|
||||||||||||||
| ``` | ||||||||||||||
| kubectl create job list-pubsub-topics \ | ||||||||||||||
| --image=google/cloud-sdk:latest \ | ||||||||||||||
| -- \ | ||||||||||||||
| gcloud pubsub topics list --project simulated-customer-project-1 | ||||||||||||||
| ``` | ||||||||||||||
|
Comment on lines
+191
to
+196
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add language specifier and clarify namespace usage. The code block has two issues:
📝 Suggested fix-```
+```bash
kubectl create job list-pubsub-topics \
+ --namespace=<any-namespace> \
--image=google/cloud-sdk:latest \
-- \
gcloud pubsub topics list --project simulated-customer-project-1📝 Committable suggestion
Suggested change
🧰 Tools🪛 markdownlint-cli2 (0.18.1)191-191: Fenced code blocks should have a language specified (MD040, fenced-code-language) 🤖 Prompt for AI Agents |
||||||||||||||
|
|
||||||||||||||
|
Comment on lines
+174
to
+197
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Document security implications and provide concrete permission-granting commands. Alternative 3 grants significantly broader access than the approaches described earlier in the document. Line 64 explicitly states that namespace+ksa scoping is preferred to limit blast radius if tokens leak. This section should:
📝 Suggested additionsAfter line 177, add a security note: **Security Note:** This approach grants access to **all workloads** running in any namespace on any cluster within the `hcm-hyperfleet` GCP project. Unlike the namespace+service-account-scoped approach described earlier, a compromised workload in any part of the Hyperfleet infrastructure could access customer resources. This is suitable for MVP but should be refined before production use.After line 184, add the permission-granting command: # Grant pubsub.viewer role to all identities in the Hyperfleet workload identity pool
gcloud projects add-iam-policy-binding projects/simulated-customer-project-1 \
--role="roles/pubsub.viewer" \
--member="principalSet://iam.googleapis.com/projects/275239757837/locations/global/workloadIdentityPools/hcm-hyperfleet.svc.id.goog/*" \
--condition=None🧰 Tools🪛 LanguageTool[uncategorized] ~176-~176: Did you mean “Google Docs”? (GOOGLE_PRODUCTS) [style] ~177-~177: Consider a more concise word here. (IN_ORDER_TO_PREMIUM) [style] ~178-~178: Consider a more expressive alternative. (DO_ACHIEVE) 🪛 markdownlint-cli2 (0.18.1)179-179: Fenced code blocks should have a language specified (MD040, fenced-code-language) 191-191: Fenced code blocks should have a language specified (MD040, fenced-code-language) 🤖 Prompt for AI Agents |
||||||||||||||
|
|
||||||||||||||
|
|
||||||||||||||
| ## Exploring 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.
Add language specifier to code block.
The fenced code block is missing a language specifier, which affects rendering and documentation tooling.
📝 Suggested fix
🧰 Tools
🪛 LanguageTool
[style] ~178-~178: Consider a more expressive alternative.
Context: ...roject will be authorized. In order to do this, customer project must allow permi...
(DO_ACHIEVE)
🪛 markdownlint-cli2 (0.18.1)
179-179: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🤖 Prompt for AI Agents