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

Authentication locks tools without stdin - windows credentials support hack #51

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ecarter-godaddy
Copy link

This pull request isn't intended to be merged as-is, but it's here to demonstrate an issue and hack solution for a problem with aws-okta-processor.

If you work with AWS entirely from the command line, then aws-okta-processor is fine. But if you ever use an AWS-aware tool that doesn't redirect stdin and stdout then aws-okta-processor, when configured as a credential_process, will wait indefinitely for user prompts that the user never receives. As an example: AWS Tools for Powershell breaks when aws-okta-processor prompts as, for some reason, it doesn't redirect stdin/stdout.

The hack I'm presenting here is a partial solution to the problem. Instead of using Python's getpass, I'm leveraging Powershell.exe to call Get-Credentials which shows the standard Windows credentials prompt. Preferably the call to Powershell should be replaced with real winapi calls, but that is considerably more effort. It also doesn't solve the problem for other operating systems. Also, I'm not handling hardware token prompts at all so that will still fail silently.

The proper solution here would be for aws-okta-processor to detect if it's running interactively and/or expose flags to control interactivity. If the process is non-interactive or is disabled by flags then it should not prompt for input and fail quickly when invoked. If the process is interactive then show the user prompt, depending on what input is available. Preferably leveraging secure credentials prompts provided by the user's operating system.

@ecarter-godaddy ecarter-godaddy marked this pull request as draft April 5, 2022 16:31
@sonarcloud
Copy link

sonarcloud bot commented Jul 25, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

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.

1 participant