stsmfa-cli


Namestsmfa-cli JSON
Version 1.4.6 PyPI version JSON
download
home_pagehttps://github.com/browniebroke/stsmfa-cli
SummaryA small CLI to help with creating AWS profile for MFA protected sessions
upload_time2024-12-04 21:44:42
maintainerNone
docs_urlNone
authorBruno Alla
requires_python<4.0,>=3.9
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # STS MFA CLI

<p align="center">
  <a href="https://github.com/browniebroke/stsmfa-cli/actions/workflows/ci.yml?query=branch%3Amain">
    <img src="https://img.shields.io/github/actions/workflow/status/browniebroke/stsmfa-cli/ci.yml?branch=main&label=CI&logo=github&style=flat-square" alt="CI Status" >
  </a>
  <a href="https://codecov.io/gh/browniebroke/stsmfa-cli">
    <img src="https://img.shields.io/codecov/c/github/browniebroke/stsmfa-cli.svg?logo=codecov&logoColor=fff&style=flat-square" alt="Test coverage percentage">
  </a>
</p>
<p align="center">
  <a href="https://python-poetry.org/">
    <img src="https://img.shields.io/endpoint?url=https://python-poetry.org/badge/v0.json" alt="Poetry">
  </a>
  <a href="https://github.com/astral-sh/ruff">
    <img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json" alt="Ruff">
  </a>
  <a href="https://github.com/pre-commit/pre-commit">
    <img src="https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white&style=flat-square" alt="pre-commit">
  </a>
</p>
<p align="center">
  <a href="https://pypi.org/project/stsmfa-cli/">
    <img src="https://img.shields.io/pypi/v/stsmfa-cli.svg?logo=python&logoColor=fff&style=flat-square" alt="PyPI Version">
  </a>
  <img src="https://img.shields.io/pypi/pyversions/stsmfa-cli.svg?style=flat-square&logo=python&amp;logoColor=fff" alt="Supported Python versions">
  <img src="https://img.shields.io/pypi/l/stsmfa-cli.svg?style=flat-square" alt="License">
</p>

---

**Source Code**: <a href="https://github.com/browniebroke/stsmfa-cli" target="_blank">https://github.com/browniebroke/stsmfa-cli </a>

---

Creating temporary profiles for multi-factor auth (MFA) protected accounts using AWS STS is too hard. This is a small CLI that helps with that.

## Installation

Via Homebrew:

```bash
brew install browniebroke/tap/stsmfa-cli
```

Via pip, pipx, or your favourite Python package manager:

```bash
pip install stsmfa-cli
```

## Usage

The CLI is a simple command `stsmfa` that creates a profile for a temporary session protected by MFA.

Assuming your `~/.aws/credentials` file looks like this:

```ini
[my-profile-name]
aws_access_key_id = AKIAXXXXX
aws_secret_access_key = xxxx
mfa_serial = arn:aws:iam::123456789010:mfa/first.last
```

When running, for example:

```bash
stsmfa --profile my-profile-name 123456
```

This will create a session using the MFA serial defined under `my-profile-name` with the one-time password `123456`, and save the required AWS key, secret and token under as a new profile `my-profile-name-mfa` in you `~/.aws/credentials` file.

Now to use that session, you just need to set `AWS_PROFILE=my-profile-name-mfa`.

If your MFA serial is defined under the default profile, you don't need to specify the `--profile` option.

## Contributors ✨

Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):

<!-- prettier-ignore-start -->
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
  <tbody>
    <tr>
      <td align="center" valign="top" width="14.28%"><a href="https://browniebroke.com/"><img src="https://avatars.githubusercontent.com/u/861044?v=4?s=80" width="80px;" alt="Bruno Alla"/><br /><sub><b>Bruno Alla</b></sub></a><br /><a href="https://github.com/browniebroke/stsmfa-cli/commits?author=browniebroke" title="Code">💻</a> <a href="#ideas-browniebroke" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/browniebroke/stsmfa-cli/commits?author=browniebroke" title="Documentation">📖</a></td>
    </tr>
  </tbody>
