Giter VIP home page Giter VIP logo

oktad's Introduction

This application is deprecated as of whenever this gets committed!

It'll still continue to work, but I'm not planning on maintaining it!

Please consider using segmentio/aws-okta instead! It does everything oktad ever officially did and more, like allowing you to adjust your AssumeRole session length per call!

oktad

okta-aws, but in go. This program authenticates with Okta and then assumes role twice in Amazon.

Installation

Grab a binary for your OS from the latest release, and put it somewhere in your PATH. Only supports Linux and OSX for now!

If you're on OSX like me, this might be all you need...

curl -L -o /usr/local/bin/oktad https://github.com/RedVentures/oktad/releases/download/`curl -v 'https://github.com/RedVentures/oktad/releases/latest' 2>&1 | grep Location | grep -E -o 'v[0-9]+\.[0-9]+\.[0-9]+'`/oktad-darwin-amd64 && chmod +x /usr/local/bin/oktad

Setup

First, create an ~/.okta-aws/config file with your Ookta base URL and app URL, like below:

[okta]
baseUrl=https://mycompany.okta.com/
appUrl=https://mycompany.okta.com/app/YOUR_APP/OKTA_MAGIC/sso/saml

Third, set up an AWS CLI config file. You need to create ~/.aws/config and fill it with a profile containing the ARN for a role you ultimately want to get temporary credentials for. This file might look like the following:

[default]
output = json
region = us-east-1

[profile my_subaccount]
role_arn = arn:aws:iam::MY_ACCOUNT_ID:role/wizards

With those things set up, you should be able to run oktad my_subaccount -- [command] to run whatever [command] is with a set of temporary credentials from Amazon.

Usage

$ oktad [AWS profile] -- [command]

for example

$ oktad production -- aws ec2 describe-instances

Debugging

Login didn't work? Launch this program with DEBUG=oktad* in your environment for more debugging info:

$ DEBUG=oktad* oktad production -- aws ec2 describe-instances

Contributors

oktad's People

Contributors

darethas avatar endemics avatar hopkinsth avatar lstanden avatar rv-gjohnson avatar tlunter avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

oktad's Issues

Login successful, No output after

Hello, Thank you for the tool, it appears to be the best around for Okta/AWS but I'm having an issue running the command after the utility. Should there be more debug logs after the successful login?

$ DEBUG=* oktad dp -- aws s3 ls
18:21:57.206 86us   86us   oktad:main - loading configuration data
18:21:57.206 148us  148us  oktad:config - trying to load from config param file
18:21:57.206 4us    4us    oktad:config - trying to load from CWD
18:21:57.206 5us    5us    oktad:config - trying to load from home dir
18:21:57.206 10us   10us   oktad:config - loading /Users/ianmo/.okta-aws/config
18:21:57.234 28ms   28ms   oktad:credStore - no credentials found for supplied profile: dp
18:21:57.234 28ms   28ms   oktad:main - cred load err credentials not found!
Username: [email protected]
Password: 
18:22:04.630 7s     7s     oktad:okta - let the login dance begin
18:22:05.906 1s     1s     oktad:okta - login response body {"expiresAt":"2017-06-12T18:27:07.000Z","status":"SUCCESS","sessionToken":"000000fake","_embedded":{"user":{"id":"000000fake","profile":{"login":"[email protected]","firstName":"Guy","lastName":"Guy","locale":"en","timeZone":"America/Los_Angeles"}}}}
$ DEBUG=* oktad dp -- echo "test"
18:22:17.187 87us   87us   oktad:main - loading configuration data
18:22:17.187 152us  152us  oktad:config - trying to load from config param file
18:22:17.187 1us    1us    oktad:config - trying to load from CWD
18:22:17.187 5us    5us    oktad:config - trying to load from home dir
18:22:17.187 10us   10us   oktad:config - loading /Users/ianmo/.okta-aws/config
18:22:17.214 27ms   27ms   oktad:credStore - no credentials found for supplied profile: dp
18:22:17.214 27ms   27ms   oktad:main - cred load err credentials not found!
Username: [email protected]
Password: 
18:22:25.083 7s     7s     oktad:okta - let the login dance begin
18:22:26.604 1s     1s     oktad:okta - login response body {"expiresAt":"2017-06-12T18:27:28.000Z","status":"SUCCESS","sessionToken":"000000fake","_embedded":{"user":{"id":"000000fake","profile":{"login":"[email protected]","firstName":"Guy","lastName":"Guy","locale":"en","timeZone":"America/Los_Angeles"}}}}

how do I find appUrl ?

I'm not sure what to put in appUrl setting. Using the URL I get from okta doesn't work and it doesn't look like the example in the README.

Windows support

I see that the readme says Windows is not supported right now. Has this been tested? If so, are there plans and/or a timeline for Windows support?

Unable to have multiple open sessions

Because the credential caching in ~/.okta-aws/credentials is not namespaced by profile you cannot have 2 sessions to different accounts open in 2 seperate terminal windows. When you attempt to open the 2nd session it sees the credentials file and if those haven't expired it just puts them in your environment without checking that they are for the requested account.

build for linux again

go-keytar links against some dependencies that weren't in my docker build container, need to figure this out or convert go-keytar to use libsecret...

Error preparing to AssumeRole!

Hi,

I'm getting the following error when attempting to use oktad. Since the Okta supplied tool doesn't seem to work anywher near as slick, it'd be nice to get this going.

The error is below:

18:31:53.270 427ms  427ms  oktad:okta - didn't find saml response element
18:31:53.270 14s    14s    oktad:main - got saml:

Error preparing to AssumeRole!
18:31:53.270 2us    2us    oktad:main - getSaml err was Invalid saml response!

This was immediately following a "SUCCESS" JSON response from Okta.

Any ideas?

Support OSX keychain

Although the credentials we grab only work for an hour now, it's probably better that we store them somewhere a little safer than a plaintext file on disk.

Store session cookie in keychain

We've been experimenting internally with a new tool which works similarly to oktad, but stores the HTTP session cookie retrieved from Okta in the OSX Keychain / Windows Credential Vault. We're using node for our version with the keytar library for cross platform support. By storing this cookie, users are able to get keys from AWS for the duration of their Okta session without being asked for username/password/MFA which is a huge convenience.

So the feature request is to store this session cookie (the cookie name is sid) so users can get multiple keys if required.

"Error reading config file!" when run from home directory.

When I run a command, something like oktad production -- /bin/bash from my home directory I get an error message "Error reading config file!". If I move to a subdirectory inside my home directory it seems to work fine. Example:

~ : oktad production -- /bin/bash
Error reading config file!
~ : cd libs/test/mytestfolder/tf/
~/libs/test/mytestfolder/tf : oktad production -- /bin/bash
Username:

Running v0.6.0

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.