Skip to main content

Ape AWS KMS: Ape plugin to make transactions through AWS KMS

Project description

Ape AWS KMS

Ape plugin to make transactions through AWS KMS

Dependencies

  • python3 version 3.10 or greater, python3-dev

Installation

via pip

You can install the latest release via pip:

pip install ape-aws

via setuptools

You can clone the repository and use setuptools for the most up-to-date version:

git clone https://github.com/ApeWorX/ape-aws.git
cd ape-aws
python3 setup.py install

Quick Usage

pip install ape-aws

Using CLI tool

List commands:

ape aws -h

See logged in profile (useful for debugging auth in containers)

ape aws whoami

To create a new user (recommended for cloud usage)

ape aws users new USER

To delete this user (WARNING this is permanent)

ape aws users remove USER

Create an access key for this user (WARNING don't lose generated token)

ape aws users tokens new USER > .env.USER

To create a new Ethereum signing key (recommended to generate)

ape aws keys generate KEY

To schedule this signing key for deletion (WARNING takes 30 days)

ape aws keys remove KEY

To grant your user access to the signing key (don't forget to do this!)

ape aws keys grant KEY -u USER

IPython

First, create a KMS key with the CLI tool

ape console
In [1]: kms_signer = accounts.load("KEY")
In [2]: kms_signer.sign_message("12345")
Out[2]: <MessageSignature v=27, r=0x..., s=0x...>

Now to test your new IAM user's access, you can do the following

env $(echo .env.USER | xargs) ape console

and you should be able to do the same as the above!

Use the access token above to run with your containers by supplying them as environment variables

WARNING: Don't forget to cycle your access tokens on a regular basis to prevent access leakage!

Development

This project is in development and should be considered a beta. Things might not be in their final state and breaking changes may occur. Comments, questions, criticisms and pull requests are welcomed.

Prerequisites to AWS Setup

To begin, create a virtual environment set up and activate the virtual environment before doing anything for the setup of AWS

  1. You must have an AWS account
  2. Must be an AWS Identity and Access Management (IAM) user with administrator access
  3. Must have configured AWS credentials
  4. Must have Docker, Python3 and pip installed on your workstation

AWS Setup

For Mac and Linux

Create a ~/.aws folder in your home directory:

mkdir ~/.aws

Note: get your access key and key id from your IAM in you AWS account here. Create a credentials file in the ~/.aws folder:

cat <<EOF > ~/.aws/credentials
[default]
aws_access_key_id = YOUR_ACCESS_KEY
aws_secret_access_key = YOUR_SECRET
EOF

Create a config file in the ~/.aws folder:

cat <<EOF > ~/.aws/config
[default]
region = YOUR_REGION
output = json
EOF

AWS KMS Key Import Steps

For manual setup, follow this article

License

This project is licensed under the Apache 2.0.

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

ape_aws-0.8.0b1.tar.gz (25.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ape_aws-0.8.0b1-py3-none-any.whl (19.6 kB view details)

Uploaded Python 3

File details

Details for the file ape_aws-0.8.0b1.tar.gz.

File metadata

  • Download URL: ape_aws-0.8.0b1.tar.gz
  • Upload date:
  • Size: 25.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for ape_aws-0.8.0b1.tar.gz
Algorithm Hash digest
SHA256 fb733e4462147c8e30a26fe00866f0d647fb070811c365338be2d33bb2611596
MD5 bf23442ac82246245c00151a300464f1
BLAKE2b-256 9da5e293f3dfbea7b72e55e89f828ed7f6764e4d60ea5e4c4ea956a5017c41a5

See more details on using hashes here.

Provenance

The following attestation bundles were made for ape_aws-0.8.0b1.tar.gz:

Publisher: publish.yaml on ApeWorX/ape-aws

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ape_aws-0.8.0b1-py3-none-any.whl.

File metadata

  • Download URL: ape_aws-0.8.0b1-py3-none-any.whl
  • Upload date:
  • Size: 19.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for ape_aws-0.8.0b1-py3-none-any.whl
Algorithm Hash digest
SHA256 713a8818aa0714c4c441c4b1481e1c7fa93e9d9a6e69b1cb42503def2ceffcb6
MD5 c68ecf2ce0216489adad9c3c29ea2e1e
BLAKE2b-256 d0e178760be9fdac72d60f5e47387b4cdb203cc66b6bbb9246a2f30b24d8e8e6

See more details on using hashes here.

Provenance

The following attestation bundles were made for ape_aws-0.8.0b1-py3-none-any.whl:

Publisher: publish.yaml on ApeWorX/ape-aws

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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