A CLI tool that allows you to log in and retrieve AWS temporary credentials using Red Hat SAML IDP
Project description
rh-aws-saml-login
A CLI tool that allows you to log in and retrieve AWS temporary credentials using Red Hat SAML IDP.
Pre-requisites
- Python 3.11 or later
- Connected to Red Hat VPN
- A Red Hat managed computer (Kerberos must be installed and configured) and you are logged in with your Red Hat account
How it works
The rh-aws-saml-login CLI is a tool that simplifies the process of logging into an AWS account via Red Hat SSO. It retrieves a SAML token from the Red Hat SSO server, then fetches and parses the AWS SSO login page to present you with a list of all available accounts and their respective roles. You can then choose your desired account and role, and rh-aws-saml-login uses the SAML token to generate temporary AWS role credentials. Finally, it spawns a new shell with the necessary AWS_ environment variables already set up, so you can immediately use the aws CLI without any further configuration.
Installation
Prerequisites
rh-aws-saml-login needs the krb5 library to work. On most system, e.g., MacOS, this library is already installed. On CSB Fedora, you need to install the Kerberos development package:
sudo dnf install krb5-devel
Recommended Installation Method
The recommended way to install rh-aws-saml-login is to use the uv tool:
uv tool install rh-aws-saml-login
and upgrade an existing installation with:
uv tool upgrade rh-aws-saml-login
Alternative Installation Methods
You can install this library from PyPI with pip:
python3 -m pip install rh-aws-saml-login
or install it with pipx:
pipx install rh-aws-saml-login
and upgrade an existing installation with:
pipx upgrade rh-aws-saml-login
Usage
rh-aws-saml-login
This spawns a new shell with the following environment variables are set:
AWS_ACCOUNT_NAME: The name/alias of the AWS accountAWS_ROLE_NAME: The name of the roleAWS_ROLE_ARN: The ARN of the roleAWS_ACCESS_KEY_ID: The access key used by the AWS CLIAWS_SECRET_ACCESS_KEY: The secret access key used by the AWS CLIAWS_SESSION_TOKEN: The session token used by the AWS CLIAWS_REGION: The default region used by the AWS CLI
Features
rh-aws-saml-login currently provides the following features (get help with -h or --help):
-
No configuration needed
-
Uses Kerberos authentication
-
Open the AWS web console for an account with the
--consoleoption -
Shell auto-completion (bash, zsh, and fish) including AWS account names
-
Integrates nicely with the starship
[env_var.AWS_ACCOUNT_NAME] format = "$symbol$style [$env_value]($style) " style = "cyan" symbol = "🚀"
Development
- Update CHANGELOG.md with the new version number and date
- Bump the version number in pyproject.toml
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rh_aws_saml_login-0.4.2.tar.gz.
File metadata
- Download URL: rh_aws_saml_login-0.4.2.tar.gz
- Upload date:
- Size: 8.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.4.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2f923e8b62662dee07a56cd4c40a33cf273353122a63d2847b369da5142aee74
|
|
| MD5 |
5b483070b47cecc0a9c210c0c30925f4
|
|
| BLAKE2b-256 |
4ae5fc6a78c45105b011ee75d8828ceba4e3c3ef527ebda74dfc81fad1401c9c
|
File details
Details for the file rh_aws_saml_login-0.4.2-py3-none-any.whl.
File metadata
- Download URL: rh_aws_saml_login-0.4.2-py3-none-any.whl
- Upload date:
- Size: 9.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.4.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5c423c83ee05329d7fbe2540f267fb32be0b869681ac83d35c5b8712a1d41df0
|
|
| MD5 |
2a1121714b7b4d8bfbbbec8553bbebf4
|
|
| BLAKE2b-256 |
10acc91be6c3b050df98ea4087f8871f67380924328022f73e822f4509ec09ca
|