Protect messaging and streaming data in the cloud with "data key" encryption
The best approach for protecting data in message queues and data streams is to not put any sensitive data in the message. Some systems use a claim check model where the messages contain just resource identifiers that can be used passed to the originating system to retrieve the data. The Claim check approach creates tighter coupling between the producer and consumers. It puts an additional burden on the producer to be able to cough up the data associated for the claim for some period of time. Some systems sometimes have to create caching architectures to store the claims for retrieval adding additional complexity to the producer.
Data / payload encryption is an alternative approach that can be used to protect data stored in messaging systems or on disk. Sensitive data is encrypted and put into the message payload. Producers and consumers only need share access to encryption or decryption keys. This is easy in cloud environments which have services built just for this.
Standard disk encryption does not provide the same level of data security as payload. Data on encrypted volumes can be seen by anyone with access with no additional work. Application machines often have volume access at the root level.
Amazon and Azure SDKs support both approaches.
The Azure SDK supports one time use symmetric data key creation for every message sent.
Semi-ephemeral should most likely be encrypted using the data key approach.
Data / payload encryption is an alternative approach that can be used to protect data stored in messaging systems or on disk. Sensitive data is encrypted and put into the message payload. Producers and consumers only need share access to encryption or decryption keys. This is easy in cloud environments which have services built just for this.
Standard disk encryption does not provide the same level of data security as payload. Data on encrypted volumes can be seen by anyone with access with no additional work. Application machines often have volume access at the root level.
Asymmetric encryption vs symmetric encryption
Asymmetric encryption provides more security because of the algorithms used and because of the segregation of encryption and decryption keys. The downsides of asymmetric encryption is speed and resulting payload size. Note: Asymmetric algorithms can be used for signing payloads or encrypting data.
Symmetric encryption uses the same key for encryption and decryption. It is unsuitable for digital signing. because anyone with the decrypt key could use that same key to create a false signature. Symmetric encryption is faster than asymmetric encryption, costs less in compute and results in smaller payloads than common asymmetric algorithms.
Envelope Encryption
- Create symmetric encryption key
- Encrypt data with the symmetric data key
- Encrypt data key with asymmetric cloud key
- Send encrypted data key and encrypted data in message
Approaches
Cloud provider vaults and encryption services provide highly secure asymmetric encryption support. You can use those services to directly encrypt your data or you can use those services to encrypt the keys that are used to encrypt your data.
Approach | Description | Key Management |
---|---|---|
Encrypt data with asymmetric cloud key |
|
|
Envelope (data key) Encryption |
|
|
Amazon and Azure SDKs support both approaches.
Envelop, aka data key, encryption
This diagram shows how data key encryption works. Data keys can be cached and re-used in many situations. This results in significant performance improvements and fewer cloud provider calls.
Cloud provider SDKs hide the bulk of this complexity.
Single pass encryption
SDK notes
The Amazon SDK supports data key caching. SDK FAQ, KMS FAQThe Azure SDK supports one time use symmetric data key creation for every message sent.
Advantages and Disadvantages
Let us look at some of the advantages of both approaches.Approach | When to use | When to not use |
---|---|---|
Encrypt data with asymmetric cloud key |
|
|
Envelope (data key) Encryption |
|
|
Semi-ephemeral should most likely be encrypted using the data key approach.
Video
Change Log
Created 2020 Feb 16
Comments
Post a Comment