aws / aws/aws-encryption-sdk-java
CMM cache policy on encryption and decryption DEKs
- Ngôn ngữ chính
- Java
- Star
- 240
- Fork
- 125
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
### 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:
Hướng dẫn đóng góp
Hướng nghiên cứu
Bắt đầu bằng việc xem xét chính sách bộ nhớ đệm CMM và các issue 840 và 841 được liên kết của AWS Encryption SDK để hiểu hành vi hiện tại về việc làm mới và hết hạn DEK. Xác định hành vi làm mới có thể cấu hình nào sẽ áp dụng cho các DEK giải mã được sử dụng thường xuyên, bao gồm cả tương tác của hành vi này với TTL và việc thay thế bộ nhớ đệm; được xem là hoàn thành khi chính sách đã được đặc tả và các ảnh hưởng của chính sách đến độ trễ và tính đúng đắn đã được đề cập.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- aws, java
- Lĩnh vực
- cryptography, security
- Loại issue
- Tính năng
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Cần làm rõ
- Mức phù hợp với người mới
- 30/100