Skip to main content

AWS credential manager

Project description

AWS Credentials

This CLI tool will let you manage AWS IAM Credentials for a user.

The main feature of this tool is the ability to rotate credentials. The process for this is:

  1. delete inactive credentials
  2. create a new set of credentials
  3. using the new set, it will deactivate the old one

This process works because AWS has a maximum limit of two credentials.

Installing

pip install aws-credentials

Usage

boto3 is used to interact with the AWS API, so the standard files can be used to specify the credentials. This includes the ability to use the environment variables

  • AWS_ACCESS_KEY_ID
  • AWS_SECRET_ACCESS_KEY
  • AWS_SESSION_TOKEN

You can also specify these as options on the individual commands.

⇒  aws-credentials --help
usage: aws-credentials [-h]
                       {activate,create,deactivate,delete,list,rotate} ...

Utility for managing AWS access keys.

optional arguments:
  -h, --help            show this help message and exit

Commands:
  {activate,create,deactivate,delete,list,rotate}
    activate            Activate a specific access key.
    create              Create a new access key.
    deactivate          Deactivate a specific access key.
    delete              Delete a specific access key.
    list                List access keys.
    rotate              Rotate AWS credentials.

activate

⇒  aws-credentials activate --help
usage: aws-credentials activate [-h] [-v]
                                [--aws-access-key-id AWS_ACCESS_KEY_ID]
                                [--aws-secret-access-key AWS_SECRET_ACCESS_KEY]
                                [--aws-session-token AWS_SESSION_TOKEN]
                                access_key_id

Activate a specific access key.

positional arguments:
  access_key_id         id of the key to activate.

optional arguments:
  -h, --help            show this help message and exit
  -v, --verbose         Increase the verbosity of messages. "-v" for normal
                        output, and "-vv" for more verbose output.
  --aws-access-key-id AWS_ACCESS_KEY_ID
                        AWS_ACCESS_KEY_ID to use.
  --aws-secret-access-key AWS_SECRET_ACCESS_KEY
                        AWS_SECRET_ACCESS_KEY to use.
  --aws-session-token AWS_SESSION_TOKEN
                        AWS_SESSION_TOKEN to use.

create

⇒  aws-credentials create --help
usage: aws-credentials create [-h] [-v]
                              [--aws-access-key-id AWS_ACCESS_KEY_ID]
                              [--aws-secret-access-key AWS_SECRET_ACCESS_KEY]
                              [--aws-session-token AWS_SESSION_TOKEN]

Create a new access key.

optional arguments:
  -h, --help            show this help message and exit
  -v, --verbose         Increase the verbosity of messages. "-v" for normal
                        output, and "-vv" for more verbose output.
  --aws-access-key-id AWS_ACCESS_KEY_ID
                        AWS_ACCESS_KEY_ID to use.
  --aws-secret-access-key AWS_SECRET_ACCESS_KEY
                        AWS_SECRET_ACCESS_KEY to use.
  --aws-session-token AWS_SESSION_TOKEN
                        AWS_SESSION_TOKEN to use.

deactivate

⇒  aws-credentials deactivate --help
usage: aws-credentials deactivate [-h] [-v]
                                  [--aws-access-key-id AWS_ACCESS_KEY_ID]
                                  [--aws-secret-access-key AWS_SECRET_ACCESS_KEY]
                                  [--aws-session-token AWS_SESSION_TOKEN]
                                  access_key_id

Deactivate a specific access key.

positional arguments:
  access_key_id         id of the key to deactivate.

optional arguments:
  -h, --help            show this help message and exit
  -v, --verbose         Increase the verbosity of messages. "-v" for normal
                        output, and "-vv" for more verbose output.
  --aws-access-key-id AWS_ACCESS_KEY_ID
                        AWS_ACCESS_KEY_ID to use.
  --aws-secret-access-key AWS_SECRET_ACCESS_KEY
                        AWS_SECRET_ACCESS_KEY to use.
  --aws-session-token AWS_SESSION_TOKEN
                        AWS_SESSION_TOKEN to use.

