-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Add -AsPlainText to ConvertFrom-SecureString
#11142
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
Add -AsPlainText to ConvertFrom-SecureString
#11142
Conversation
PaulHigin
left a comment
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.
LGTM
|
should this be marked as rc.1-consider milestone? |
|
Need to update PR based on @PowerShell/powershell-committee decision that |
|
Codacy appears to be wrong, VSCode complains if I remote the assignment since the finally block may use an unassigned variable. |
|
I think removing the hard requirement for The reason is really simple: someone looking for how to perform such a task in PowerShell is Ease of use is less important than guiding scripters towards a better understanding of the security implications when working with plain-text passwords in scripts. People are lazy. Make it too easy for them, and they'll take the easy way without thinking about why they shouldn't do that. Also, FWIW, if the @PowerShell/powershell-committee thinks |
|
What's the point on non-Windows platforms where "SecureString" is a bit of a lie anyway? Requiring That said, once we get the Secrets management module, I don't see the
Wouldn't PSScriptAnalyzer serve this purpose better?
|
In my mind it's not about
Agreed.
PSScriptAnalyzer could and should raise warnings for various things related to plain text passwords, but that's only helpful if folks use PSSA. In my opinion, from a security/awareness perspective, pairing |
|
My motivation for adding this capability is specifically for Secrets Management module. Secrets Management will always return a SecureString type. You would use this cmdlet to convert to plain text, if needed. As for |
Even though the CoreFx team is clearly recommending not to use this type for new development? |
|
@rkeithhill Until corefx provides a SensitiveString type to replace SecureString, we still need a type that doesn't implement |
For the uncommon occurrence where you want to convert plain text into a When you say it's unnecessary and just adds to annoyance or invites users to add
...or into a file as a stored secret, or pull plain text from a file to use as a secret. IMHO the change in behavior of |
|
@TravisEz13 Is this ready to merge? |
|
🎉 Handy links: |
PR Summary
Fix #11067
PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:or[ WIP ]to the beginning of the title (theWIPbot will keep its status check atPendingwhile the prefix is present) and remove the prefix when the PR is ready.