Skip to content
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 GH required attribute_condition #672

Merged
merged 1 commit into from
Dec 17, 2024

Conversation

joshrwolf
Copy link
Contributor

this module hasn't been updated in a while, and it seems to have fallen into a broken state.

╷
│ Error: Error creating WorkloadIdentityPoolProvider: googleapi: Error 400: The attribute condition must reference one of the provider's claims. For more information, see https://cloud.google.com/iam/docs/workload-identity-federation-with-deployment-pipelines#conditions
│
│   with module.github_wif.google_iam_workload_identity_pool_provider.this,
│   on .terraform/modules/github_wif/modules/github-wif-provider/main.tf line 8, in resource "google_iam_workload_identity_pool_provider" "this":
│    8: resource "google_iam_workload_identity_pool_provider" "this" {

according to https://cloud.google.com/iam/docs/workload-identity-federation-with-deployment-pipelines#conditions, for GH WIF, the following attribute_condition is now required:

Warning: GitHub, GitLab SaaS, and Terraform Cloud use a single issuer URL across all organizations and some of the claims embedded in OIDC tokens might not be unique to your organization. To help protect against spoofing threats, you must use an attribute condition that restricts access to tokens issued by your GitHub organization, GitLab group, or Terraform Cloud organization.

this PR adds var.repository_owner as a required variable (a breaking change), but I think this is ok since the module is already broken, now it'll at least fail with a reason/fix

@joshrwolf joshrwolf merged commit 85c0d3c into chainguard-dev:main Dec 17, 2024
85 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants