{"id":22770361,"url":"https://github.com/leanercloud/assume_role_with_mfa","last_synced_at":"2026-05-01T00:31:38.764Z","repository":{"id":210882812,"uuid":"727672996","full_name":"LeanerCloud/assume_role_with_mfa","owner":"LeanerCloud","description":"A small MFA GUI tool designed to be used as `credential_proces` for AWS CLI configuration profiles.","archived":false,"fork":false,"pushed_at":"2023-12-16T21:39:18.000Z","size":45,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-29T20:21:10.129Z","etag":null,"topics":["aws","aws-cli","golang-application","gui-application","iam","multifactor-authentication"],"latest_commit_sha":null,"homepage":"","language":"Go","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/LeanerCloud.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"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":"2023-12-05T10:44:54.000Z","updated_at":"2025-02-26T09:57:24.000Z","dependencies_parsed_at":"2023-12-16T22:38:22.074Z","dependency_job_id":null,"html_url":"https://github.com/LeanerCloud/assume_role_with_mfa","commit_stats":null,"previous_names":["leanercloud/assume_role_with_mfa"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/LeanerCloud/assume_role_with_mfa","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeanerCloud%2Fassume_role_with_mfa","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeanerCloud%2Fassume_role_with_mfa/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeanerCloud%2Fassume_role_with_mfa/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeanerCloud%2Fassume_role_with_mfa/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LeanerCloud","download_url":"https://codeload.github.com/LeanerCloud/assume_role_with_mfa/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeanerCloud%2Fassume_role_with_mfa/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32481553,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"ssl_error","status_checked_at":"2026-04-30T13:12:06.837Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["aws","aws-cli","golang-application","gui-application","iam","multifactor-authentication"],"created_at":"2024-12-11T15:31:10.028Z","updated_at":"2026-05-01T00:31:38.704Z","avatar_url":"https://github.com/LeanerCloud.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# assume_role_with_mfa\n\nA small MFA GUI tool designed to be used as `credential_proces` for AWS CLI configuration profiles.\n\nThis is a workaround for the official AWS MFA setup, that works for the CLI but is apparently broken for the Go SDK, as reported at [aws-sdk-go-v2/#2356](https://github.com/aws/aws-sdk-go-v2/issues/2356).\n\n```text\n[profile broken-sdk]\nsource_profile = users\nrole_arn=arn:aws:iam::bbbbbbbbbbbb:role/MyAssumedRole\nmfa_serial = arn:aws:iam::aaaaaaaaaaaaa:mfa/my-mfa\n```\n\nInstead, we integrate as a credential_process, which is better supported by the Go SDK.\n\n## Features\n\n- It actually works for the Go SDK :-D\n- Ask for MFA using a graphical user interface.\n- Caches credentials locally for subsequent access.\n\n## Prerequisites\n\n- Go (version 1.15 or later)\n- Valid AWS credentials configured as a profile in the AWS CLI credentials file.\n- An AWS account configured with an MFA device\n\n## Installation\n\nAssuming you have Go set up and `$PATH` set to `$GOPATH/bin`, you will need to run the following command:\n\n```shell\ngo install github.com/LeanerCloud/assume_role_with_mfa@latest\n```\n\n## Usage\n\nCreate this configuration in the `~/.aws/config` file, making sure the path is correct. \n\nYou can also test the command in a shell to see how it works. \n\n```text\n[profile my_mfa]\ncredential_process = /Users/USERNAME/go/bin/assume_role_with_mfa -mfa-arn arn:aws:iam::XXXXXXXXXXXX:mfa/mfa -profile another-profile-having-static-credentials -role-arn arn:aws:iam::YYYYYYYYYYYY:role/myRole\nregion = MY_REGION\n```\n\nUse this new profile as usual and you will be asked for the MFA code using this little GUI tool.\n\n\u003cimg width=\"181\" alt=\"Screenshot 2023-12-05 at 11 15 13\" src=\"https://github.com/LeanerCloud/assume_role_with_mfa/assets/95209/80aa3c5d-a485-40a9-919a-ba0068bedf5b\"\u003e\n\nThe tool will then assume the role using the MFA code and provide some temporary credentials to that profile.\n\n## Credential caching\n\nTo avoid asking for MFA repeatedly, we cache the obtained credentials in a file located in the Fyne application's storage directory, and the cached credentials will be reused until they expire.\n\nThe cache filename is a SHA256 hash of the role ARN to uniquely identify the credentials when switching between profiles/roles.\n\n## Related Projects\n\nCheck out our other open-source [projects](https://github.com/LeanerCloud)\n\n- [awesome-finops](https://github.com/LeanerCloud/awesome-finops) - a more up-to-date and complete fork of [jmfontaine/awesome-finops](https://github.com/jmfontaine/awesome-finops).\n- [Savings Estimator](https://github.com/LeanerCloud/savings-estimator) - estimate Spot savings for ASGs.\n- [AutoSpotting](https://github.com/LeanerCloud/AutoSpotting) - convert On-Demand ASGs to Spot without config changes, automated divesification, and failover to On-Demand.\n- [EBS Optimizer](https://github.com/LeanerCloud/EBSOptimizer) - automatically convert EBS volumes to GP3.\n- [ec2-instances-info](https://github.com/LeanerCloud/ec2-instances-info) - Golang library for specs and pricing information about AWS EC2 instances based on the data from [ec2instances.info](https://ec2instances.info).\n- [ipv4-cost-viewer](https://github.com/LeanerCloud/aws-ipv4-cost-viewer) - shows the future public IPv4 costs for a variety of AWS resources across all AWS regions from an account in a user-friendly terminal UI.\n\nFor more advanced features of some of these tools, as well as comprehensive cost optimization services focused on AWS, visit our commercial offerings at [LeanerCloud.com](https://www.LeanerCloud.com).\n\n## Support\n\nReach out to us on [Slack](https://join.slack.com/t/leanercloud/shared_invite/zt-xodcoi9j-1IcxNozXx1OW0gh_N08sjg) if you need help or have any questions about this or any of our projects.\n\n## Contributing\n\nContributions to this project are welcome! You can contribute in the following ways:\n\n- Report Issues: If you find any bugs or have feature suggestions, please create an issue.\n- Submit Pull Requests: Feel free to fork the repository and submit pull requests with bug fixes or new features.\n\n## License\n\nThis project is licensed under the MIT License.\n\nCopyright (c) 2023 Cristian Magherusan-Stanciu, [LeanerCloud.com](https://LeanerCloud.com).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleanercloud%2Fassume_role_with_mfa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleanercloud%2Fassume_role_with_mfa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleanercloud%2Fassume_role_with_mfa/lists"}