wev-awsmfa
A wev plugin to support Amazon Web Services multi-factor authentication on the command line
- ⚙️ Plugin for wev.
- 👮 Takes your one-time token and creates a temporary multi-factor authenticated session.
- 📋 Caches your temporary session to minimise prompts.
Say your IAM user policy requires you to verify your identity via multi-factor authentication.
This limits your ability to use the aws CLI because you can't provide MFA tokens with your requests.
wev-awsmfa extends wev to prompt for your one-time tokens and authenticate you automatically.
wev-awsmfa requires Python 3.8 or later and wev.
python -m pip install wev python -m pip install wev-awsmfaSee wevcli.app/configuration for a detailed guide to wev configuration files.
If in doubt, create your configuration file as wev.yml in your project directory.
wev-awsmfa must be configured to resolve three environment variables:
| Index | Description | Suggested name |
|---|---|---|
| 0 | AWS access key ID | AWS_ACCESS_KEY_ID |
| 1 | AWS secret key | AWS_SECRET_ACCESS_KEY |
| 2 | AWS session token | AWS_SESSION_TOKEN |
wev-awsmfa supports two optional properties:
| Property | Description | Default |
|---|---|---|
| duration | Duration of the temporary session in seconds | 900 |
| mfa_device | ARN of the multi-factor device to use | Attempt to discover automatically. |
[AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN]: plugin: id: wev-awsmfa[AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN]: plugin: id: wev-awsmfa duration: 1800 mfa_device: arn:aws:iam::123456789012:mfa/fooRun wev with any command that requires a multi-factor authenticated session.
For example, to run aws s3 ls in a multi-factor authenticated session:
wev aws s3 lsYou'll be prompted to enter your one-time token, then wev will authenticate you and run the command.
More examples:
Yes! wev-awsmfa will work with any command line application or script that requires a multi-factor authenticated session
My name is Cariad, and I'm an independent freelance DevOps engineer.
I'd love to spend more time working on projects like this, but--as a freelancer--my income is sporadic and I need to chase gigs that pay the rent.
If this project has value to you, please consider ☕️ sponsoring me. Sponsorships grant me time to work on your wants rather than someone else's.
Thank you! ❤️