aws / aws/aws-encryption-sdk-java

CMM cache policy on encryption and decryption DEKs

Aperta
#2,177 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Java
Stelle
240
Fork
125
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

### 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:

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia esaminando la policy della cache di CMM e le issue 840 e 841 collegate di AWS Encryption SDK per comprendere il comportamento esistente di aggiornamento e scadenza dei DEK. Definisci quale comportamento di aggiornamento configurabile debba applicarsi ai DEK di decrittografia usati frequentemente, inclusa la sua interazione con TTL e la sostituzione della cache; il lavoro è completato quando la policy è specificata e i suoi effetti su latenza e correttezza sono stati trattati.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
aws, java
Ambito
cryptography, security
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
30/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.