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

Cannot use credential_process on the default configuration #8860

Closed
luizbob opened this issue Aug 11, 2024 · 6 comments
Closed

Cannot use credential_process on the default configuration #8860

luizbob opened this issue Aug 11, 2024 · 6 comments
Assignees
Labels
bug This issue is a bug. closed-for-staleness configuration p2 This is a standard priority issue response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. sts

Comments

@luizbob
Copy link

luizbob commented Aug 11, 2024

Describe the bug

When I try to use the AWS default profile using credential_process the cli gets stuck on the process. My setup looks like this one available on the aws documentation on how to use the cli from a VM on GCP https://aws.amazon.com/blogs/security/access-aws-using-a-google-cloud-platform-native-workload-identity/
Config file:

[default]
credential_process = /opt/bin/credentials.sh

Expected Behavior

Generated the credential and use the default configuration with credential_process

Current Behavior

The command frozes and nothing happens, if not stopped, the VM frozes.
debug_awscli.txt
Debug logs on the file above, command executed was aws sts get-caller-identity --debug

Reproduction Steps

Follow the steps on this link: https://aws.amazon.com/blogs/security/access-aws-using-a-google-cloud-platform-native-workload-identity/ and change the config for instead of using a profile to be the default config.

Possible Solution

No response

Additional Information/Context

VM on Google cloud with a specific service account, if I try to use the setup as demonstrated on the documentation https://aws.amazon.com/blogs/security/access-aws-using-a-google-cloud-platform-native-workload-identity/ the config works as intended, but dont work when set as the default config

If the variable AWS_PROFILE is set as the profile that its configured with the credential_process, eg:

[profile aws]
credential_process = /opt/bin/credentials.sh

The same problem happens

CLI version used

aws-cli/2.17.26 Python/3.11.9

Environment details (OS name and version, etc.)

Ubuntu 24.04 LTS X64

@luizbob luizbob added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Aug 11, 2024
@tim-finnigan tim-finnigan self-assigned this Aug 14, 2024
@tim-finnigan tim-finnigan added the investigating This issue is being investigated and/or work is in progress to resolve the issue. label Aug 14, 2024
@tim-finnigan
Copy link
Contributor

Thanks for reaching out. Could you expand on this a bit more:

if I try to use the setup as demonstrated on the documentation https://aws.amazon.com/blogs/security/access-aws-using-a-google-cloud-platform-native-workload-identity/ the config works as intended, but dont work when set as the default config

I'm trying to understand specifically what are the conditions in which this is and is not working. Also for reference here is documentation on using credential_process in the AWS CLI:

(Also this documentation on credentials shows where custom processes are in the order of precedence.)

@tim-finnigan tim-finnigan added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. p2 This is a standard priority issue configuration and removed investigating This issue is being investigated and/or work is in progress to resolve the issue. needs-triage This issue or PR still needs to be triaged. labels Aug 14, 2024
@luizbob
Copy link
Author

luizbob commented Aug 15, 2024

Basically, I followed this https://aws.amazon.com/blogs/security/access-aws-using-a-google-cloud-platform-native-workload-identity/ on how to configure for gcp VM instance.
In this blog post, the only thing that I changed was to set the credential_process as the default process to get the credentials from AWS.

The files was as following:

.aws/credentials

[default]
credential_process = /opt/bin/credentials.sh

Then I tested it, and got the logs that I provided.

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Aug 15, 2024
@tim-finnigan
Copy link
Contributor

Thanks for following up. I saw Max number of attempts exceeded (1) when attempting to retrieve data from metadata service.. Could you try increasing the retries (see: https://docs.aws.amazon.com/cli/v1/userguide/cli-configure-retries.html) to ensure this wasn't caused by a transient network issue? Can you also confirm that you have the necessary IAM permissions to authenticate, and no proxy configurations that would be preventing the connection?

@tim-finnigan tim-finnigan added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. sts labels Aug 27, 2024
Copy link

github-actions bot commented Sep 7, 2024

Greetings! It looks like this issue hasn’t been active in longer than five days. We encourage you to check if this is still an issue in the latest release. In the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment or upvote with a reaction on the initial post to prevent automatic closure. If the issue is already closed, please feel free to open a new one.

@github-actions github-actions bot added the closing-soon This issue will automatically close in 4 days unless further comments are made. label Sep 7, 2024
@luizbob
Copy link
Author

luizbob commented Sep 10, 2024

Sorry for the delay on my response, I'll try the config.

@github-actions github-actions bot removed closing-soon This issue will automatically close in 4 days unless further comments are made. response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. labels Sep 10, 2024
@tim-finnigan tim-finnigan added the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Sep 10, 2024
Copy link

Greetings! It looks like this issue hasn’t been active in longer than five days. We encourage you to check if this is still an issue in the latest release. In the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment or upvote with a reaction on the initial post to prevent automatic closure. If the issue is already closed, please feel free to open a new one.

@github-actions github-actions bot added closing-soon This issue will automatically close in 4 days unless further comments are made. closed-for-staleness and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. closed-for-staleness configuration p2 This is a standard priority issue response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. sts
Projects
None yet
Development

No branches or pull requests

2 participants