-
Notifications
You must be signed in to change notification settings - Fork 264
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
Automate prompt for mfa, app, role selections #354
base: master
Are you sure you want to change the base?
Conversation
b81bbd3
to
02639fa
Compare
@@ -578,4 +587,4 @@ def fail_if_profile_not_found(self, profile_config, conf_profile, default_sectio | |||
""" | |||
if not profile_config and conf_profile == default_section: | |||
raise errors.GimmeAWSCredsError( | |||
'DEFAULT profile is missing! This is profile is required when not using --profile') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no idea why there is a change on this line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was done by your editor when you saved the file, not a big deal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your editor added a newline character at the end of the line. GitHub indicates the absence of this with a red circle around a horizontal line. When the character exists at the end of the last line of the file, GitHub just shows the line from the file. You can see the difference locally by running tail <filename>;echo foobar
and if the trailing newline is not present "foobar" will appear appended to the last line, if the trailing newline does exist, "foobar" will be on its own line. The absence of a trailing newline can cause issues with file handling, particularly with older tools (though they're likely just working as intended).
@@ -145,6 +147,8 @@ def get_args(self): | |||
'--action-setup-fido-authenticator', action='store_true', | |||
help='Sets up a new FIDO WebAuthn authenticator in Okta' | |||
) | |||
parser.add_argument('--okta-app', type=int) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added two of new arguments; --okta-app
, --okta-role
are automatically select the specific app and role.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the inputs should be the app and role names, not their position in the list from Okta. Those positions will change as accounts/roles are added and removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also, there are existing config options for these settings (aws_appname
and aws_rolename
) the parameters should match those names
@@ -549,6 +557,9 @@ def okta(self): | |||
if self.conf_dict.get('preferred_mfa_type'): | |||
okta.set_preferred_mfa_type(self.conf_dict['preferred_mfa_type']) | |||
|
|||
if self.conf_dict.get('preffered_mfa_provider'): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added preffered_mfa_provider
option in okta_aws_login_config
. This will automatically select the specific mfa provider type like GOOGLE
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The concept for the changes are good, but some changes are needed to align them with the rest of the code.
@@ -549,6 +557,9 @@ def okta(self): | |||
if self.conf_dict.get('preferred_mfa_type'): | |||
okta.set_preferred_mfa_type(self.conf_dict['preferred_mfa_type']) | |||
|
|||
if self.conf_dict.get('preffered_mfa_provider'): | |||
okta.set_preferred_mfa_provider(self.conf_dict['preffered_mfa_provider']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spelling error - preferred_mfa_provider
, not preffered_mfa_provider
@@ -145,6 +147,8 @@ def get_args(self): | |||
'--action-setup-fido-authenticator', action='store_true', | |||
help='Sets up a new FIDO WebAuthn authenticator in Okta' | |||
) | |||
parser.add_argument('--okta-app', type=int) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the inputs should be the app and role names, not their position in the list from Okta. Those positions will change as accounts/roles are added and removed.
@@ -145,6 +147,8 @@ def get_args(self): | |||
'--action-setup-fido-authenticator', action='store_true', | |||
help='Sets up a new FIDO WebAuthn authenticator in Okta' | |||
) | |||
parser.add_argument('--okta-app', type=int) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also, there are existing config options for these settings (aws_appname
and aws_rolename
) the parameters should match those names
Description
I implemented that the prompts can be skipped by configuring
~/.okta_aws_login_config
and command line arguments.Related Issue
Motivation and Context
To get AWS credentials, multiple prompts are required like the followings.
Because of the prompts, it is impossible to automate process to get AWS credentials. With my codes, the process will be changed like the following.
How Has This Been Tested?
I manually tested the code in my local. If you have any idea to test this code, please let me know.
Screenshots (if appropriate):
Types of changes
Checklist: