aws / aws/aws-encryption-sdk-python

Encrypt throws incorrect error when a CMK within KMSMasterKeyProvider is disabled

Đang mở
#142 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
good first issue
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ả

If a CMK is disabled/deleted within KMSMasterKeyProvider CMKs, the encrypt call throws a couple of errors (below).

> botocore.errorfactory.DisabledException: An error occurred (DisabledException) when calling the Encrypt operation: arn:aws:kms:eu-west-2:xxxxxxx

> aws_encryption_sdk.exceptions.EncryptKeyError: Master Key arn:aws:kms:eu-west-2

```
import aws_encryption_sdk

kms_key_provider = aws_encryption_sdk.KMSMasterKeyProvider(key_ids=[
'arn:aws:kms:us-east-1:2222222222222:key/22222222-2222-2222-2222-222222222222',
'arn:aws:kms:us-east-1:3333333333333:key/33333333-3333-3333-3333-333333333333'
])
my_plaintext = b'This is some super secret data! Yup, sure is!'

my_ciphertext, encryptor_header = aws_encryption_sdk.encrypt(
source=my_plaintext,
key_provider=kms_key_provider,
encryption_context={
'not really': 'a secret',
'but adds': 'some authentication'
}
)

decrypted_plaintext, decryptor_header = aws_encryption_sdk.decrypt(
source=my_ciphertext,
key_provider=kms_key_provider
)

assert my_plaintext == decrypted_plaintext
assert encryptor_header.encryption_context == decryptor_header.encryption_context
```

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 tái hiện lệnh gọi encrypt với ví dụ KMSMasterKeyProvider và một CMK bị vô hiệu hóa hoặc đã bị xóa. Theo dõi cách DisabledException trở thành EncryptKeyError, sau đó thêm hoặc cập nhật coverage để quá trình mã hóa báo cáo lỗi thích hợp cho CMK bị ảnh hưởng thay vì hai lỗi được hiển thị.

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
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
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
42/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.