{"id":17767947,"url":"https://github.com/marceloboeira/awsudo","last_synced_at":"2025-03-15T14:30:28.503Z","repository":{"id":71790117,"uuid":"147531640","full_name":"marceloboeira/awsudo","owner":"marceloboeira","description":"\u003e sudo-like behavior for role assumed access on AWS accounts","archived":false,"fork":false,"pushed_at":"2019-05-10T19:35:00.000Z","size":366,"stargazers_count":22,"open_issues_count":7,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-27T02:42:23.747Z","etag":null,"topics":["authentication","aws","aws-cli","cli","roles-management","sudo","sudo-like"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/marceloboeira.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-09-05T14:30:17.000Z","updated_at":"2025-02-23T20:44:10.000Z","dependencies_parsed_at":"2023-02-27T17:45:37.556Z","dependency_job_id":null,"html_url":"https://github.com/marceloboeira/awsudo","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marceloboeira%2Fawsudo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marceloboeira%2Fawsudo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marceloboeira%2Fawsudo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marceloboeira%2Fawsudo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marceloboeira","download_url":"https://codeload.github.com/marceloboeira/awsudo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243742494,"owners_count":20340658,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["authentication","aws","aws-cli","cli","roles-management","sudo","sudo-like"],"created_at":"2024-10-26T20:52:10.936Z","updated_at":"2025-03-15T14:30:28.495Z","avatar_url":"https://github.com/marceloboeira.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/marceloboeira/awsudo/master/docs/logos/logo-github.png\" width=\"300\"\u003e\n  \u003cp align=\"center\"\u003esudo-like behavior for role assumed access on AWS accounts\u003c/p\u003e\n  \u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://travis-ci.org/marceloboeira/awsudo.svg?branch=master\"\u003e\n  \u003c/p\u003e\n\u003c/p\u003e\n\n## What does it do?\n\nThe AWS sudo, inject aws credentials to the command you want to run:\n\n```shell\nawsudo -u staging env | grep AWS\n```\n\nResults in:\n```shell\nAWS_SESSION_TOKEN=********\nAWS_SECRET_ACCESS_KEY=**************\nAWS_ACCESS_KEY_ID=********\n```\n\n**Notice** - `awsudo` was meant for local usage, it is not for server authentication.\n\nSee the [Motivation](#motivation) section for more info.\n\n### Workflow\n\nThis is how the CLI works under the hood:\n\n(click to see the large version)\n\n\u003cimg src=\"docs/workflow.png\" width=\"10%\"\u003e\n\n## Setup\n\nIt is assumed that you have `awscli` installed and configured OR at least, the `~/.aws/config` file following this pattern:\n\n```\n[profile foo]\nrole_arn=...\nmfa_serial=... (if necessary)\nregion=...\n```\n\nMore information: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html\n\n### macOS\n\n```shell\nbrew tap marceloboeira/formulas\nbrew install marceloboeira/formulas/awsudo\n```\n\n## Usage\n\n```\nawsudo - sudo-like behavior for role assumed access on AWS accounts 0.1.1\n\nUSAGE:\n    awsudo [OPTIONS] --user \u003cuser\u003e [SUBCOMMAND]\n\nFLAGS:\n    -h, --help       Prints help information\n    -V, --version    Prints version information\n\nOPTIONS:\n        --cache-dir \u003cDIR\u003e    Custom directory for credentials caching, defaults to ~/.awsudo/\n    -c, --config \u003cFILE\u003e      Custom config file, defaults to: ~/.aws/config\n    -u, --user \u003cuser\u003e        AWS profile name based on the config file\n```\n\nThanks [clap](https://github.com/clap-rs/clap) for that.\n\n### Examples\n\nGet all of the S3 buckets of the **production** account:\n\n```shell\nawsudo -u production aws s3 ls\n```\n\nRun a executable that needs AWS credentials:\n\n```shell\nawsudo -u staging delete_s3_buckets \"s3://staging-acc/foo\"\n```\n\n#### Aliases\n\nThis is not required, but interesting:\n\n```shell\nalias awss='awsudo -u staging'\nalias awso='awsudo -u operations'\nalias awsp='awsudo -u production'\n```\n\nThen after:\n\n```shell\nawss [subcomand]\n```\n\n# Motivation\n\nMain motivation was to write something that I would use everyday with rust, the awsudo usecase was quite interesting. The [original awsudo](https://github.com/makethunder/awsudo/) is heavily used where I work and it constantly causes pain, the CLI has a couple of issues:\n\n1. **Distribution** - It was written in Python, which makes it difficult to distribute, also doens't have a homebrew formula\n1. **Dependencies** - It [locks the aws-cli version](https://github.com/makethunder/awsudo/issues/7), and [depends on code of the CLI itself](https://github.com/makethunder/awsudo/blob/d5800bc4a9785d179c678605d0ae5bf4e28f5205/awsudo/config.py#L1)\n1. **Versioning** - It [doesn't have versions whatsoever](https://github.com/makethunder/awsudo/releases)\n1. **Bugs** - It has a couple of bugs, e.g.: [you can't pass `AWS_*` like variables to your command](https://github.com/makethunder/awsudo/issues/14)\n\nThe [official solution](https://docs.aws.amazon.com/cli/latest/userguide/cli-roles.html#cli-roles-cache) from AWS is not really great either:\n1. Stateful - Once you assume you stick with it until it expires or you switch\n1. CLI centric - Hard to share the credentials and switch quickly if you are not using their CLI\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarceloboeira%2Fawsudo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarceloboeira%2Fawsudo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarceloboeira%2Fawsudo/lists"}