Skip to main content

Encryption

Data is encrypted at three levels:

  1. Inside Vault all data is stored encrypted at field level, preventing even the database's administrator from decrypting the data.
  2. Data in transit between an application and Vault is protected using TLS.
  3. The Vault database is encrypted at rest (aka disk-level encryption). This is enforced as part of the deployment.

From the application's perspective, accessing and querying encrypted properties and handling encryption is fully transparent.

Vault manages key provisioning and rotation for the encryption keys.

Key management service

Vault uses a key management service (KMS) to sign and verify the encryption keys used for property encryption and decryption. You must define an Amazon Web Service (AWS) or Google Cloud Platform (GCP) KMS when implementing Vault in the cloud for property encryption to be secure. You can configure AWS KMS and GCP Cloud Key Management to use a Hardware Security Module (HSM) in order to increase the security of your key security and to comply with PCI HSM.

To configure a KMS, set the PVAULT_KMS_URI environment variable to the KMS key URI using these patterns:

KMSKMS identifier prefixKey URI format
AWS KMSaws-kms://aws-kms://arn:aws:kms:<region>:<account-id>:key/<key-id>
GCP KMSgcp-kms://gcp-kms://projects/*/locations/*/keyRings/*/cryptoKeys/*

Vault must have these permissions to be able to use the KMS:

  • Sign keys with the KMS
  • Verify keys with the KMS
  • Get the KMS public key

These high-level permissions have equivalent policies in AWS and GCP that need to be granted to the AWS or GCP authenticated identity where Vault is running.

danger

When Vault is started without an external KMS it uses a built-in hard-coded master encryption key. This is convenient for development and testing purposes but is insecure and must not be used in a production environment that requires property encryption.

info

The Vault roadmap includes support for controlling rotation parameters, complex queries over encrypted data, bring your own key (BYOK) for multi-tenant applications, and more.