Config azure key vault
List of Properties to be set for Peg Server (Decryption) and Scheme Server(Encryption) during configuration in vars.peg-master-key-storage.yml file. The values can be obtained as we follow the steps to create Azure Key Vault
| Peg Properties in PM | Values |
|---|---|
| PEG_SERVER_AZURE_VAULT_CLIENT_ID | xxxx-xxxx-xxx-xxxx-xxxxxxxxxxxxx |
| PEG_SERVER_AZURE_VAULT_CLIENT_SECRET | xxxxxxxx |
| PEG_SERVER_AZURE_VAULT_AZURE_KEY_VAULT_URL | https://xxx.vault.azure.net/ |
| PEG_SERVER_AZURE_VAULT_AZURE_MASTER_KEY | peg-key |
| PEG_SERVER_AZURE_VAULT_AZURE_MASTER_KEY_TYPE | RSA |
| PEG_SERVER_AZURE_VAULT_ZONE_KEY_ENCRYPTION_ALGO | RSA_OAEP |
| PEG_SERVER_AZURE_KEYVAULT_CLIENT_CERT_FILE | certificate.pem / certificate.pfx |
| PEG_SERVER_AZURE_KEYVAULT_CLIENT_CERTIFICATE_PASSWORD | xxxxxxxx |
| Scheme Properties in PM | Values |
|---|---|
| SCHEME_SERVER_AZURE_VAULT_CLIENT_ID | xxxx-xxxx-xxx-xxxx-xxxxxxxxxxxxx |
| SCHEME_SERVER_AZURE_VAULT_CLIENT_SECRET | xxxxxxxxx |
| SCHEME_SERVER_AZURE_VAULT_AZURE_KEY_VAULT_URL | https://xxx.vault.azure.net/ |
| SCHEME_SERVER_AZURE_VAULT_AZURE_MASTER_KEY | peg-key |
| SCHEME_SERVER_AZURE_VAULT_AZURE_MASTER_KEY_TYPE | RSA |
| SCHEME_SERVER_AZURE_VAULT_ZONE_KEY_ENCRYPTION_ALGO | RSA_OAEP |
| SCHEME_SERVER_AZURE_KEYVAULT_CLIENT_CERT_FILE | certificate.pem / certificate.pfx |
| SCHEME_SERVER_AZURE_KEYVAULT_CLIENT_CERTIFICATE_PASSWORD | xxxxxxxx |
Steps to Create Azure Key vault in Azure Portal¶
- Login to Azure Portal
- Search for
Key Vaultsin the search box. - Click on
+Create to create New Key vault - Enter the Key Vault Name
- Click on
Next - Click on
+Create to create access policy - Under
Access configurationselect Vault access policy and create access policy with all permission such as Select all for Key permissions, Secret permissions, Certificate permissions, Cryptographic Operations, Privileged Secret Operations, Privileged Certificate Operations, Privileged Key Operations, and Rotation Policy Operations then click on Next - Search for your name for in
Principleand select it, after select it should display at Selected item list and then Click on Next Applicationtab is optional , Click on Next- Click on Create
- Select the Access Policy created for the user and then Click on
Review + Create - Once validation is done by the Azure , Click on Create
- Once the Vault is created we get the
Vault URLwhich is used as the value forPEG_SERVER_AZURE_VAULT_AZURE_KEY_VAULT_URLandSCHEME_SERVER_AZURE_VAULT_AZURE_KEY_VAULT_URLin
vars.peg-master-key-storage.yml file - Now Go to Azure Active Directory
- Search for
App Registrationin the search box. - Now Click on New registration
- Now Enter the Name and then Click on Register.
- Once the application is registered, Go to the Application ,
Application (client) IDwill be the value forSCHEME_SERVER_AZURE_VAULT_CLIENT_IDin vars.peg-master-key-storage.yml file - Same way (i.e step 14 to 18 ) you can Register another Application which will be used for Decryption (Peg Server ) And once this application is registered, Go to the Application ,
Application (client) IDwill be the value forPEG_SERVER_AZURE_VAULT_CLIENT_IDin vars.peg-master-key-storage.yml file - Create Access Policy for the Registered Applications (Encrypt) in
Key VaultGo to the Key Vault Created, Click onAccess Policies. - Click on
+Create to create access policy - Select Only
GetfromKey permissionsand SelectEncryptfromCryptographic Operationsand then click onNext - Click on Select a
Principleand search for Registered App from search box (Encrypt) - Click on Select and then you can see the app in selected item and then Click On Next Application tab is optional , Click on Next , Now Click on
Create - Create Access Policy for the Registered Applications (Decrypt) in Key Vault Go to the Key Vault Created, Click on
Access Policies. - Click on
+Create to create access policy - Select Only
GetfromKey permissionsand SelectDecryptfromCryptographic Operationsand then click onNext - Click on Select a
Principleand search for Registered App from search box (Decrypt) - Click on Select and then you can see the app in selected item and then Click On Next Application tab is optional , Click on Next, Now Click on
Create - Access Policies created will be listed in Key Vault
- Under
Objectssection Create Keys To create Keys Click onKeys - Click on
Generate/Importsto create new key. - Enter a Valid Key Name , Key Type as RSA, RSA key size as 2048 and Click on
Create - Name will be the value for
SCHEME_SERVER_AZURE_VAULT_AZURE_MASTER_KEYandPEG_SERVER_AZURE_VAULT_AZURE_MASTER_KEYKey type will be the values forPEG_SERVER_AZURE_VAULT_AZURE_MASTER_KEY_TYPEandSCHEME_SERVER_AZURE_VAULT_AZURE_MASTER_KEY_TYPEin vars.peg-master-key-storage.yml file. - For
SCHEME_SERVER_AZURE_VAULT_ZONE_KEY_ENCRYPTION_ALGOput value asRSA_OAEPin vars.peg-master-key-storage.yml file. - Azure key Vault authentication can be using ClienId and Client Secret as follows.
- Create Client Secret (Create two Secrets one for encrypt app and another for decrypt app)
- Go to the Azure Active Directory , Click on
App Registration, UnderOwned ApplicationsClick on App Created to Encrypt - Now Click on
Certificates & Secrets - Click on
New Client Secret - Enter the value for description and keep Expires day 180 days (Which is default) Click on
Add - Now we can see the values for Description, Expires, Value and Secret ID
- Copy the Value of the
Client SecretCreated, which will be used as a value forSCHEME_SERVER_AZURE_VAULT_CLIENT_SECRETin vars.peg-master-key-storage.yml file. - Now again go to the Azure Active Directory , Click on
App Registration, Under Owned Applications Click on App Created to Decrypt - Now Click on
Certificates & Secrets - Click on
New Client Secret - Enter the value for description and keep Expires day 180 days (Which is default) Click on
Add - Now we can see the values for Description, Expires, Value and Secret ID
- Copy the Value of the
Client SecretCreated, which will be used as a value forPEG_SERVER_AZURE_VAULT_CLIENT_SECRETin vars.peg-master-key-storage.yml file.
-
ClientId and Certificate : For certificate based authentication, pegv2 is supporting the following format/combination.
- PEM format certificate without password
- PFX format certificate without password
- PEM format certificate with password
-
PFX format certificate with password
-
Follow the below steps to generate certificates and link with Azure SPN.
-
PEM format certificate without password
- Go to Azure Key vault which was created in the above steps , under
objectsclick oncertificatesand then click on Generate/import option to create certificate. - Select Method of Certificate Creation as Generate
- Enter Certificate Name
- Enter Subject eg: CN=mydomain.com
- Select Content Type as PEM
- Click on Create
- It takes some time to enable the certificate
- Once it’s enabled, Click on the Certificate and Download it in PFX/PEM Format
- Copy the downloaded certificate into following location in Privacera Manager host
Bash - Update same certificate file name in vars.peg-master-key-storage.yml
- Open the download certificate in the any editor
- Remove the private key section from it and upload it to both the Azure SPN created (i.e Encrypt and Decrypt Azure Application).
- Go to the Application
- Click on Certificates and Secrets
- Click on Upload Certificate
- Upload the Certificate and Click on Add
- Go to Azure Key vault which was created in the above steps , under
-
PFX format certificate without password
- Go to Azure Key vault which was created in the above steps , click on certificates and then click on Generate/import option to create certificate.
- Select Method of Certificate Creation as Generate
- Enter Certificate Name
- Enter Subject eg: CN=mydomain.com
- Select Content Type as PKCS
- Click on Create
- It takes some time to enable the certificate
- Once it’s enabled, Click on the Certificate and Download it in PFX/PEM Format
- Copy the downloaded certificate into following location in Privacera Manager host
Bash - Update same certificate file name in
vars.peg-master-key-storage.yml - Update same certificate file name and extract certificate from pfx file using below command that will generate output file as
domain.crt,if it askEnter Import Passwordprovide the password as blank, just hit enter.Bash - Upload
domain.crtfile to both Azure SPN (i.e Encrypt and Decrypt Azure Application).- Go to the Application
- Click on Certificates and Secrets
- Click on Upload Certificate
- Upload the Certificate and Click on Add
-
PFX format certificate with password
- Coverting PFX to PEM format.
Bash - Update same certificate file and run following command in terminal by providing password for private key in prompt to generate
pegv2-cert.pfxanddomain.crtcertificate with openssl. - Copy the
pegv2-cert.pfxcertificate into the below location in Privacera Manager hostBash - Update the same certificate file name and password in
vars.peg-master-key-storage.yml - Upload
domain.crtfile to both Azure SPN (i.e Encrypt and Decrypt Azure Application).- Go to the Application
- Click on Certificates and Secrets
- Click on Upload Certificate
- Upload the Certificate and Click on Add
- Coverting PFX to PEM format.
-
PEM format certificate with password
-
Update same certificate file name and run following command in terminal by providing password for private key in prompt to generate certificate
domain.pemandcombined_cert.pemwith openssl -
Copy the
combined_cert.pemcertificate into the below location in Privacera Manager hostBash - Update the same certificate file name and password in
vars.peg-master-key-storage.yml - Upload domain.pem file to both Azure SPN (i.e Encrypt and Decrypt Azure Application).
- Go to the Application
- Click on Certificates and Secrets
- Click on Upload Certificate
- Upload the Certificate and Click on Add
-
-
- Prev topic: Install Encryption on Privacera Platform