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

Error parsing credentials process contained within quotes in Windows #801

Open
chaychoong opened this issue May 2, 2024 · 2 comments
Open
Labels

Comments

@chaychoong
Copy link

According to the documentation here, I should be able to do the following

credential_process = "C:\Path\To\credentials.cmd" parameterWithoutSpaces "parameter with spaces"

However, when I am using the following, it does not work:

[default]
credential_process = "C:\Program Files\aws_signing_helper\aws_signing_helper.exe" <params>

Using Process Monitor, we can see that the arguments are not being passed into the process. To reproduce this, set up the following dummy ~/.aws/config:

[default]
credential_process = "C:\Program Files\aws_signing_helper\aws_signing_helper.exe" test

Open up Process Monitor, filter by Process Name contains aws_signing_helper and Operation contains Process Start, then run docker pull, you should see the following:

CleanShot 2024-05-02 at 12 14 15@2x

Modify the ~/.aws/config to contain this:

[default]
credential_process = aws_signing_helper test

Make sure aws_signing_helper is in PATH, of course. Run docker pull again and you should see the following

CleanShot 2024-05-02 at 12 16 02@2x

Relevant info:
aws_signing_helper version: 1.1.1

@austinvazquez
Copy link
Contributor

Hi @chaychoong, thanks for reporting the issue and including so much detail. Initial triage leads me to believe this is a software bug introduced with the AWS Go SDK the credential helper uses for parsing the AWS CLI configuration. Can you share the Amazon ECR credential helper version you used when you experienced the issue?

@austinvazquez
Copy link
Contributor

Initial triage

Docker is configured to fetch credentials via Amazon ECR credential helper. Users can configure credential helper via AWS CLI configuration to fetch credentials via an external process. The credential helper uses the AWS SDK Go V2 for parsing the AWS CLI configuration and providing credentials.

Docker -> Amazon ECR Credential Helper -> External Process (via .aws/config)

The issue occurs when the external process is quoted for encapsulating a file path or parameter with spaces:
From AWS CLI v2 user guide:

  • If the path or file name contains a space, surround the complete path and file name with double-quotation marks (" "). The path and file name can consist of only the characters: A-Z a-z 0-9 - _ . space
  • If a parameter name or a parameter value contains a space, surround that element with double-quotation marks (" "). Surround only the name or value, not the pair.

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

No branches or pull requests

2 participants