{ "info": { "author": "Michael Morris", "author_email": "mmmorris1975@netscape.net", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "Intended Audience :: System Administrators", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3" ], "description": "=========\nAWS RUNAS\n=========\n\nA command to provide a friendly way to do an AWS STS AssumeRole operation so you can perform AWS API actions\nusing a particular set of permissions. Includes integration with roles requiring MFA authentication! Works\noff of profile names configured in the AWS SDK configuration file.\n\nThis tool initially performs an AWS STS GetSessionToken call to handle MFA credentials, and caches the session\ncredentials, then makes the AssumeRole call. This allows us to not have to re-enter the MFA information (if required)\nevery time AssumeRole is called (or when the AssumeRole credentials expire), only when new Session Tokens are requested\n(by default 12 hours). Unlike older versions of this program, the cached credentials are not compatible with awscli,\nbut you should be able to use aws-runas to wrap awscli commands using an assumed role without needing to input MFA info\nevery time.\n\nSee the following for more information on AWS SDK configuration files:\n\n- http://docs.aws.amazon.com/cli/latest/userguide/cli-config-files.html\n- https://boto3.readthedocs.io/en/latest/guide/quickstart.html#configuration\n- https://boto3.readthedocs.io/en/latest/guide/configuration.html#aws-config-file\n\nRequirements\n============\n\n- Tested on python 2.7 and python 3\n- boto3 python library, version 1.3.1 or higher\n\nInstallation\n============\n\nUsing `pip` is the preferred method to install this tool, and will install the package from pypi. `pip install aws-runas`\n\nIt can also be installed via `pip` from a local copy of the source repo, `pip install .` from the repo directory should do the trick.\nRunning `make install` should also work as well.\n\nConfiguration\n=============\n\nTo configure a profile in the .aws/config file for using AssumeRole, make sure the `source_profile` and `role_arn` attributes are\nset for the profile. The `role_arn` attribute will determine which role will be assumed for that profile. The `source_profile`\nattribute specifies the name of the profile which will be used to perform the GetSessionToken operation.\n\nIf the `mfa_serial` attribute is present in the profile configuration, That MFA device will be used when requesting or refreshing\nthe session token.\n\nExample:\n\n| [profile admin]\n| source_profile = default\n| role_arn = arn:aws:iam::987654321098:role/admin_role\n| mfa_serial = arn:aws:iam::123456789098:mfa/iam_user\n\nUsage\n=====\n| usage: aws-runas [-h] [-l] [-m] [-e] [-s] [-r] [-v] [-V] [profile] ...\n|\n| Create an environment for interacting with the AWS API using an assumed role\n|\n| positional arguments:\n| profile name of profile\n| cmd command to execute using configured profile\n|\n| optional arguments:\n| -h, --help show this help message and exit\n| -l, --list-roles list role ARNs you are able to assume\n| -m, --list-mfa list the ARN of the MFA device associated with the account\n| -e, --expiration Show token expiration time\n| -s, --session print eval()-able session token info\n| -r, --refresh force a refresh of the cached credentials\n| -v, --verbose print verbose/debug messages\n| -V, --version print program version and exit\n\nListing available roles\n-----------------------\n\nUse the `-l` option to see the list of role ARNs your IAM account is authorized to assume.\nMay be helpful for setting up your AWS config file. If `profile` arg is specified, list\nroles available for the given profile, or the default profile if not specified. May be\nuseful if you have multiple profiles configured each with their own IAM role configurations\n\nListing available MFA devices\n-----------------------------\n\nUse the `-m` option to list the ARNs of any MFA devices associated with your IAM account.\nMay be helpful for setting up your AWS config file. If `profile` arg is specified, list\nMFA devices available for the given profile, or the default profile if not specified. May\nbe useful if you have multiple profiles configured each with their own MFA device\n\nDisplaying session token expiration\n-----------------------------------\n\nUse the `-e` option to display the date and time which the session token will expire. If\n`profile` arg is specified, display info for the given profile, otherwise use the 'default'\nprofile. Specifying the profile name may be useful if you have multiple profiles configured\nwhich you get session tokens for.\n\nInjecting SessionToken credentials into the environment\n-------------------------------------------------------\n\nUse the `-s` option to output and eval()-able set of environment variables for the session\ntoken credentials. If `profile` arg is specified, display the session token credentials for\nthe given profile, otherwise use the `default` profile.\n\nExample:\n\n| $ aws-runas -s\n| export AWS_ACCESS_KEY_ID='xxxxxx'\n| export AWS_SECRET_ACCESS_KEY='yyyyyy'\n| export AWS_SESSION_TOKEN='zzzzz'\n\nOr simply `eval $(aws-runas -s)` to add these env vars to the running environment. Since\nsession tokens generally live for multiple hours, injecting these credentials into the\nenvironment may be useful when using tools which can do AssumeRole on their own, and manage/refresh\nthe relativly short-lived AssumeRole credentials internally.\n\nInjecting AssumeRole credentials into the environment\n-----------------------------------------------------\n\nRunning the program with only a profile name will output an eval()-able set of environment\nvariables for the assumed role credentials which can be added to the current session.\n\nExample:\n\n| $ aws-runas admin-profile\n| export AWS_ACCESS_KEY_ID='xxxxxx'\n| export AWS_SECRET_ACCESS_KEY='yyyyyy'\n| export AWS_SESSION_TOKEN='zzzzz'\n\n\nOr simply `eval $(aws-runas admin-profile)` to add these env vars in the current session.\nWith the addition of caching session token credentials, and the ability to automatically\nrefresh the credentials, eval-ing this output for assumed role credentials is no longer\nnecessary for most cases, but will be left as a feature of this tool for the foreseeable future.\n\nRunning command using a profile\n-------------------------------\n\nRunning the program specifying a profile name and command will execute the command using the\nprofile credentials, automatically performing any configured assumeRole operation, or MFA token\ngathering.\n\nExample (run the command `aws s3 ls` using the profile `admin-profile`):\n\n| $ aws-runas admin-profile aws s3 ls\n| ... ...\n\nRunning command using the default profile\n-----------------------------------------\n\nRunning the program using the default profile is no different than using a custom profile,\nsimply use `default` as the profile name.\n\nContributing\n============\n\nThe usual github model for forking the repo and creating a pull request is the preferred way to\ncontribute to this tool. Bug fixes, enhancements, doc updates, translations are always welcomed.\n\nBuilding from source\n--------------------\n\nA `Makefile` has been included in the repository to handle the steps of creating the package and\nuploading it to pypi. If you don't have the `make` utility installed, the contents of the Makefile\nshould be instructive (and simple) enough to execute manually.\n\nThe following targets are available in the Makefile:\n\n* `package` - the default target, calls the setup.py script to create the package to upload to pypi.\n* `upload` - depends on the `package` target, and uploads the generated package archive to pypi.\n* `install` - use `pip` to install the package locally\n* `clean` - clean up the artifacts left by the `package` step.\n* `distclean` - depends on the `clean` target, and additionally cleans up misc. files.\n\n\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/mmmorris1975/aws-runas", "keywords": "aws runas iam role", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "aws-runas", "package_url": "https://pypi.org/project/aws-runas/", "platform": "", "project_url": "https://pypi.org/project/aws-runas/", "project_urls": { "Homepage": "https://github.com/mmmorris1975/aws-runas" }, "release_url": "https://pypi.org/project/aws-runas/0.2.0/", "requires_dist": [ "boto3 (>=1.3.1)" ], "requires_python": ">=2.7, <4", "summary": "Execute a command using an AWS assumed role", "version": "0.2.0" }, "last_serial": 3197664, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "b4abdc6f8466b265446d0b80d2f4f798", "sha256": "3bf0f35dcab6bd1576d480518332f44303235ef87a9ef32caa8b80c3460f54df" }, "downloads": -1, "filename": "aws_runas-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "b4abdc6f8466b265446d0b80d2f4f798", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7, <4", "size": 7438, "upload_time": "2017-08-03T02:01:36", "url": "https://files.pythonhosted.org/packages/73/63/3710a566e424297934e75cd720e156522d0185775cd1587cd708cecb7f68/aws_runas-0.1.0-py2.py3-none-any.whl" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "2ba88d54a8a25c69e91194364a236b6d", "sha256": "d64796cac020e3a31dac84945749bdf5d53fd71334fbff36cdc2871f3a5acfcd" }, "downloads": -1, "filename": "aws_runas-0.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "2ba88d54a8a25c69e91194364a236b6d", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7, <4", "size": 8286, "upload_time": "2017-08-03T02:57:57", "url": "https://files.pythonhosted.org/packages/6a/f8/49e56b124a7f0f149049c7fbf852f2de4b724912a62882da2a8b593b35fd/aws_runas-0.1.1-py2.py3-none-any.whl" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "38cacc864716955fc5a00b01d8852e58", "sha256": "c8f056854cdf468118c494c7ec116fbdc9724dbddc4aab17b743046bc27da13f" }, "downloads": -1, "filename": "aws_runas-0.1.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "38cacc864716955fc5a00b01d8852e58", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7, <4", "size": 8333, "upload_time": "2017-08-03T21:46:37", "url": "https://files.pythonhosted.org/packages/68/9f/c557e2cd76ff6ac418a93a7894cdff5eb39d6d05fb698c2741ca2bc11fd7/aws_runas-0.1.2-py2.py3-none-any.whl" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "e26f37b55d94688fd9048a2d6521e9c0", "sha256": "043790f13f69a77ecd3b4f965bac65e895e0ae5a2290fc1b24fd2c1f587fda05" }, "downloads": -1, "filename": "aws_runas-0.1.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "e26f37b55d94688fd9048a2d6521e9c0", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7, <4", "size": 8431, "upload_time": "2017-08-04T18:33:51", "url": "https://files.pythonhosted.org/packages/6f/a5/8badcce12ca14c53b55c4f5d87cd39deeda13483cd2657bd40600938373e/aws_runas-0.1.3-py2.py3-none-any.whl" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "4540061911e85ce2f35ec5c985c33422", "sha256": "03636244e504ee42c94d8e41676d90c953d754ee6702a61d4d31edfbf0ed9c31" }, "downloads": -1, "filename": "aws_runas-0.1.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "4540061911e85ce2f35ec5c985c33422", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7, <4", "size": 8528, "upload_time": "2017-08-10T17:06:08", "url": "https://files.pythonhosted.org/packages/07/27/8997c54c1273612b8378715519ed01f75e5e4c09d9cf9e817db9aa0040c9/aws_runas-0.1.4-py2.py3-none-any.whl" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "88045d7b4911f3dba37d7e3839fb0d18", "sha256": "45b6ff9012ff09553c36215d1000227e24c5a09c2e680d5a1f52bb0cd260080f" }, "downloads": -1, "filename": "aws_runas-0.1.5-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "88045d7b4911f3dba37d7e3839fb0d18", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7, <4", "size": 8987, "upload_time": "2017-09-07T17:38:38", "url": "https://files.pythonhosted.org/packages/8d/4c/efd8bb3a715233f3a8b2ea19d08e95eca3c7f251b7aea4655e9edd559d3d/aws_runas-0.1.5-py2.py3-none-any.whl" } ], "0.1.6": [ { "comment_text": "", "digests": { "md5": "73e8e29d38eaeda756c2b5d459b58eda", "sha256": "8146dbd8249ae76dd538afa186e2d8e548df8e6a2366684cb315d0398ccb4669" }, "downloads": -1, "filename": "aws_runas-0.1.6-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "73e8e29d38eaeda756c2b5d459b58eda", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7, <4", "size": 9181, "upload_time": "2017-09-08T14:56:57", "url": "https://files.pythonhosted.org/packages/4c/00/aecfa15c5f3a74216104ec805aeb45bf1e9b7bfcccd268bdd6407edb0d8d/aws_runas-0.1.6-py2.py3-none-any.whl" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "727e46769917c6569440d1f3eb95629e", "sha256": "fbe5d43f19be0d8a413731f10883570f2cc02cb9c22bf14b61a72acd55b24812" }, "downloads": -1, "filename": "aws_runas-0.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "727e46769917c6569440d1f3eb95629e", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7, <4", "size": 11527, "upload_time": "2017-09-23T20:39:06", "url": "https://files.pythonhosted.org/packages/35/fc/6f7df72f8c85d42fa732a240191a957e28f22cb1cc89ecd3dab4cbe088fd/aws_runas-0.2.0-py2.py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "727e46769917c6569440d1f3eb95629e", "sha256": "fbe5d43f19be0d8a413731f10883570f2cc02cb9c22bf14b61a72acd55b24812" }, "downloads": -1, "filename": "aws_runas-0.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "727e46769917c6569440d1f3eb95629e", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7, <4", "size": 11527, "upload_time": "2017-09-23T20:39:06", "url": "https://files.pythonhosted.org/packages/35/fc/6f7df72f8c85d42fa732a240191a957e28f22cb1cc89ecd3dab4cbe088fd/aws_runas-0.2.0-py2.py3-none-any.whl" } ] }