Add Google KMS as a Harness Secrets Manager
This content is for Harness FirstGen. Switch to NextGen.You can use Google Cloud Key Management Service (Cloud KMS) as your secrets manager. Once Google KMS is added as a Secrets Manager, you can create encrypted secrets in Google KMS and use them in your Harness account.
You can also use a Google Cloud Secrets Manager as a Harness Secrets Manager. See Add a Google Cloud Secrets Manager.In this topic:
- Before You Begin
- Step 1: Configure Secrets Manager
- Step 2: Display Name
- Step 3: Gather the Required Details
- Step 4: Attach Service Account Key (Credentials) File
- Limitations
- Next Steps
Before You Begin
Step 1: Configure Secrets Manager
- Select Security > Secrets Management. The Secrets Management page appears.
- Click Configure Secrets Managers. In the resulting Secrets Managers page, the Status column indicates the Default provider.
- Click Add Secrets Manager. The Configure Secrets Manager dialog appears.
- Select Google KMS from the drop down list.
Step 2: Display Name
Enter an arbitrary name to identify this secrets manager. The name can include letters, numbers, spaces, and the following characters: ' - !
Step 3: Gather the Required Details
To fill in the Configure Secrets Manager dialog's remaining fields, log into Google Cloud Console and follow these steps:
- Create or select your project.
- Select Security > Cryptographic**Keys**.
- Select a key ring. (If no key ring is present, create one.)To create resources in this or the next step, see Google Cloud's Creating Symmetric Keys topic.
- Select a key within the ring. (If no key ring is present, create one.)
- To the right of your key's Enabled & Primary Version, open the Actions ⋮ menu, then select Copy Resource ID. A reference to the key is now on your clipboard.
- Paste the reference into an editor. You can now copy and paste its substrings into each of the Harness Configure Secrets Manager dialog's remaining fields—Project ID, Region, Key Ring, Key Name—as shown below.
Step 4: Attach Service Account Key (Credentials) File
Export your Google Cloud service account key, and attach it to the Harness Configure Secrets Manager dialog, as follows:
In the Google Cloud Console, select IAM & admin > Service Accounts.
Scroll to the service account you want to use. (If no service account is present, create one.)
Grant this service account the
cloudkms.cryptoKeyEncrypterDecrypter
permission. (See Google Cloud's Using Cloud IAM with KMS topic.)Open your service account's Actions ⋮ menu, then select Create key.
In the resulting Create private key dialog, select the JSON option, create the key, and download it to your computer.
Return to Harness Manager's Configure Secrets Manager dialog. Under GCP KMS Credentials File, click the Choose File button, and upload the key file you just exported from Google Cloud.
Click Submit. Your Google Cloud KMS will now appear in Harness Manager's Secrets Managers list, labeled with the Display Name you assigned.