aws / aws/aws-encryption-sdk-java

CMM cache policy on encryption and decryption DEKs

オープン
#2,177 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Java
スター
240
フォーク
125
PR マージ指標
30日以内にマージされた PR はありません

説明

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

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

まず CMM のキャッシュポリシーと、リンクされている AWS Encryption SDK の issue 840 および 841 を確認し、既存の DEK の更新および有効期限切れの動作を理解します。頻繁に使用される復号用 DEK に適用すべき、設定可能な更新動作を定義します。これには TTL およびキャッシュ置換との相互作用も含めます。ポリシーが仕様化され、レイテンシーと正確性への影響が扱われていれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
aws, java
領域
cryptography, security
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
30/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。