Giter Site home page Giter Site logo

okta-awscli's Introduction

This is an fork of okta_awscli with following updates:

  • support python 3 (and only python3)
  • bug fixes
  • allow you to specify 'duration' (in seconds), 'app', 'profile' in config file

python3 setup.py sdist twine upload --repository-url https://upload.pypi.org/legacy/ dist/okta-awscli3-0.2.8.tar.gz pip3 install okta-awscli3

okta_awscli - Retrieve AWS credentials from Okta

Authenticates a user against Okta and then uses the resulting SAML assertion to retrieve temporary STS credentials from AWS.

This project is largely inspired by https://github.com/nimbusscale/okta_aws_login, but instead uses a purely API-driven approach, instead of parsing HTML during the authentication phase.

Parsing the HTML is still required to get the SAML assertion, after authentication is complete. However, since we only need to look for the SAML assertion in a single, predictable tag, <input name="SAMLResponse"..., the results are a lot more stable across any changes that Okta may make to their interface.

Installation

  • pip install okta-awscli
  • Configure okta-awscli via the ~/.okta-aws file with the following parameters:
[default]
base-url = <your_okta_org>.okta.com

## The remaining parameters are optional.
## You will be prompted for them, if they're not included here.
username = <your_okta_username>
password = <your_okta_password> # Only save your password if you know what you are doing!
factor = <your_preferred_mfa_factor> # Current choices are: GOOGLE or OKTA
role = <your_preferred_okta_role> # AWS role name (match one of the options prompted for by "Please select the AWS role" when this parameter is not specified

Supported Features

Unsupported Features

  • Per application MFA support

Usage

okta-awscli --profile <aws_profile> <awscli action> <awscli arguments>

  • Follow the prompts to enter MFA information (if required) and choose your AWS app and IAM role.
  • Subsequent executions will first check if the STS credentials are still valid and skip Okta authentication if so.
  • Multiple Okta profiles are supported, but if none are specified, then default will be used.

Example

okta-awscli --profile my-aws-account iam list-users

If no awscli commands are provided, then okta-awscli will simply output STS credentials to your credentials file, or console, depending on how --profile is set.

Optional flags:

  • --profile Sets your temporary credentials to a profile in .aws/credentials. If omitted, credentials will output to console.
  • --force Ignores result of STS credentials validation and gets new credentials from AWS. Used in conjunction with --profile.
  • --verbose More verbose output.
  • --debug Very verbose output. Useful for debugging.
  • --cache Cache the acquired credentials to ~/.okta-credentials.cache (only if --profile is unspecified)
  • --okta-profile Use a Okta profile, other than default in .okta-aws. Useful for multiple Okta tenants.
  • --token or -t Pass in the TOTP token from your authenticator

okta-awscli's People

Contributors

jmhale avatar jamesoflol avatar yongzhi2 avatar justinm avatar jafrouk avatar

Forkers

jkedra

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.