Git Product home page Git Product logo

aws-ssm-session's People

Contributors

bertrandmartel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

aws-ssm-session's Issues

Node/ECS - Can initially connect but then no responses to commands

Hi, I'm trying to get this working on Node with ECS tasks, and while I can connect to the container, I don't get any response back when I try to execute any commands.

I was trying with the examples, I updated line 3 in app.js from const session = require("../../scripts/aws-get-session"); to const session = require("../../scripts/aws-get-session-ecs");,

It works with EC2 instances.

image image

Add KMS support

When SSM is protected with KMS, the payload fails to send/receive data.

See https://github.com/aws/session-manager-plugin/blob/mainline/src/datachannel/streaming.go:

// Encrypt if encryption is enabled and payload type is Output
if dataChannel.encryptionEnabled && payloadType == message.Output {
	inputData, err = dataChannel.encryption.Encrypt(log, inputData)
	if err != nil {
		return err
	}
}
case message.KMSEncryption:
	processedAction.ActionType = action.ActionType
	err := dataChannel.ProcessKMSEncryptionHandshakeAction(log, action.ActionParameters)
	if err != nil {
		processedAction.ActionStatus = message.Failed
		processedAction.Error = fmt.Sprintf("Failed to process action %s: %s",
			message.KMSEncryption, err)
		errorList = append(errorList, err)
	} else {
		processedAction.ActionStatus = message.Success
		processedAction.ActionResult = message.KMSEncryptionResponse{
			KMSCipherTextKey: dataChannel.encryption.GetEncryptedDataKey(),
		}
		dataChannel.encryptionEnabled = true
	}

Unable to use with ECS tasks

I’m not sure if this is really a bug with aws-ssm-session, but I wanted to get your thoughts.

I’ve tested this project against SSM agents running on instances, and that works fine.

Recently, AWS added SSM support for ECS tasks. Using the AWS CLI, you can connect to them just fine, as they too leverage an SSM agent.

You can request the WSS URL and token via this endpoint: https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/ECS.html#executeCommand-property

However, using aws-ssm-session, I’m unable to connect to an ECS task. I’ve tried via the web client and the node script. I can connect to these tasks just fine though, when using the AWS CLI command: https://aws.amazon.com/blogs/containers/new-using-amazon-ecs-exec-access-your-containers-fargate-ec2/

Do you think this is something that could be added / supported to aws-ssm-session, or do you think this is a bug on the AWS side of things?

Supporting paste

Hello, I'm following the nodejs example in the example dir but am having some issues supported pasted text. It seems to append tilde's (~) around the pasted content (and only when setting the stdin into raw mode, without it I seem to be getting the control characters).

eg. irb(main):001:0> ^[[200~www.sephora.sg^[[201~

Is there any way to fix that?

Node example doesn't run

There are syntax errors in the nodejs section of the README. The websocket is named connection in the outer context but the callbacks use the name socket.

funky terminal formatting

Running into some funky terminal outputs when using this repo. I essentially have the same setup as the source code, but when running commands like ls, I get ordering problems, and missing characters like below. Is this a known issue and are there potential work around?

Screen Shot 2022-12-07 at 2 04 06 AM

Provide callback when prompt is ready

Hi, thanks for creating this library!

I have a use case where I connect to an EC2 instance via SSM, but then want to execute an SSH command to tunnel (I cannot use the native SSM tunnel). The problem I have is I do not know when the prompt is ready for the SSH command, so don't know when to run it. I currently have a setTimeout on connection.onopen but it won't work all the time.

Would it be possible to have some callback?

Thanks

Node example doesn't work, handshake timeout

I get this error when running the Node example:

{"MessageId":"e61ab986-c9c4-4b9c-a557-0c7fe13ee4c5","CreatedDate":"2021-10-01T09:24:34.917Z","DestinationId":"9eb2aa6d-936c-44a9-80aa-2c163fd558d8","SessionId":"xxxxxxxxxxxx-00326d985ae62b3af","MessageType":"channel_closed","SchemaVersion":1,"Output":"\n----------ERROR-------\nEncountered error while initiating handshake. Handshake timed out. Please ensure that you have the latest version of the session manager plugin."}

I've updated the session manager plugin to the latest and the issue is the same.

Terminal stopped working when connecting to rails terminal

Hello! Awesome project!

I made it running locally and it's working fine.

But, after running rails c, I enter into the rails terminal and when I send a command, I don't get any response back. I added logs to check if the command is send it, and it's. The connection is still opened, but nothing.

I'm working if it's related to message number sequence or something.

After each command I send I get payloadType=0

Any ideas? @bertrandmartel

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.