-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for handshake and KMS challenge #14
base: master
Are you sure you want to change the base?
Conversation
I've tested the code and it works fine with the above documentation. @bertrandmartel Can you please merge this PR? |
@ToshipSo , I tried here and the 'slice' function seems not working from my side. Is there any tip how to solve it? |
. I can confirm the code still works like a charm! `export function transformBlobIntoUInt8Array (blob) {
}` |
Hey @sergiosilvajr - yes In most implementations you will still need to check the handshake request (5) for the Also the |
Hi, @rupertbg , I am using the KMSEncryption described on this pr and it worked. At this moment I am doing some tests with the websocket using KMSEncryption but the handshaking fails when I have 2 or more users trying to use the interface with websockets to a ssm node at the same time. Any tips on how solve it? |
@sergiosilvajr I'm not entirely sure off the top of my head but it sounds like potentially an issue with the |
does anybody know what happened w @bertrandmartel ? |
Not sure, but you could always use my fork or make a new fork if you want to fix a bug or add new features. |
This adds support for handling the handshake that runs when using SSM Session Manager or ECS Exec with KMS Encryption enabled.
Handling the encryption / decryption I've left out of scope but it looks something like this:
Handle RequestedClientActions where the KMSKeyId to use is supplied and respond to the handshake
You will need credentials for AWS KMS at this stage, so you can generate a data key
SSM requires you to request a 512 bit key from KMS, provide the ciphertext to the Agent via the handshake response, and then split the key into two 256 bit keys and use one for encrypt and one for decrypt (the agent at the other end does the same but in reverse.)
Handle the KMS challenge request payload by decrypting and re-encrypting a challenge value that is sent from the agent.
And don't forget to decrypt / encrypt data that you send and receive after that
Decrypt:
Encrypt: