Hello,
Envelope-Encryption is a great pattern that allows encrypting data at-rest and at scale without too chatty interactions with KMS API.
It has many more merits that I am currently not listing here.
AWS KMS API fully supports it and Hashicorp Vault (Transit backend) seems to provide most of the capabilities to support this pattern too.
However, it appears there is one gap in Hashicorp Vault, which can be easily fixed to better support
Envelope-Encryption.
AWS KMS API ensures that the Data Encryption Key is produced via a read-only API that does not store it. It is good for segregation and for storage scaling (especially in cases where there is one DEK per data object).
Currently, Hashicorp Vault (Transit backend) use a stateful API to generate the data encryption key and store it inside Vault. Even though it may seems to provide some flexibility (future automatic key rotation support), it is mainly a limitation for systems that wish proper segregation & scaling.
I would like to propose to fix the API that generate DEKs such that it also allows (e.g., via input parameter, a flag) generating DEKs in a complete stateless manner and without storing it anywhere.
Application can generate DEK by itself quite easily but then it requires another hope to the KMS in order to encrypt it.
What do you think?
Vault Team, would you consider adding it to your JIRA backlog?
Thanks,
Yossi C. (Amdocs)