1.0 Introduction
There are several ways to export Fortanix-Data-Security-Manager (DSM) keys to major cloud providers that support Bring Your Own Key (BYOK) for server-side encryption.
2.0 Prerequisite
Ensure the following:
Download Fortanix DSM CLI from here.
3.0 Google Cloud
3.1 GCS (Cloud Storage)
For GCS, actual base64 customer keys are needed to be provided for every upload and download of objects to GCS.
Run the following command to create a 256-bit AES key in Fortanix DSM with the
EXPORT
key operation enabled:$ python sdkms-cli create-key --obj-type AES --key-size 256 --name Google-Cloud-Master-Key --exportable
Run the following command to export this key on your application environment:
$ python sdkms-cli export-object --name Google-Cloud-Master-Key
Run the following command to add the following option to the
GSUtil
section of GSUtil boto configuration file:encryption_key = [YOUR_ENCRYPTION_KEY] decryption_key1 = [YOUR_ENCRYPTION_KEY]
Run the following command to upload and download objects in GCS with encryption with your own keys:
$ gsutil cp [LOCAL_OBJECT_LOCATION] gs://[DESTINATION_BUCKET_NAME]/ $ gsutil cp gs://[BUCKET_NAME]/[OBJECT_NAME] [OBJECT_DESTINATION]
GCS browser shows that the object is customer encrypted.
Figure 1: Customer encrypted
3.2 GCE (Compute Engine)
GCE supports import of customer keys wrapped by a Google public key. Since Fortanix DSM supports wrapping natively, actual material of the customer keys are never exposed.
Run the following command to create a 256-bit AES key in Fortanix DSM with the
EXPORT
key operation enabled:$ python sdkms-cli create-key --obj-type AES --key-size 256 --name Google-Cloud-Master-Key --exportable
Run the following command to fetch Google public key:
$ curl "https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem" -o google-cloud-csek-ingress.pem $ openssl x509 -pubkey -noout -in google-cloud-csek-ingress.pem > google-cloud-csek-public.pem
Run the following command to import the Google public key in Fortanix DSM:
$ python sdkms-cli import-key --obj-type RSA --in google-cloud-csek-public.pem --name Google-Cloud-Public-Key
Run the following command to wrap Fortanix DSM master key with Google public key, using Fortanix DSM:
$ sdkms-cli wrap-key --kid (kid of master key) --alg RSA --mode OAEP_MGF1_SHA1 --wrapping-kid (kid of the Google public key) --out rsawrappedkey.txt $ openssl enc -base64 -in rsawrappedkey.txt | tr -d '\n' | sed -e '$a\' > rsawrappedbase64key.txt
Set the key data in GCE as a wrapped key.
Figure 2: Set the key data
The disk says that it's encrypted with customer keys.
Figure 3: Encryption