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 support for not managing audit_config in google_project_iam_policy #6557

Open
natalysheinin opened this issue Jun 9, 2020 · 3 comments

Comments

@natalysheinin
Copy link

natalysheinin commented Jun 9, 2020

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment. If the issue is assigned to the "modular-magician" user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If the issue is assigned to a user, that user is claiming responsibility for the issue. If the issue is assigned to "hashibot", a community member has claimed the issue already.

Description

It is not possible to manage google_project_iam_policy without managing the audit_config policy.

New or Affected Resource(s)

  • google_project_iam_policy

Potential Terraform Configuration

resource "google_project_iam_policy" "project-iam" {
  project     = local.project
  policy_data = data.google_iam_policy.my-project.policy_data
}

data "google_iam_policy" "my-project" {
  binding {
    role = "roles/storage.admin"
    members = [
      ...
    ]
  }
...

manage_audit_config_policy = False
}

References

b/374161751

@ghost ghost added enhancement labels Jun 9, 2020
@danawillow
Copy link
Contributor

Hey @natalysheinin, we have two other types of IAM resources that will manage a policy without audit configs: *_iam_binding resources, which are an authoritative list of members for a specific role, and *_iam_member resources, which ensure that a specific member is present in the list for that role. We typically recommend that users use those less authoritative versions of the IAM resources, which also don't manage audit configs.

Is there a specific reason why you need to be using the google_iam_policy resource, or would the binding/member resources work for you?

@natalysheinin
Copy link
Author

I prefer using the google_iam_policy because it's provides much tighter security controls over the entirety of the IAM bindings in a given resource (org/folder/proj/etc).

If I couldn't use google_iam_policy, I would need to have 100+ empty bindings just to ensure that I am tracking the membership of every role. The terraform file would become to large and I'll never know if a new custom role or google-managed role is added that I am not tracking.

@ghost ghost removed the waiting-response label Jun 15, 2020
@danawillow danawillow added this to the Backlog milestone Jun 22, 2020
modular-magician added a commit to modular-magician/terraform-provider-google that referenced this issue Oct 10, 2022
* avro_options added along with test

* avro test file changed

* markdown file updated

* Suggested Changes in Spacing and Field Required

Signed-off-by: Modular Magician <[email protected]>
modular-magician added a commit that referenced this issue Oct 10, 2022
* avro_options added along with test

* avro test file changed

* markdown file updated

* Suggested Changes in Spacing and Field Required

Signed-off-by: Modular Magician <[email protected]>

Signed-off-by: Modular Magician <[email protected]>
@rileykarson
Copy link
Collaborator

This makes sense, we support google_iam_policy (the whole policy entry), and google_iam_binding (a single entry in bindings), but could support google_iam_bindings to manage the bindings item at https://cloud.google.com/resource-manager/reference/rest/Shared.Types/Policy

@rileykarson rileykarson added size/l and removed size/m labels Jun 26, 2023
@rileykarson rileykarson modified the milestones: Backlog, Goals Jun 26, 2023
@github-actions github-actions bot added forward/review In review; remove label to forward service/cloudresourcemanager-crm labels Sep 27, 2023
@melinath melinath removed forward/review In review; remove label to forward waiting-response labels Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants