Create Custom KMS encryption keys on GCP - RedHatInsights/uhc-portal GitHub Wiki
Creation of custom KMS encryption keys on GCP used to configure from OSD GCP CCS clusters during installation (Wizard step : Cluster settings > Details : Additional encryption)
- Download and install the gcloud tool
- Run command to login
$ gcloud auth login
- Select your account and confirm the login message on the browser.
- Run command to set your project
$ gcloud config set project <PROJECT_ID>
- Launch/Go to GCP web console and go to Security > Key management sections.
- Create a Keyring configuration. Say keyring name as
keyring-name
and select key ring location asglobal
- Create a Key with a valid name. Say keyname as 'key-name`
- Launch/Go to GCP web console and go to IAM -> Service account section.
- Create an IAM user with the configuration like below.
- service account name : provide a valid name.
- service account ID : provide a valid id.
- Click "Create" and continue
- Assign below roles to the IAM user created by the service account
- Cloud KMS CryptoKey encrypter/Decrypter
- Compute Admin
- DNS administrator
- Service account admin
- Security admin
- Service account key admin
- Service account user
- Storage admin
-
Run the command on your local to bind the SA to the keyring
-
gcloud kms keys add-iam-policy-binding <KEYNAME> --keyring <KEYRING NAME> --location global --member serviceAccount:<KEYRINGSA>@<GCP PROJECTID>.iam.gserviceaccount.com --role roles/cloudkms.cryptoKeyEncrypterDecrypter
-
Run command to the SA you used for the cluster creation
-
gcloud kms keys add-iam-policy-binding <KEYNAME> --keyring <KEYRING NAME> --location global --member serviceAccount:osd-ccs-admin@<GCP PROJECT ID>.iam.gserviceaccount.com --role roles/cloudkms.cryptoKeyEncrypterDecrypter
-
Run the command to the GCP project number.
-
gcloud projects describe <GCP PROJECT ID>
-
Run the command below to add the default SA to the keyring
-
gcloud kms keys add-iam-policy-binding <KEYNAME> --keyring <KEYRING NAME> --location global --member serviceAccount:service-<PROJECT NUMBER>@compute-system.iam.gserviceaccount.com--role roles/cloudkms.cryptoKeyEncrypterDecrypter