{ "info": { "author": "Michael Ludvig", "author_email": "mludvig@logix.net.nz", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Console", "Intended Audience :: System Administrators", "License :: OSI Approved :: Apache Software License", "Operating System :: POSIX :: Linux", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3 :: Only", "Topic :: System :: Networking", "Topic :: System :: Systems Administration" ], "description": "# aws-ssm-tools - AWS System Manager Tools\n\n[![CircleCI](https://circleci.com/gh/mludvig/aws-ssm-tools.svg?style=shield)](https://circleci.com/gh/mludvig/aws-ssm-tools)\n[![PyPI](https://img.shields.io/pypi/v/aws-ssm-tools.svg)](https://pypi.org/project/aws-ssm-tools/)\n[![Python Versions](https://img.shields.io/pypi/pyversions/aws-ssm-tools.svg)](https://pypi.org/project/aws-ssm-tools/)\n\nHelper tools for AWS Systems Manager: `ssm-session`, `ssm-copy` and\n`ssm-tunnel`.\n\n## Scripts included\n\n* **ssm-session**\n\n Wrapper around `aws ssm start-session` that can open\n \u00a0SSM Session to an instance specified by *Name* or *IP Address*.\n\n Check out *[SSM Sessions the easy\n way](https://aws.nz/projects/ssm-session/)* for an example use.\n\n Works with any Linux or Windows EC2 instance registered in SSM.\n\n* **ssm-copy**\n\n Copy files to/from EC2 instances over *SSM Session* without the need to have a\n direct SSH access.\n\n Works with *Linux* instances only, however *no* remote agent is required. All\n that is needed is a shell and standard linux tools like `base64` (yes, we are\n transferring the files base64-encoded as *SSM Sessions* won't pass through\n binary data).\n\n Only *copy to instance* is implemented at the moment. *Copy from* is on my todo\n list :)\n\n* **ssm-tunnel**\n\n Open *IP tunnel* to the SSM instance and to enable *network access*\n to the instance VPC. This requires [ssm-tunnel-agent](README-agent.md)\n installed on the instance.\n\n Works with *Amazon Linux 2* instances and probably other recent Linux systems.\n\n Requires `ssm-tunnel-agent` installed on the instance - see below for\n instructions.\n\n## Usage\n\n1. **List instances** available for connection\n\n ```\n ~ $ ssm-session --list\n i-07c189021bc56e042 test1.aws.nz test1 192.168.45.158\n i-094df06d3633f3267 tunnel-test.aws.nz tunnel-test 192.168.44.95\n i-02689d593e17f2b75 winbox.aws.nz winbox 192.168.45.5 13.11.22.33\n ```\n\n2. **Copy a file** to an instance:\n\n ```\n ~ $ ssm-copy large-file test1:\n large-file - 1087kB, 27.6s, 39.4kB/s, [SHA1 OK]\n ```\n\n3. **Open SSM session** to an instance:\n\n ```\n ~ $ ssm-session -v test1\n Starting session with SessionId: botocore-session-0d381a3ef740153ac\n sh-4.2$ hostname\n test1.aws.nz\n\n sh-4.2$ cd\n sh-4.2$ ls -l\n total 1088\n -rw-r--r-- 1 ssm-user ssm-user 1113504 Jun 20 02:07 large-file\n\n sh-4.2$ exit\n Exiting session with sessionId: botocore-session-0d381a3ef740153ac.\n ~ $\n ```\n\n4. **Create IP tunnel** and SSH to another instance in the VPC through it.\n\n We'll use `--route 192.168.44.0/23` that gives us access to the VPC CIDR.\n\n ```\n $ ssm-tunnel -v tunnel-test --route 192.168.44.0/23\n [ssm-tunnel] INFO: Local IP: 100.64.160.100 / Remote IP: 100.64.160.101\n 00:00:15 | In: 156.0 B @ 5.2 B/s | Out: 509.0 B @ 40.4 B/s\n ```\n\n Leave it running and from another shell `ssh` to one of the instances listed\n with `--list` above. For example to `test1` that's got VPC IP `192.168.45.158`:\n\n ```\n ~ $ ssh ec2-user@192.168.45.158\n Last login: Tue Jun 18 20:50:59 2019 from 100.64.142.232\n ...\n [ec2-user@test1 ~]$ w -i\n 21:20:43 up 1:43, 1 user, load average: 0.00, 0.00, 0.00\n USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT\n ec2-user pts/0 192.168.44.95 21:20 3.00s 0.02s 0.00s w -i\n ^^^^^^^^^^^^^\n [ec2-user@test1 ~]$ exit\n Connection to 192.168.45.158 closed.\n ~ $\n ```\n\n Note the source IP `192.168.44.95` that belongs to the `tunnel-test`\n instance - our connections will *appear* as if they come from this instance.\n Obviously the **Security Groups** of your other instances must allow SSH\n access from the IP or SG of your tunnelling instance.\n\nAll the tools support `--help` and a set of common parameters:\n\n --profile PROFILE, -p PROFILE\n Configuration profile from ~/.aws/{credentials,config}\n --region REGION, -g REGION\n Set / override AWS region.\n --verbose, -v Increase log level\n --debug, -d Increase log level\n\nThey also support the standard AWS environment variables like `AWS_DEFAULT_PROFILE`,\n`AWS_DEFAULT_REGION`, etc.\n\n## Installation\n\nAll the tools use **AWS CLI** to open **SSM Session** and then use that\nsession to run commands on the target instance. The target instances must be\nregistered in SSM.\n\n### Install *AWS CLI* and `session-manager-plugin`\n\nMake sure you've got `aws` and `session-manager-plugin` installed locally\non your laptop.\n\n```\n~ $ aws --version\naws-cli/1.16.175 Python/3.6.8 Linux/4.15.0-51-generic botocore/1.12.165\n\n~ $ session-manager-plugin --version\n1.1.17.0\n```\n\nFollow [AWS CLI installation\nguide](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html)\nand [session-manager-plugin\ninstallation guide](https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-install-plugin.html) to install them if needed.\n\n### Register your instances with Systems Manager\n\n*Amazon Linux 2* instances already have the `amazon-ssm-agent` installed and\nrunning. All they need to register with *Systems Manager* is\n**AmazonEC2RoleforSSM** managed role in their *IAM Instance Role* and network\naccess to `ssm.{region}.amazonaws.com` either directly or through a *https proxy*.\n\n### Install SSM-Tools *(finally! :)*\n\nThe easiest way is to install the ssm-tools from *[PyPI](https://pypi.org/)* repository:\n\n```\nsudo pip3 install aws-ssm-tools\n```\n\n**NOTE:** SSM Tools require **Python 3.6 or newer**. Only the `ssm-tunnel-agent`\nrequires **Python 2.7 or newer** as that's what's available by default\non *Amazon Linux 2* instances.\n\n### Standalone *ssm-tunnel-agent* installation\n\nRefer to *[README-agent.md](README-agent.md)* for `ssm-tunnel-agent`\ninstallation details.\n\nAlternatively it's also bundled with this package, you can take it from here and\ncopy to `/usr/local/bin/ssm-tunnel-agent` on the instance. Make it executable\nand it should just work.\n\n## Other AWS Utilities\n\nCheck out **[AWS Utils](https://github.com/mludvig/aws-utils)**\nrepository for more useful AWS tools.\n\n## Author and License\n\nAll these scripts were written by [Michael Ludvig](https://aws.nz/)\nand are released under [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0).\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/mludvig/aws-ssm-tools", "keywords": "aws ssm ssm-session ssm-copy ssm-tunnel ssm-tunnel-updown.dns-example", "license": "Apache License 2.0", "maintainer": "", "maintainer_email": "", "name": "aws-ssm-tools", "package_url": "https://pypi.org/project/aws-ssm-tools/", "platform": "", "project_url": "https://pypi.org/project/aws-ssm-tools/", "project_urls": { "Bug Tracker": "https://github.com/mludvig/aws-ssm-tools/issues", "Documentation": "https://github.com/mludvig/aws-ssm-tools/blob/master/README.md", "Homepage": "https://github.com/mludvig/aws-ssm-tools", "Source Code": "https://github.com/mludvig/aws-ssm-tools" }, "release_url": "https://pypi.org/project/aws-ssm-tools/0.9.6/", "requires_dist": [ "pexpect", "botocore", "boto3" ], "requires_python": ">=3.6", "summary": "Tools for AWS Systems Manager: ssm-session ssm-copy ssm-tunnel ssm-tunnel-updown.dns-example", "version": "0.9.6" }, "last_serial": 5539215, "releases": { "0.9.2": [ { "comment_text": "", "digests": { "md5": "a1f2f49a1f06901581d15d2a27fc4afe", "sha256": "73d1baf36441d57d963092ef111889fb7dea05fdb3aa195e5917e4fa9693c540" }, "downloads": -1, "filename": "aws_ssm_tools-0.9.2-py3-none-any.whl", "has_sig": false, "md5_digest": "a1f2f49a1f06901581d15d2a27fc4afe", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 15238, "upload_time": "2019-06-19T08:13:39", "url": "https://files.pythonhosted.org/packages/be/d8/166a2e3e9769d64d55604b319d817671b6bb8272c51791009dbe216e2705/aws_ssm_tools-0.9.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "59910da6d97f7990f3e23a4af389dd1a", "sha256": "3e3aa5865ffd07c5cd3de6826d6478164e9fe1a979bfd27f879c1e76e17dbf9c" }, "downloads": -1, "filename": "aws-ssm-tools-0.9.2.tar.gz", "has_sig": false, "md5_digest": "59910da6d97f7990f3e23a4af389dd1a", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 10939, "upload_time": "2019-06-19T08:13:44", "url": "https://files.pythonhosted.org/packages/72/2a/4d363c4f4e7883e81e621ee3add3e17161dda1b7821fcd9cef634e8461c0/aws-ssm-tools-0.9.2.tar.gz" } ], "0.9.3": [ { "comment_text": "", "digests": { "md5": "db5002171663fe38f9b792428c145f39", "sha256": "5130b230702558d100a6886a4930cd87f56970fa2b9774763662c4b6cc3a4b65" }, "downloads": -1, "filename": "aws_ssm_tools-0.9.3-py3-none-any.whl", "has_sig": false, "md5_digest": "db5002171663fe38f9b792428c145f39", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 17282, "upload_time": "2019-06-20T02:56:32", "url": "https://files.pythonhosted.org/packages/41/26/37c11a8fb88b5cc77b0b0dd85787d943611a7671ddea81e850d09d01f3c0/aws_ssm_tools-0.9.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6ed13ded69a805fb3cb92ece886f7e89", "sha256": "b6210a22f38bbdd3a03d63d80be8b0e54a401f9c1e76f7061b9108b676e84ffe" }, "downloads": -1, "filename": "aws-ssm-tools-0.9.3.tar.gz", "has_sig": false, "md5_digest": "6ed13ded69a805fb3cb92ece886f7e89", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 13298, "upload_time": "2019-06-20T02:56:35", "url": "https://files.pythonhosted.org/packages/db/fa/178dbf8979a30d43f4f42ae60ccf533ab354423e4231897ef145cd8b0246/aws-ssm-tools-0.9.3.tar.gz" } ], "0.9.4": [ { "comment_text": "", "digests": { "md5": "365e205a7d46fde77615832cd7865aa9", "sha256": "05cd38ef97d2612178a1b3eb752368fb358b965a361531fba58ebfbe7ad1eff1" }, "downloads": -1, "filename": "aws_ssm_tools-0.9.4-py3-none-any.whl", "has_sig": false, "md5_digest": "365e205a7d46fde77615832cd7865aa9", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 17620, "upload_time": "2019-06-26T23:51:34", "url": "https://files.pythonhosted.org/packages/58/d3/a9291fb92b2fdbb1c89385c1c4553238beb8da12765b2e97439977c2733e/aws_ssm_tools-0.9.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9c575547d32e3d17be8e8fc1b3880426", "sha256": "edc55554c5eac1a4b4dbe1a62842ef7aec3fa8ba8e7751469dc9ed302df1b307" }, "downloads": -1, "filename": "aws-ssm-tools-0.9.4.tar.gz", "has_sig": false, "md5_digest": "9c575547d32e3d17be8e8fc1b3880426", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 14750, "upload_time": "2019-06-26T23:51:36", "url": "https://files.pythonhosted.org/packages/40/0f/e7deb9e93043ec02fac031df688d5edbf47f32bf151ef2adc1d844120178/aws-ssm-tools-0.9.4.tar.gz" } ], "0.9.5": [ { "comment_text": "", "digests": { "md5": "fe2f812a8b33f3d26a83d37c2fa7eae1", "sha256": "a917d86e213be8612f48eca1ca22c693a412e92d6f469bb48a475cb2415d371e" }, "downloads": -1, "filename": "aws_ssm_tools-0.9.5-py3-none-any.whl", "has_sig": false, "md5_digest": "fe2f812a8b33f3d26a83d37c2fa7eae1", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 17655, "upload_time": "2019-07-10T10:17:01", "url": "https://files.pythonhosted.org/packages/b4/03/8c6a2655d0cbc2ffd4485f645524c7b24a6940b856f85af2bed67b1e9f9a/aws_ssm_tools-0.9.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c13f49be0abf8d8ee297d3a1f7405fb3", "sha256": "743a74578d1af6fca1056083ed0ae6f3b88589c7e09dbd0cb26b9eee43463cc6" }, "downloads": -1, "filename": "aws-ssm-tools-0.9.5.tar.gz", "has_sig": false, "md5_digest": "c13f49be0abf8d8ee297d3a1f7405fb3", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 15141, "upload_time": "2019-07-10T10:17:03", "url": "https://files.pythonhosted.org/packages/c7/32/8198a8292840bd3c97731c91ba2192b01cd1de150966ea0e7abd44b6cbd8/aws-ssm-tools-0.9.5.tar.gz" } ], "0.9.6": [ { "comment_text": "", "digests": { "md5": "84e5d7a7fb91d38c67b2bf326dec3b2e", "sha256": "31badd0f79d696156f5127b43f884709a4389ace45d11ad4b13aad41725460c8" }, "downloads": -1, "filename": "aws_ssm_tools-0.9.6-py3-none-any.whl", "has_sig": false, "md5_digest": "84e5d7a7fb91d38c67b2bf326dec3b2e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 18946, "upload_time": "2019-07-16T08:32:48", "url": "https://files.pythonhosted.org/packages/a6/b7/68f578b6bc83ac3b7b7652490f6c18a3d249bb64e7a3423887a318493af0/aws_ssm_tools-0.9.6-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "079ba63417bfd7ed00bc52d6fe675bf6", "sha256": "c1da55384361e11cd6e5780aebc9d1ed640ff0b01ab62aa11cd8637d3970c3e1" }, "downloads": -1, "filename": "aws-ssm-tools-0.9.6.tar.gz", "has_sig": false, "md5_digest": "079ba63417bfd7ed00bc52d6fe675bf6", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 15754, "upload_time": "2019-07-16T08:32:50", "url": "https://files.pythonhosted.org/packages/b6/53/d467a182c3687bdcf096e733e48cb85d1a86c8c6569e9b85d67e5bcc8dec/aws-ssm-tools-0.9.6.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "84e5d7a7fb91d38c67b2bf326dec3b2e", "sha256": "31badd0f79d696156f5127b43f884709a4389ace45d11ad4b13aad41725460c8" }, "downloads": -1, "filename": "aws_ssm_tools-0.9.6-py3-none-any.whl", "has_sig": false, "md5_digest": "84e5d7a7fb91d38c67b2bf326dec3b2e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 18946, "upload_time": "2019-07-16T08:32:48", "url": "https://files.pythonhosted.org/packages/a6/b7/68f578b6bc83ac3b7b7652490f6c18a3d249bb64e7a3423887a318493af0/aws_ssm_tools-0.9.6-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "079ba63417bfd7ed00bc52d6fe675bf6", "sha256": "c1da55384361e11cd6e5780aebc9d1ed640ff0b01ab62aa11cd8637d3970c3e1" }, "downloads": -1, "filename": "aws-ssm-tools-0.9.6.tar.gz", "has_sig": false, "md5_digest": "079ba63417bfd7ed00bc52d6fe675bf6", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 15754, "upload_time": "2019-07-16T08:32:50", "url": "https://files.pythonhosted.org/packages/b6/53/d467a182c3687bdcf096e733e48cb85d1a86c8c6569e9b85d67e5bcc8dec/aws-ssm-tools-0.9.6.tar.gz" } ] }