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 Vaults
in 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 configuration
select 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
Principle
and select it, after select it should display at Selected item list and then Click on Next Application
tab 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 URL
which is used as the value forPEG_SERVER_AZURE_VAULT_AZURE_KEY_VAULT_URL
andSCHEME_SERVER_AZURE_VAULT_AZURE_KEY_VAULT_URL
in
vars.peg-master-key-storage.yml file - Now Go to Azure Active Directory
- Search for
App Registration
in 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) ID
will be the value forSCHEME_SERVER_AZURE_VAULT_CLIENT_ID
in 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) ID
will be the value forPEG_SERVER_AZURE_VAULT_CLIENT_ID
in vars.peg-master-key-storage.yml file - Create Access Policy for the Registered Applications (Encrypt) in
Key Vault
Go to the Key Vault Created, Click onAccess Policies
. - Click on
+
Create to create access policy - Select Only
Get
fromKey permissions
and SelectEncrypt
fromCryptographic Operations
and then click onNext
- Click on Select a
Principle
and 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
Get
fromKey permissions
and SelectDecrypt
fromCryptographic Operations
and then click onNext
- Click on Select a
Principle
and 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
Objects
section Create Keys To create Keys Click onKeys
- Click on
Generate/Imports
to 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_KEY
andPEG_SERVER_AZURE_VAULT_AZURE_MASTER_KEY
Key type will be the values forPEG_SERVER_AZURE_VAULT_AZURE_MASTER_KEY_TYPE
andSCHEME_SERVER_AZURE_VAULT_AZURE_MASTER_KEY_TYPE
in vars.peg-master-key-storage.yml file. - For
SCHEME_SERVER_AZURE_VAULT_ZONE_KEY_ENCRYPTION_ALGO
put value asRSA_OAEP
in 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 Applications
Click 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 Secret
Created, which will be used as a value forSCHEME_SERVER_AZURE_VAULT_CLIENT_SECRET
in 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 Secret
Created, which will be used as a value forPEG_SERVER_AZURE_VAULT_CLIENT_SECRET
in 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
objects
click oncertificates
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 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 Password
provide the password as blank, just hit enter.Bash - Upload
domain.crt
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
-
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.pfx
anddomain.crt
certificate with openssl. - Copy the
pegv2-cert.pfx
certificate 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.crt
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
- 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.pem
andcombined_cert.pem
with openssl -
Copy the
combined_cert.pem
certificate 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