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.35k stars 1.75k forks source link

"google_access_context_manager_access_level" "members" condition should include groups #16365

Open kevin-greenan-tempus opened 1 year ago

kevin-greenan-tempus commented 1 year ago

Community Note

Description

From the docs:

members - An allowed list of members (users, service accounts). Using groups is not supported yet. The signed-in user originating the request must be a part of one of the provided members. If not specified, a request may come from any user (logged in/not logged in, not present in any groups, etc.). Formats: user:{emailid}, serviceAccount:{emailid}

Access Levels should allow the use of group membership conditions. Listing each user or service account identity exhaustively is not scalable. On the surface, this seems to be expected - access to a resource is handled by IAM bindings. When using VPC Service Controls, however, we want to allow access to a resource to be controlled through a condition within an access-level.

New or Affected Resource(s)

Potential Terraform Configuration

resource "google_access_context_manager_access_level" "access-level" {
  parent = "accessPolicies/${google_access_context_manager_access_policy.access-policy.name}"
  name   = "accessPolicies/${google_access_context_manager_access_policy.access-policy.name}/accessLevels/group_member"
  title  = "group_member"
  basic {
    conditions {
      members = [
        "group:group-name@example.com",
      ]
    }
  }
}

References

b/308569238

rileykarson commented 1 year ago

Note: This warning comes from the API docs

imrannayer commented 1 year ago

@kevin-greenan-tempus This is not a terraform provider limitation. According to API docs it is not supported.

The request must be made by one of the provided user or service accounts. Groups are not supported
Charlesleonius commented 1 year ago

Thank you for requesting this feature, as stated here, it is a limitation of the service itself and not the Terraform provider. It is on our radar. I can not give any indication as to timeline but it will be supported.

jeremiahbowen commented 3 days ago

This comes up in all of our SOC2, HITRUST, and GCP audits when granting permissions to individual users.

Charlesleonius commented 3 days ago

Hi @jeremiahbowen, are you using access levels as part of VPC-SC or another security feature? VPC-SC Service perimeters now support groups in ingress / egress rules which are intended to replace the use of access levels. Here is some documentation regarding the new feature: https://cloud.google.com/vpc-service-controls/docs/configure-identity-groups