Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating to use the AWS 2.0 SDK #364

Merged
merged 4 commits into from
Jul 29, 2021
Merged

Conversation

DavidTanner
Copy link
Contributor

Problem Statement

The AWS SDK was significantly out of date. Also, the withokta script made it difficult to use when not actually sending an aws --profile command.

Solution

Updated to the Java 2 SDK and removed the obfuscation around profile.

@mraible
Copy link

mraible commented Jun 7, 2021

@DavidTanner Can you please resolve conflicts in this PR?

# Conflicts:
#	pom.xml
#	src/main/java/com/okta/tools/OktaAwsCliEnvironment.java
@DavidTanner
Copy link
Contributor Author

@mraible Sorry, I missed your message.

@DavidTanner
Copy link
Contributor Author

@mraible @aaronpk @rdegges or @robert-chiniquy I'd really like to get this merged so we can start using it. I've been using it locally for months.

@bdemers
Copy link
Contributor

bdemers commented Jul 21, 2021

@DavidTanner great PR!

Looks good!

  • lots of package name changes
  • fluent method's drop the with
  • region is no longer a simple string
  • minor regex change to add -gov (plus a test ❤️)

Longer-term question:
It's been a while since I've looked at this project, so forgive me for asking.
Is this tool still needed now that the v2 version of the AWS CLI supports SSO directly

IIRC, The AWS CLI v2 uses an OAuth Device Grant (e.g. similar to login /w Netflix using a code on your TV), which will pop a browser if possible. Then AWS does the SAML dance with Okta.

Either way, getting this in and released would help folks in the short term 😄

@DavidTanner
Copy link
Contributor Author

@bdemers It looks like SSO isn't available in GovCloud yet which is why we still need it. Is there anything else I need to add to this PR to get it merged?

@bdemers bdemers merged commit 2f3a60a into oktadev:master Jul 29, 2021
@bdemers
Copy link
Contributor

bdemers commented Jul 29, 2021

@DavidTanner Thanks for the note about SSO in GovCloud!

I'll chat with the other maintainers about cutting a release early next week.

Thanks again!!

@dangeReis
Copy link
Contributor

@DavidTanner @bdemers while they may have fixed things for those not using a profile, it broke things when actually using a profile.

#374 #375 #376

Can we either roll this back, or fix the other issues? This is unusable in the current state if you are using a profile.

@DavidTanner
Copy link
Contributor Author

@dangeReis The changes I made are breaking. I updated the Readme accordingly. You should start using the OKTA_PROFILE to set the profile name.

@dangeReis
Copy link
Contributor

@DavidTanner which Readme did you update? I'm not seeing anything relevant here:
https://github.com/oktadev/okta-aws-cli-assume-role/blob/master/Readme.MD

Specifically, commands like this don't currently work properly:

okta-aws test sts get-caller-identity

@DavidTanner
Copy link
Contributor Author

I see the issue. Would the preferred functionality be then to force the okta profile to match the aws one? At my company one OKTA_PROFILE gives us access to multiple aws profiles. I can put up a PR to fix the scripts.

@dangeReis
Copy link
Contributor

At my company, once you authenticate with OKTA, it locks you into an AWS role. If you want a different role/account, you need to use a different okta profile or clear our some session files. Not quite sure how you are using this.

We currently associate the okta profile with the appropriate role/account that we want and just reauthenticate when the timeout expires. This allows us to use multiple profiles at the same time if we needed to.

@DavidTanner
Copy link
Contributor Author

~/.aws/config

[profile company-dev]
region = SOME_REGION
role_arn = SOME_ARN
source_profile = SOME_OKTA_PROFILE
BASH_PROFILE="SOME_OKTA_PROFILE" AWS_PROFILE="company-dev" AWS_SDK_LOAD_CONFIG="1" withOkta aws ...

~/.aws/credentials

[SOME_OKTA_PROFILE]
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants