aws / aws/aws-encryption-sdk-python
Encrypt throws incorrect error when a CMK within KMSMasterKeyProvider is disabled
- 主要語言
- Python
- 星號
- 255
- 分支
- 92
- 平均合併
- 2 天 17 小時
- 30 天內合併 PR
- 2
描述
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
```
貢獻指南
研究方向
首先,使用 KMSMasterKeyProvider 範例和已停用或刪除的 CMK 重現 encrypt 呼叫。追蹤 DisabledException 如何變成 EncryptKeyError,接著新增或更新覆蓋測試,讓加密針對受影響的 CMK 回報適當的錯誤,而不是顯示的兩個錯誤。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- aws, python
- 領域
- cloud, cryptography, security
- Issue 類型
- 缺陷
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 活躍度
- 停滯
- 描述清晰度
- 基本清楚
- 新手友好度
- 42/100