-
Notifications
You must be signed in to change notification settings - Fork 618
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
windows: support special characters in the password for FSx #3669
Conversation
Please do not merge yet. I realised that these changes work for special chars but not for |
b553bdc
to
332235f
Compare
Presently, When a password contains characters that contain escape sequences such as a quotation mark PowerShell fails the command. Reference: aws#3270 To mitigate the same and support handling of special characters, we are making the change to use single quoted strings. This means that the password is passed-on to Powershell as it is without any substitutions. Reference: https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_quoting_rules?view=powershell-5.1#single-quoted-strings
This PR is ready for review now. We have added the support for special characters including
Above is not exactly true. This becomes a bug when we use AWSCLI to set the secret in Secret Manager. However, when we use Console or SDK to set the secret, we can use escaped characters as well. So when we use Console/SDK, we can directly set the password. Let's assume we are storing password However, when we use CLI, we need to create the JSON string which leads to double escaping. For example, in above example, we will have to enter |
Can we work with doc writers to state this limitation somewhere on public docs so customers dont have future issues with this? |
|
@arun-annamalai Our fix works for all the special characters including |
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.
Looks good, thanks for making this change!
Summary
Presently, When a password contains characters that contain escape sequences such as a quotation mark PowerShell fails the command. Reference: #3270
To mitigate the same and support handling of special characters, we are making the change to use single quoted strings. This means that the password is passed-on to Powershell as it is without any substitutions. Reference: https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_quoting_rules?view=powershell-5.1#single-quoted-strings
Implementation details
Instead of using double quotes, we are using single quotes which means that Powershell would be passed-on a value without any substitution.
Testing
Created an ECS instance with the custom agent. We used a password which had many special characters.
Tested that the task with FSx volume was running successfully on the instance,
New tests cover the changes:
Yes
Description for the changelog
windows: support special characters in the password for FSx
Licensing
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.