aws / aws/aws-encryption-sdk-python

Preferential order of decryption

Đang mở
#226 4 bình luận 1 reaction 0 người được giao Xem trên GitHub
requires followup
Ngôn ngữ chính
Python
Star
255
Fork
92
Merge trung bình
2 ngày 17 giờ
Pull request đã merge (30 ngày)
2

Mô tả

Hi amazing crypto heroes of AWS!

We are using the library to encrypt our sensitive settings in our project (passwords, API keys etc). We encrypt with two keys, one is a "development-key" and the other is the "production-key". When we decrypt in production, we would like the SDK to not use the development key, however it tries both and always fails the decrypt on the development key. I know we can set up a KmsKeyProvider to only have the ARN of the production key, but that would make our code a lot messier (having to pass it from a dynamic environment variable etc).

Is there a way to set the order of which keys will be used to decrypt when encrypting? Such to say when we encrypt we will use keys "production-key" and then "development-key". During decryption the SDK will try the first and only if it fails will go onto the second. The failure of trying to use the development key in production is taking IO and impacting our Lambda cold start times.

I feel like this feature should already be supported and maybe I am just not able to figure it out. I see that the SDK gives preferences to keys that are in the same region, but both keys are in the same region in my case 🤕

Any insight or help would be greatly appreciated!

Stay awesome and stay safe,
Mo Kamioner

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu bằng cách xem xét KmsKeyProvider và hành vi hiện có của SDK đối với việc chọn khóa và giải mã, bao gồm cả việc ưu tiên cùng khu vực. Xác định thứ tự ưu tiên khóa production rõ ràng sẽ tương tác với việc mã hóa và giải mã như thế nào, sau đó xác thực hành vi bằng kịch bản hai khóa đã được báo cáo và tác động của kịch bản đó đến Lambda cold start.

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, python
Lĩnh vực
cloud, 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
Khá rõ ràng
Mức phù hợp với người mới
28/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.