hashicorp / terraform-provider-google

Terraform Provider for Google Cloud Platform
https://registry.terraform.io/providers/hashicorp/google/latest/docs
Mozilla Public License 2.0
2.33k stars 1.73k forks source link

Workload Identity Pool Providers should support common OIDC configuration options #13666

Open rpetti opened 1 year ago

rpetti commented 1 year ago

Community Note

Description

Currently the only supported options for OIDC configuration is issuer uri:

resource "google_iam_workload_identity_pool_provider" "example" {
  workload_identity_pool_id          = google_iam_workload_identity_pool.pool.workload_identity_pool_id
  workload_identity_pool_provider_id = "example-prvdr"
  attribute_mapping                  = {
    "google.subject" = "assertion.sub"
  }
  oidc {
    issuer_uri        = "https://sts.windows.net/azure-tenant-id"
  }
}

This works fine when you are connecting from a publicly accessible endpoint, since WIF will use OIDC discovery to obtain the JWKS keys.

Unfortunately many people will need to authenticate using WIF from internal firewalled systems that are not accessible from the public internet. In these cases, WIF simply doesn't work.

This is why many OIDC implementations support other configuration options so it can function in such situations:

New or Affected Resource(s)

Potential Terraform Configuration

resource "google_iam_workload_identity_pool_provider" "example" {
  workload_identity_pool_id          = google_iam_workload_identity_pool.pool.workload_identity_pool_id
  workload_identity_pool_provider_id = "example-prvdr"
  attribute_mapping                  = {
    "google.subject" = "assertion.sub"
  }
  oidc {
    issuer_uri        = "https://sts.windows.net/azure-tenant-id"
    jwks_uri          = "https://public.sts.windows.net/.well-known/jwks.json
    jwks_json         = file("${path.module}/jwks.json")
  }
}

References

We have raised this with Google multiple times but have seen no effort given into providing a solution. We are hoping that the Terraform team can put pressure on Google to implement this feature.

b/299601100

rileykarson commented 1 year ago

This should get bumped up to the service team at some point in the future!

rpetti commented 1 year ago

Is there a contact for them or do we just keep trying to push Google through the usual support channels?

rpetti commented 1 year ago

Raised an issue with them in their public issue tracker: https://issuetracker.google.com/u/1/issues/268071356