Closed coughlinj closed 9 months ago
This is not a bug.
I was querying for PlainText, when the returned value was actually just Plaintext. Closing this.
"KeyId": "arn:aws:kms:us-east-1:ACCOUNT-ID:key/s8f7g9d8f-5bc0-4688-a736-dfgdfgb34534",
"Plaintext": SDFG345345345DFGSDFGSDF345t345=!",
"EncryptionAlgorithm": "SYMMETRIC_DEFAULT"
}
aws kms decrypt --key-id s8f7g9d8f-5bc0-4688-a736-dfgdfgb34534 --region us-east-1 --ciphertext-blob "CIPHER-TEXT-BLOB-GOES-HERE" --output text --query Plaintext
Will return the bare value of the Plaintext value.
SDFG345345345DFGSDFGSDF345t345=!
Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.
Describe the bug
Using the latest aws-cli for either linux or powershell to run an kms decrypt operation returns the error, both below. Account ID was removed.
command run
aws kms decrypt --key-id arn:aws:kms:us-east-1:ACCOUNT_ID:key/a133aef3-5bc0-4688-a736-aeccc16269da --region us-east-1 --ciphertext-blob fileb://test-blob.txt --output text --query PlainText
test-blob.txt ciphertext-blob file content note: this ciphertext was generated using the same key
AQIDAHgDuV/LD1GSnzHSF2yVlkqbDHAvWMzOtAY5agXQHypfxQF+VDEvZ+n2FbjvukSIV2qWAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMiKhXugcoiog8+Nu8AgEQgDv2mqb6ChUKQ6monDPPIqHZBb3fXqNV3F7WDB3F68RHnQHzlGSJr/KOceuLfw9QRWrE5QUBTUzB/dmYGQ==
only output returned when not running debug
An error occurred (InvalidCiphertextException) when calling the Decrypt operation:
Expected Behavior
It should return a decrypted value in plaintext.
Current Behavior
Reproduction Steps
In this instance, a KMS key is being used to backup a TDE certificate and private key pair to S3 from an RDS MSSQL server, and as part of that, copying the metadata of the exported private key's x-amz-meta-rds-tde-pwd value and attempting to decrypt it.
Possible Solution
No response
Additional Information/Context
No response
CLI version used
win 10 aws-cli/2.15.12 Python/3.11.6 Windows/10 exe/AMD64 prompt/off
alpine linux on wsl aws-cli/1.32.24 Python/3.9.16 Linux/4.4.0-19041-Microsoft botocore/1.34.24
Environment details (OS name and version, etc.)
Windows 10 Alpine Linux on WSL