Skip to main content

Plug-and-play client for onboarding users against a self-hosted IAM Roles Anywhere Central CA

Project description

rolesanywhere-onboard

Plug-and-play client for onboarding users against a self-hosted IAM Roles Anywhere Central CA.

Cross-platform (Linux, macOS, Windows) — the only non-stdlib dependency is cryptography for local RSA keypair generation (Python has no built-in asymmetric crypto, and this avoids depending on a system openssl binary, which Windows doesn't ship by default).

Install

pip install rolesanywhere-onboard

The installed command is iamroles (shorter than the package name):

CLI

iamroles --url <ApiEndpoint> --secret <ApiKeyValue> --name alice \
    --trust-anchor-arn <arn> --profile-arn <arn> --role-arn <arn> --days 365

That's the whole tool. It needs no AWS credentials, no aws CLI, and no AWS account — just the endpoint URL and API key your admin gives you.

Issuing a certificate is the only thing the CA's public endpoint allows. Revoking, renewing, suspending, and rotating the CA are admin-only actions gated behind real AWS IAM credentials — deliberately not reachable with an API key, and so deliberately not in this tool. Ask your admin for those.

The AWS profile it creates

By default this writes the default profile to ~/.aws/config, so afterwards plain aws s3 ls just works — no --profile flag needed:

aws sts get-caller-identity
aws s3 ls s3://your-bucket

If you already have a default profile (e.g. from aws configure), it will not overwrite it — you'll get an error telling you to pick a name instead:

iamroles --name alice --aws-profile-name alice-ca ...   # -> aws s3 ls --profile alice-ca

Skip AWS profile setup entirely with --no-aws-profile.

Renewing before your certificate expires

Just run the exact same command again:

iamroles --url <ApiEndpoint> --secret <ApiKeyValue> --name alice \
    --trust-anchor-arn <arn> --profile-arn <arn> --role-arn <arn> --days 365

You get a fresh keypair and a fresh certificate, written over the old ones at the same paths, so your AWS profile picks them up automatically with no config changes — the profile write is a no-op in this case, not an error.

Two things worth knowing:

  • Your old certificate is not revoked. It stays valid until it expires on its own, so for a while you have two working certificates. If your old key was actually compromised, don't self-renew — ask an admin to revoke it, which is enforced within seconds.
  • Renew before you expire, not after. There's no grace period; an expired certificate stops working and you'd just be onboarding fresh anyway.

As a library

from rolesanywhere_onboard import request_certificate, get_credentials

result = request_certificate(url="...", secret="...", name="alice", days=365)
creds = get_credentials(result.cert_path, result.key_path,
                         trust_anchor_arn, profile_arn, role_arn)
# {"AccessKeyId": ..., "SecretAccessKey": ..., "SessionToken": ..., "Expiration": ...}

Requirements

  • Python 3.8+
  • Nothing else. No aws CLI, no openssl binary, no AWS account. The only dependency is cryptography (pulled in automatically by pip), used for local keypair generation — Python's standard library has no asymmetric keygen of its own.

Linux, macOS (Intel + Apple Silicon), and Windows are all supported.

License

MIT

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

rolesanywhere_onboard-1.1.0.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

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

rolesanywhere_onboard-1.1.0-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file rolesanywhere_onboard-1.1.0.tar.gz.

File metadata

  • Download URL: rolesanywhere_onboard-1.1.0.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for rolesanywhere_onboard-1.1.0.tar.gz
Algorithm Hash digest
SHA256 065de9e80b828497c73ed178c9cc20938de2ddbd2e175fc2715288876d5b68f5
MD5 914a3bcd9373d156c12155b55234c273
BLAKE2b-256 ef11e2c98c49377ff552ab4a6dfc7f0901078736949c5d8cfdea7c0703c23965

See more details on using hashes here.

File details

Details for the file rolesanywhere_onboard-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for rolesanywhere_onboard-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b6db398f24c4014c8eb31dfd1ed83cf0f10ff8fe78ca09b12fad937769ad3156
MD5 8fd8783cb8fd649b474e5ddd5206c727
BLAKE2b-256 945053dc321b444a03df47c114b84af1a57392b4d8cbd7ef8efd0b317bb42c41

See more details on using hashes here.

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