aws / aws/aws-encryption-sdk-python
Encrypt throws incorrect error when a CMK within KMSMasterKeyProvider is disabled
- 主要言語
- Python
- スター
- 255
- フォーク
- 92
- 平均マージ
- 2日 17時間
- マージ済み PR(30日)
- 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 になる過程を追跡し、その後、暗号化が表示されている 2 つのエラーではなく、影響を受けた CMK に対する適切なエラーを報告するように、カバレッジを追加または更新します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- aws, python
- 領域
- cloud, cryptography, security
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 42/100