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

Support IAM policy bindings for KMS Keyring and CryptoKey resources #762

Closed
tragiclifestories opened this issue Nov 17, 2017 · 7 comments · Fixed by #781
Closed

Support IAM policy bindings for KMS Keyring and CryptoKey resources #762

tragiclifestories opened this issue Nov 17, 2017 · 7 comments · Fixed by #781

Comments

@tragiclifestories
Copy link
Contributor

As things stand, the only way to manage cloudkms roles is at the project level, which is very coarse grained - especially given the actual function of cryptographic keys in a software system ;-)

Proposal is to have the same sort of interface as in similar resources (eg #481).

resource "google_kms_key_ring" "top_secret" {
  name     = "top-secret"
  location = "global"
  project  = "my-project-123"
}

data "google_iam_policy" "top_secret" {
  binding {
    role = "roles/cloudkms.encryptDecrypt"

    members = [
      "[email protected]",
      "[email protected]",
    ]
  }
}

resource "google_kms_key_ring_iam_binding" "top_secret" {
  key_ring = "${google_kms_key_ring.top_secret.id}"

  policy_data = "${data.google_iam_policy.top_secret.policy_data}"
}
@rosbo rosbo self-assigned this Nov 17, 2017
@rosbo
Copy link
Contributor

rosbo commented Nov 17, 2017

I agree that fine grained permissions is critical especially for cryptographic keys. Once #744 is merged. I will add IAM support for KMS resources.

@tragiclifestories
Copy link
Contributor Author

@rosbo This still on your radar? I'm happy to take it (now that you've done all the hard work 😂 )

@rosbo
Copy link
Contributor

rosbo commented Nov 21, 2017

@tragiclifestories I was planning to tackle this later this week but if you have time go for it and let me know if the new abstractions generalize well :)

@rosbo
Copy link
Contributor

rosbo commented Nov 21, 2017

I found a bug while adding the IAM support for organization, make sure you have the change in #774 whenever you decide to tackle this.

@rosbo
Copy link
Contributor

rosbo commented Nov 21, 2017

I added support for organization IAM here #775. You might want to use it as an example.

@rosbo
Copy link
Contributor

rosbo commented Nov 21, 2017

This PR also refactor the authoritative resource #776 to allow easy reusability. You might want to use that for KMS resources.

@ghost
Copy link

ghost commented Mar 30, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants