Encryption at rest in Elastic Cloud: Bring your own key with Google Cloud
Now that we’ve introduced Elastic Cloud encryption at rest and walked you through setting it up in AWS and Azure, it’s time to get you set up in Google Cloud.
In this final blog of the series, we will explain how encryption at rest works with Google Cloud Key Management Service (KMS) and then show you how to apply a Google Cloud KMS key to an Elastic Cloud Hosted deployment for encrypting data and snapshots at rest. We’ll also show you how to validate your setup and implement additional security policies, such as encryption key rotation and revocation.
https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt9670a756a29ba9bc/66f42a09f82be145fd7f7ebd/image8.png,image8.pngPrerequisites
Get your own key: Creating an Elastic deployment with a customer provided encryption key is also known as Bring Your Own Key (BYOK). To create an Elastic deployment with BYOK, you need to have Google Identity and Access Management (IAM) permissions to create a Google Cloud key using the Cloud KMS. The key must be created on a Google Cloud key ring in the same region as the Elastic deployment that you’re going to encrypt.
Upgrade to Enterprise: An Enterprise license is required for BYOK.
Access control: You also need permissions to manage access to your new key resource using Google IAM. This is required to grant the service principles used by Elastic to access your key.https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/bltf145dff0c596b675/66f42a603666b00e3cbade45/image16.png,image16.png
After you’ve logged in to the console, click the Create deployment button.
https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/bltcfa89d75f35cccbd/66f42a798d8478ecdc308a49/image3.png,image3.png
Enter a name for your deployment and select Google Cloud as your cloud provider. Expand the Advanced settings section and enable the Use a customer-managed encryption key option. Copy the Elastic service account and the Google Cloud Platform cloud storage service agent to save these values somewhere handy for a later step.
https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt45563e9a9eb22e4f/66f42ab180b55fcaa9e1ade6/image17.png,image17.png
For now, we’ll leave the create deployment page as it is and open a new browser tab, where we’ll create a Google Cloud key that we’ll use to encrypt the deployment.
https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt976bb77169073653/66f42afe8d84780002308a63/image7.png,image7.png
Click Create Key.
https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/bltc918bec9e652e2f2/66f42b2900983e7d244aa696/image12.png,image12.png
Enter a Key Name for the key to be created and click Create.
https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/bltd3bf2bc78869b294/66f42b60d2760a9a0caa75fd/image5.png,image5.png
Select the newly created key to see its details.
https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt86fac2504b42b222/66f42b8faa28a851a7d2cb57/image1.png,image1.png
Select the key’s Permissions tab.
https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt057defc8a6ecb431/66f42bacf9cb26860743e24d/image19.png,image19.png
Select Grant Access.
https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/bltff0a76292dc69986/66f42bd85d63986ddc237a4f/image13.png,image13.png
Paste in the Elastic service account in the New Principals field and assign it the roles Cloud KMS CryptoKey Encrypter/Decrypter and Cloud KMS Viewer. Click Save.
https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blte31e9b97bf82cc34/66f42bf700983e624e4aa6a6/image15.png,image15.png
Select the key’s Grant Access button again.
https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/bltcd9fea430fc29cd4/66f42c24fb482cd774b4a7fd/image2.png,image2.png
Paste in the Google Cloud Platform cloud storage agent in the New Principals field and assign it the role Cloud KMS CryptoKey Encrypter/Decrypter. Click Save.
https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt7488c5018fb1600d/66f42c3a17eec96b5d5a7701/image14.png,image14.png
Click on the Back to key ring details button.
https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/bltae34caf9b482a28f/66f42c58848c0a82aa617741/image6.png,image6.png
Click the Action button for the key and select Copy resource name.
https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/bltf52c1e3727991ed0/66f42cf88d847822a6308a9f/image4.png,image4.pngElastic deployment creation completion
Return to the Elastic Cloud portal to complete the deployment creation that you started at the outset of this blog post. Within the Advanced Settings, under Encryption at rest, paste in the Google Cloud Key resource name. It should be in the following format:
projects/PROJECT_ID/locations/LOCATION/keyRings/KEY_RING/cryptoKeys/KEY_NAME
Click Create deployment.
https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blta300cacfd951e4f0/66f42d423816cb7b68cfed2a/image11.png,image11.png
The deployment is now created and encrypted using the specified Google Cloud key.
https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt043d753bc220e1b6/66f42d7d7808dba2a9ef999f/image18.png,image18.png
Select Manage encryption key in the Encryption at rest section.
https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt8c0ad177b801f5d5/66f42d9760c74962b3907a38/image9.png,image9.png
You should see your Google Cloud key resource name.
https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blteeb0ce9a850c9798/66f42dbfaa28a875a3d2cba6/image10.png,image10.pngKey rotation and revocation
Key rotations are managed in the Google Cloud Key Management service. You can manually rotate keys or set up automatic rotation. Key rotation operations made in Google Cloud KMS will take effect in Elastic Cloud within a day.
Revoking a key in the Google Cloud KMS is a break-glass procedure in case of a security breach. Elastic Cloud will receive an error within a 30-minute period if an encryption key is disabled or deleted, or if the assigned role is removed from the IAM permissions.
The revocation can be rolled back if the action was unintended. Otherwise, Elastic Cloud locks the directories in which your deployment data live and prompts you to delete your deployment as an increased security measure.
The release and timing of any features or functionality described in this post remain at Elastic’s sole discretion. Any features or functionality not currently available may not be delivered on time or at all.