# Awskeyring -- is a small tool to manage AWS account keys in the macOS Keychain
## SYNOPSIS
awskeyring COMMAND [ACCOUNT|ROLE] [OPTIONS]
awskeyring help COMMAND
## DESCRIPTION
The Awskeyring utility stores and manages AWS access keys and provides the facility to generate access tokens with
combinations of assumed roles and multi-factor-authentication codes. It includes autocompletion features and multiple
validation checks for input parsing. It also includes the ability for the AWS CLI to call it directly to provide authentication.
The commands are as follows:
* --version, -v:
Prints the version
-r, --no-remote: Do not validate with remote api.
* add ACCOUNT:
Adds an ACCOUNT to the keyring
-k, --key=KEY: AWS account key id.
-s, --secret=SECRET: AWS account secret.
-m, --mfa=MFA: AWS virtual mfa arn.
-r, --no-remote: Do not validate with remote api.
* add-role ROLE:
Adds a ROLE to the keyring
-a, --arn=ARN: AWS role arn.
* awskeyring console ACCOUNT:
Open the AWS Console for the ACCOUNT
-p, --path=PATH: The service PATH to open.
-b, --browser=BROWSER: Specify an alternative browser.
-n, --no-token: Do not use saved token.
-o, --no-open: Do not open the url.
* env ACCOUNT:
Outputs bourne shell environment exports for an ACCOUNT
-n, --no-token: Do not use saved token.
-u, --unset, --no-unset: Unset environment variables.
* exec ACCOUNT command...:
Execute a COMMAND with the environment set for an ACCOUNT
-n, --no-token: Do not use saved token.
-b, --no-bundle: Unset Bundler environment variables.
* help [COMMAND]:
Describe available commands or one specific command
* import:
Import an ACCOUNT to the keyring from ~/.aws/credentials
-r, --no-remote: Do not validate with remote api.
* initialise:
Initialises a new KEYCHAIN
-n, --keychain=KEYCHAIN: Name of KEYCHAIN to initialise.
* json ACCOUNT:
Outputs AWS CLI compatible JSON for an ACCOUNT
-n, --no-token: Do not use saved token.
* list:
Prints a list of accounts in the keyring
* list-role:
Prints a list of roles in the keyring
-d, --detail, --no-detail: Show more detail.
* remove ACCOUNT:
Removes an ACCOUNT from the keyring
* remove-role ROLE:
Removes a ROLE from the keyring
* remove-token ACCOUNT:
Removes a token for ACCOUNT from the keyring
* rotate ACCOUNT:
Rotate access keys for an ACCOUNT
* token ACCOUNT [ROLE] [MFA]:
Create an STS Token from a ROLE or an MFA code
-r, --role=ROLE: The ROLE to assume.
-c, --code=CODE: Virtual mfa CODE.
-d, --duration=DURATION: Session DURATION in seconds.
* update ACCOUNT:
Updates an ACCOUNT in the keyring
-k, --key=KEY: AWS account key id.
-s, --secret=SECRET: AWS account secret.
-r, --no-remote: Do not validate with remote api.
## ENVIRONMENT
The AWS_DEFAULT_REGION environment variable will be used for AWS API calls where specified or fall back to us-east-1
when not.
## EXIT STATUS
The Awskeyring utility exits 0 on success, and >0 if an error occurs.
## EXAMPLES
First you need to initialise your keychain to hold your AWS credentials.
awskeyring initialise
Then add your keys to it.
awskeyring add personal-aws
Now your keys are stored safely in the macOS keychain. To print environment variables run...
awskeyring env personal-aws
## HISTORY
The motivation of this application is to provide a local secure store of AWS
credentials using specifically in the macOS Keychain, to have them easily accessed
from the Terminal, and to provide useful functions like assuming roles and opening
the AWS Console from the cli.
For Enterprise environments there are better suited tools to use
like [HashiCorp Vault](https://vaultproject.io/).
## SECURITY
If you believe you have found a security issue in Awskeyring, please responsibly disclose by contacting me at
[tristan.morgan@servian.com](mailto:tristan.morgan@servian.com). Awskeyring is a Ruby script and as such Ruby is whitelisted to
access your "awskeyring" keychain. Use a strong password and keep the unlock time short.
## AUTHOR
Tristan Morgan is the maintainer of Awskeyring.
## CONTRIBUTORS
* Tristan [tristanmorgan](https://github.com/tristanmorgan)
* Adam Sir [AzySir](https://github.com/AzySir)
* Vito Giarrusso [thtliife](https://github.com/thtliife)
## LICENSE
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).