delete

⇒  aws-credentials delete --help
usage: aws-credentials delete [-h] [-v]
                              [--aws-access-key-id AWS_ACCESS_KEY_ID]
                              [--aws-secret-access-key AWS_SECRET_ACCESS_KEY]
                              [--aws-session-token AWS_SESSION_TOKEN]
                              access_key_id

Delete a specific access key.

positional arguments:
  access_key_id         id of the key to delete.

optional arguments:
  -h, --help            show this help message and exit
  -v, --verbose         Increase the verbosity of messages. "-v" for normal
                        output, and "-vv" for more verbose output.
  --aws-access-key-id AWS_ACCESS_KEY_ID
                        AWS_ACCESS_KEY_ID to use.
  --aws-secret-access-key AWS_SECRET_ACCESS_KEY
                        AWS_SECRET_ACCESS_KEY to use.
  --aws-session-token AWS_SESSION_TOKEN
                        AWS_SESSION_TOKEN to use.

list

⇒  aws-credentials list --help
usage: aws-credentials list [-h] [-v] [--aws-access-key-id AWS_ACCESS_KEY_ID]
                            [--aws-secret-access-key AWS_SECRET_ACCESS_KEY]
                            [--aws-session-token AWS_SESSION_TOKEN]

List access keys.

optional arguments:
  -h, --help            show this help message and exit
  -v, --verbose         Increase the verbosity of messages. "-v" for normal
                        output, and "-vv" for more verbose output.
  --aws-access-key-id AWS_ACCESS_KEY_ID
                        AWS_ACCESS_KEY_ID to use.
  --aws-secret-access-key AWS_SECRET_ACCESS_KEY
                        AWS_SECRET_ACCESS_KEY to use.
  --aws-session-token AWS_SESSION_TOKEN
                        AWS_SESSION_TOKEN to use.

rotate

⇒  aws-credentials rotate --help
usage: aws-credentials rotate [-h] [-v]
                              [--aws-access-key-id AWS_ACCESS_KEY_ID]
                              [--aws-secret-access-key AWS_SECRET_ACCESS_KEY]
                              [--aws-session-token AWS_SESSION_TOKEN]

Rotate AWS credentials. This will delete inactive keys before creating the new
key. It will then deactivate the old key.

optional arguments:
  -h, --help            show this help message and exit
  -v, --verbose         Increase the verbosity of messages. "-v" for normal
                        output, and "-vv" for more verbose output.
  --aws-access-key-id AWS_ACCESS_KEY_ID
                        AWS_ACCESS_KEY_ID to use.
  --aws-secret-access-key AWS_SECRET_ACCESS_KEY
                        AWS_SECRET_ACCESS_KEY to use.
  --aws-session-token AWS_SESSION_TOKEN
                        AWS_SESSION_TOKEN to use.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aws-credentials-1.0.0.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

aws_credentials-1.0.0-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file aws-credentials-1.0.0.tar.gz.

File metadata

  • Download URL: aws-credentials-1.0.0.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.6.9 Linux/5.6.13-100.fc30.x86_64

File hashes

Hashes for aws-credentials-1.0.0.tar.gz
Algorithm Hash digest
SHA256 7bc7a4ba24c113c3e976c94c7b83eb5528fd2ce58e92bc8f8189e9c5523a35cf
MD5 d331c4594de407fd79ec45e850510f52
BLAKE2b-256 bccf9c4a90e707b3850e52f722b6368cb7444ca5c4388f4e30562b94ac4669ee

See more details on using hashes here.

File details

Details for the file aws_credentials-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: aws_credentials-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.6.9 Linux/5.6.13-100.fc30.x86_64

File hashes

Hashes for aws_credentials-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6c59ad3f96556369bc6c1ed87197d93f352ea5cd0d004eeb6ae9080d0b4e461b
MD5 6dbf3ce7f636678f84c7c23e78060da3
BLAKE2b-256 2bdf965d09910ffb9bada6f4af48de2c54acbe943fdf95b32e01055df0639609

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page