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 'customer supplied encryption keys' in the GCS backend #16936

Merged
merged 1 commit into from
Jan 9, 2018

Conversation

negz
Copy link
Contributor

@negz negz commented Dec 18, 2017

Currently all files in GCS are transparently encrypted at rest using Google's keys, and IAM/ACL can be used to restrict access to GCS buckets. Allowing state files in GCS to be encrypted with a custom key provides an additional layer of defense around sensitive Terraform state.

Objects created with a customer supplied encryption key can only be read when the key used for creation is passed in with the read request. See #16836 for further details.

https://cloud.google.com/storage/docs/encryption#customer-supplied

GCS state created using customer supplied encryption keys can only be read or
modified using the same key.
Copy link
Contributor

@paddycarver paddycarver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Passes tests for me, and code looks good and straightforward enough. Thanks for this awesome addition!

@paddycarver paddycarver merged commit e4cdbd6 into hashicorp:master Jan 9, 2018
@negz
Copy link
Contributor Author

negz commented Jan 9, 2018

Thanks @paddycarver !

@negz negz mentioned this pull request Jan 9, 2018
@ocervell
Copy link

ocervell commented Oct 14, 2019

@negz Does this support customer-managed keys for use with KMS ? Does one have to generate the key using e.g Python ? It would be nice to have state encrypted using KMS crypto keys which are generated from a client secret.

@negz
Copy link
Contributor Author

negz commented Oct 14, 2019

@ocervell I made this change almost two years ago and no longer actively use Terraform, so I'm afraid I'm not up to speed with the interplay between customer supplied GCS keys and KMS. I recall thinking that it would be nice to store customer managed keys in KMS, but we decided this first implementation would be simpler. There's some context on that decision process in #16836.

@negz negz deleted the gcskeys branch October 14, 2019 21:13
@negz
Copy link
Contributor Author

negz commented Oct 14, 2019

Does this support customer-managed keys for use with KMS

@ocervell Ah - I see customer managed keys are distinct from customer supplied keys, so no that is not supported by this change. I don't think managed keys existed when I wrote it, but it seems like it would be a great addition now.

@ghost
Copy link

ghost commented Oct 15, 2019

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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

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

Successfully merging this pull request may close these issues.

4 participants