Comments (6)
I didn't generate the ciphertext, localstack did when it sends out the CustomEmailSender_SignUp trigger. You will have to setup a cognito user pool and then sign up a user using email address to trigger the event. I have tried kms decrypt command, see my ticket description, and it did not work. The only way for me to decrypt is locally with aws_encryption_sdk. So I feel it is localstack's bug somewhere....
from localstack.
>>> import base64
>>> import aws_encryption_sdk
>>> from aws_encryption_sdk.identifiers import CommitmentPolicy
>>> code = "AgV49DDIa0gmpF8ptVztr4W3tBIj40JM74jHpqBgszd+M04AXwABABVhd3MtY3J5cHRvLXB1YmxpYy1rZXkAREFnZ1p0REJ1SmpmUENRVjZieXpncjFLcm85cVAwV0RXQUptaDVEeG5Zb1NKMjNNcTRmMHFTTjVmQTJyalRsVno0Zz09AAEAB2F3cy1rbXMAS2Fybjphd3M6a21zOnVzLWVhc3QtMTowMDAwMDAwMDAwMDA6a2V5LzAwMDAwMDAwLTAwMDAtMDAwMC0wMDAwLTAwMDAwMDAwMDAwMQB0MDAwMDAwMDAtMDAwMC0wMDAwLTAwMDAtMDAwMDAwMDAwMDAxhXj8VVMS4crQ0L5paAbfKyr8brLnTVr4nDgEMZyS6SMcSffyHaLtd+AMq8q+IaZmXv3GOPmpm83WwpxtR7xeWyU7wEvYmdU93lUwnc9Rl4ACAAAQAHnzBnp4qzttuCBlvMngrINOCWqu4xj7/cuTlRvjitKd5WBEZAAQnV+FQ5DhNnwAr/////8AAAABAAAAAAAAAAAAAAABAAAABnrRUG8pwekPB+5tdS2Ez480PmaFECIAZzBlAjAJYWdGe/IOrUOoLY+swDhaEIdlu25kEH2MdR/Qf8gt0OabAYjmsV4n5JVBTSf4MsoCMQD1UcVGfR31O/582Iv86fNfKS55l/LIFobUOxoj+2itcmHsWf74ZYdww2pECq+H7ck="
>>> code_bytes = base64.b64decode(code)
>>> kms_key_provider = aws_encryption_sdk.StrictAwsKmsMasterKeyProvider(key_ids=["arn:aws:kms:us-east-1:000000000000:key/00000000-0000-0000-0000-000000000001"])
>>> client = aws_encryption_sdk.EncryptionSDKClient(commitment_policy=CommitmentPolicy.FORBID_ENCRYPT_ALLOW_DECRYPT)
>>> decrypt, header = client.decrypt(source=code_bytes, key_provider=kms_key_provider)
>>> decrypt
b'775115'
If I use aws_encryption_sdk to decode locally, then the code decrypts just fine. But if I use boto3 and send it to localstack to decrypt, then it fails!!!
from localstack.
I am also not sure why the client id of "CustomEmailSender_SignUp" event is "CLIENT_ID_NOT_APPLICABLE"
when sign up is performed, a client id is specified. other trigger event seems to have client_id value in them.
from localstack.
Hi @vt-rcheng, thanks for reporting the issue. Could you give us a few more details on how you generate the ciphertext in input? Have you tried to provide the key id to the awslocal kms decrypt
command? Thank you 🙏
from localstack.
Hi @vt-rcheng, I've been investigating the issue a bit. According to the official AWS docs, the AWS KMS Decrypt operation cannot decrypt the encrypted message the AWS Encryption SDK returns.
I was also able to verify this behavior in one of our test ran against AWS.
We released a small set of parity fixes in our latest
Docker image, based on what you reported. In particular:
- the ClientId in the event is now correctly reported;
- the event now also contains a bunch of data (e.g., user attributes) that were absent before.
Please let us know if you find any other issues 🙏
from localstack.
Hello 👋! It looks like this issue hasn’t been active in longer than two weeks. We encourage you to check if this is still an issue in the latest release. In the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment or upvote with a reaction on the initial post to prevent automatic closure. If the issue is already closed, please feel free to open a new one.
from localstack.
Related Issues (20)
- bug: LocalStack seems to break when downloading large files (~1.5GB, related to processing time?) HOT 11
- bug: Timeout issue while registring rotue from 000000000000.dkr.ecr.us-east-1.localhost:4566 to http://127.0.0.1:34951 HOT 4
- bug: S3 Presign URL returns incorrect URL (NoSuchBucket). HOT 9
- Could not use S3 when using `Virtual-hosted–style` HOT 3
- bug: SQS -> Lambda only trigger once a minute HOT 2
- bug: StepFunctions parallel states don't recognize "Parameters" field correctly.
- Unsupported stack parameter type: AWS::SSM::Parameter::Value<CommaDelimitedList> HOT 3
- bug: Invalid type for parameter stageDescription HOT 1
- bug: AttributeError: 'Role' object has no attribute 'partition' HOT 4
- feature request: Allow for mounting layers in subfolders of /opt HOT 1
- feature request: support ctx.stash for JS pipeline resolver HOT 1
- bug: ASLParserException on CreateStateMachine operation if 'Map' state contains 'Label' field HOT 1
- bug: localstack: command not found on Github Actions
- bug: CopyObject implementation breaks object when clearing out tags. HOT 1
- Using "old" version of DDB local HOT 1
- feature request: support AWS SAM serverless connectors (`AWS::Serverless::Connector`)
- bug: get-parameter and get-parameters on SSM does not work with ARNs (Localstack 3.5.0) HOT 2
- bug: tags added to parameter after creation do not work in describe parameter call HOT 1
- feature request: AssociateSoftwareToken VerifySoftwareToken support in Cognito HOT 1
- bug: Lambda client context not passed to function
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from localstack.