</table>

<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->

<!-- ALL-CONTRIBUTORS-LIST:END -->
<!-- prettier-ignore-end -->

This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!

## Credits

This package was created with
[Copier](https://copier.readthedocs.io/) and the
[browniebroke/pypackage-template](https://github.com/browniebroke/pypackage-template)
project template.


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/browniebroke/stsmfa-cli",
    "name": "stsmfa-cli",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.9",
    "maintainer_email": null,
    "keywords": null,
    "author": "Bruno Alla",
    "author_email": "alla.brunoo@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/ef/d9/3b06782bdc12b0346fc0a94b21ef0735ec61cc8cea6c43357ab67578eefa/stsmfa_cli-1.4.6.tar.gz",
    "platform": null,
    "description": "# STS MFA CLI\n\n<p align=\"center\">\n  <a href=\"https://github.com/browniebroke/stsmfa-cli/actions/workflows/ci.yml?query=branch%3Amain\">\n    <img src=\"https://img.shields.io/github/actions/workflow/status/browniebroke/stsmfa-cli/ci.yml?branch=main&label=CI&logo=github&style=flat-square\" alt=\"CI Status\" >\n  </a>\n  <a href=\"https://codecov.io/gh/browniebroke/stsmfa-cli\">\n    <img src=\"https://img.shields.io/codecov/c/github/browniebroke/stsmfa-cli.svg?logo=codecov&logoColor=fff&style=flat-square\" alt=\"Test coverage percentage\">\n  </a>\n</p>\n<p align=\"center\">\n  <a href=\"https://python-poetry.org/\">\n    <img src=\"https://img.shields.io/endpoint?url=https://python-poetry.org/badge/v0.json\" alt=\"Poetry\">\n  </a>\n  <a href=\"https://github.com/astral-sh/ruff\">\n    <img src=\"https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json\" alt=\"Ruff\">\n  </a>\n  <a href=\"https://github.com/pre-commit/pre-commit\">\n    <img src=\"https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white&style=flat-square\" alt=\"pre-commit\">\n  </a>\n</p>\n<p align=\"center\">\n  <a href=\"https://pypi.org/project/stsmfa-cli/\">\n    <img src=\"https://img.shields.io/pypi/v/stsmfa-cli.svg?logo=python&logoColor=fff&style=flat-square\" alt=\"PyPI Version\">\n  </a>\n  <img src=\"https://img.shields.io/pypi/pyversions/stsmfa-cli.svg?style=flat-square&logo=python&amp;logoColor=fff\" alt=\"Supported Python versions\">\n  <img src=\"https://img.shields.io/pypi/l/stsmfa-cli.svg?style=flat-square\" alt=\"License\">\n</p>\n\n---\n\n**Source Code**: <a href=\"https://github.com/browniebroke/stsmfa-cli\" target=\"_blank\">https://github.com/browniebroke/stsmfa-cli </a>\n\n---\n\nCreating temporary profiles for multi-factor auth (MFA) protected accounts using AWS STS is too hard. This is a small CLI that helps with that.\n\n## Installation\n\nVia Homebrew:\n\n```bash\nbrew install browniebroke/tap/stsmfa-cli\n```\n\nVia pip, pipx, or your favourite Python package manager:\n\n```bash\npip install stsmfa-cli\n```\n\n## Usage\n\nThe CLI is a simple command `stsmfa` that creates a profile for a temporary session protected by MFA.\n\nAssuming your `~/.aws/credentials` file looks like this:\n\n```ini\n[my-profile-name]\naws_access_key_id = AKIAXXXXX\naws_secret_access_key = xxxx\nmfa_serial = arn:aws:iam::123456789010:mfa/first.last\n```\n\nWhen running, for example:\n\n```bash\nstsmfa --profile my-profile-name 123456\n```\n\nThis will create a session using the MFA serial defined under `my-profile-name` with the one-time password `123456`, and save the required AWS key, secret and token under as a new profile `my-profile-name-mfa` in you `~/.aws/credentials` file.\n\nNow to use that session, you just need to set `AWS_PROFILE=my-profile-name-mfa`.\n\nIf your MFA serial is defined under the default profile, you don't need to specify the `--profile` option.\n\n## Contributors \u2728\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n<!-- prettier-ignore-start -->\n<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->\n<!-- prettier-ignore-start -->\n<!-- markdownlint-disable -->\n<table>\n  <tbody>\n    <tr>\n      <td align=\"center\" valign=\"top\" width=\"14.28%\"><a href=\"https://browniebroke.com/\"><img src=\"https://avatars.githubusercontent.com/u/861044?v=4?s=80\" width=\"80px;\" alt=\"Bruno Alla\"/><br /><sub><b>Bruno Alla</b></sub></a><br /><a href=\"https://github.com/browniebroke/stsmfa-cli/commits?author=browniebroke\" title=\"Code\">\ud83d\udcbb</a> <a href=\"#ideas-browniebroke\" title=\"Ideas, Planning, & Feedback\">\ud83e\udd14</a> <a href=\"https://github.com/browniebroke/stsmfa-cli/commits?author=browniebroke\" title=\"Documentation\">\ud83d\udcd6</a></td>\n    </tr>\n  </tbody>\n</table>\n\n<!-- markdownlint-restore -->\n<!-- prettier-ignore-end -->\n\n<!-- ALL-CONTRIBUTORS-LIST:END -->\n<!-- prettier-ignore-end -->\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!\n\n## Credits\n\nThis package was created with\n[Copier](https://copier.readthedocs.io/) and the\n[browniebroke/pypackage-template](https://github.com/browniebroke/pypackage-template)\nproject template.\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A small CLI to help with creating AWS profile for MFA protected sessions",
    "version": "1.4.6",
    "project_urls": {
        "Bug Tracker": "https://github.com/browniebroke/stsmfa-cli/issues",
        "Changelog": "https://github.com/browniebroke/stsmfa-cli/blob/main/CHANGELOG.md",
        "Homepage": "https://github.com/browniebroke/stsmfa-cli",
        "Repository": "https://github.com/browniebroke/stsmfa-cli"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8d4a54fbec88b9c71c23a7ac1103334d14a9bbf9951c166a9acabb090be568fa",
                "md5": "84a068907eeacaa7fa87177091d38ef8",
                "sha256": "e29a99a99856b047c78335702090a331b3f317d6b5a5cd02af92c92ac2dc6099"
            },
            "downloads": -1,
            "filename": "stsmfa_cli-1.4.6-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "84a068907eeacaa7fa87177091d38ef8",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.9",
            "size": 5324,
            "upload_time": "2024-12-04T21:44:41",
            "upload_time_iso_8601": "2024-12-04T21:44:41.128467Z",
            "url": "https://files.pythonhosted.org/packages/8d/4a/54fbec88b9c71c23a7ac1103334d14a9bbf9951c166a9acabb090be568fa/stsmfa_cli-1.4.6-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "efd93b06782bdc12b0346fc0a94b21ef0735ec61cc8cea6c43357ab67578eefa",
                "md5": "94c3569b9c1126c46e67a2234318d632",
                "sha256": "829df4f21d3dc68d6f5bd7e951c49ab756dbe5bbcaec7527c43568b2f7857ebb"
            },
            "downloads": -1,
            "filename": "stsmfa_cli-1.4.6.tar.gz",
            "has_sig": false,
            "md5_digest": "94c3569b9c1126c46e67a2234318d632",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.9",
            "size": 5238,
            "upload_time": "2024-12-04T21:44:42",
            "upload_time_iso_8601": "2024-12-04T21:44:42.986807Z",
            "url": "https://files.pythonhosted.org/packages/ef/d9/3b06782bdc12b0346fc0a94b21ef0735ec61cc8cea6c43357ab67578eefa/stsmfa_cli-1.4.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-04 21:44:42",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "browniebroke",
    "github_project": "stsmfa-cli",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "stsmfa-cli"
}
        
Elapsed time: 4.04828s