aws / aws/aws-encryption-sdk-java

CMM cache policy on encryption and decryption DEKs

Ouverte
#2,177 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Java
Étoiles
240
Forks
125
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

### Problem:

While profiling an application I could find latency spikes, relate to decryption

If an application is regularly using a DEK for decryption, it can expire due to its TTL
As I read the code the TTL is set when the key is created. Is seems sensible that the key would expire when not used, but if used frequently why should it expire?

as [ajewellamz](https://github.com/ajewellamz) poned our when I raised this in the wrong project -https://github.com/aws/aws-encryption-sdk/issues/841 https://github.com/aws/aws-encryption-sdk/issues/841#issuecomment-3628451811 it is also experied to ensure correctness, and that the application has access to decrypt

We may have several thousand decryption DEKs in the cache, and regularly in use, and then we see a spike of a many decryption DEKs being regenerated, because they have expired due to TTL, which causes application latency (and some cost)

We have implemented a mechanism to rotate encryption DEKs as we know the limited set of keys in use. Effectively just regenerate the key 10 second before it would expire, but his path doesn't block encryption calls as it doesn't evict from the cache, it just replaces the entry when regenerated - https://github.com/aws/aws-encryption-sdk/issues/840

### Solution:

I think there could be some option to refresh the DEKs before they expire, to keep DEKs that are in use (within some time window), without DEK access causing latency to the calling app

We have some code in our project that does this for the encryption DEKs, which we could export to this library if its useful to others, which I imagine it would be

### Out of scope:

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Commencez par examiner la politique de cache de CMM et les issues 840 et 841 liées de AWS Encryption SDK afin de comprendre le comportement existant d’actualisation et d’expiration des DEK. Définissez le comportement d’actualisation configurable qui doit s’appliquer aux DEK de déchiffrement fréquemment utilisés, y compris son interaction avec le TTL et le remplacement du cache ; le travail est terminé lorsque la politique est spécifiée et que ses effets sur la latence et la correction sont couverts.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
aws, java
Domaine
cryptography, security
Type d'issue
Fonctionnalité
Difficulté
5/5
Temps estimé
Plus d'une semaine
Activité
À l'abandon
Clarté
À clarifier
Accessibilité débutants
30/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.