-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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
ConvertFrom-SecureString is broken on Linux #1654
Comments
Seems to be CoreCLR that is lacking. |
Talked @KrishnaV-MSFT This is not needed for Azure demo. Moving it out of Alpha.10 |
Came across the same error on MacOS 10.12 Beta (16A270f) Was just messing around got this:
Result:
|
Hi, same library error when trying to use mapped cert: psdrive:
Error:
|
@35359595 good finding! The error definitely should be friendlier. On Linux and macOS |
Fyi, 16.04.1 with PowerShell v6 alpha 14 still has this same issue |
This is holding me back from bringing my modules over to Linux. I'd like to be able to store Web API keys securely on all OSes, not just Windows. |
This is something we'll only be able to enable with the .NET Standard 2.0 APIs that bring back SecureString:
|
|
Until this gets fixed, here's code to securely pass a credential to a background job:
|
how is this supposed to work if this has an issue itself? anyways, tried your script though but got error:
so i tried to define username and password in a variable but:
|
Why there is no separate issue for passing secure string over psremote? All opened issues closed as duplicates of this. In my opinion problem is different.
Btw, we can add exception handler showing message that securestring not supported yet ^ it's quite hard to realise it related to securestrings if it hangs like that. I think psremoting can be fixed without fixing ConvertFrom-SecureString commandlet, because we don't need to store keys on machine for later use. We need only generate rsa 2048 key pair, crypt/decrypt using rsa, crypt decrypt using AES CBC crossplatform.
Some good news there is crossplatform workaround. |
@KKomarov Please open new issue with repo steps and your suggestion. |
DE0001: SecureString shouldn't be used |
While that's nice in a perfect ivory tower world, in Powershell we are constantly gluing things together and that requires authenticating in whatever format that application requires, be it rest API, legacy application that only supports Basic authenticaiton, etc. We can't just simply "use windows credentials or certificates" for everything as this recommendation states, that's a nice recommendation for developing a new app, but not what we use powershell for. It's not like PSCredential is going anywhere which is an implementation of SecureString, so until we have something in .net core that can use a TPM to encrypt keys or something, we need a "good enough" option. Something like using AES256 and having the encryption key be a 600 permission-ed file on the non-windows file system is a possible start, not much worse than using the Crypto API in Windows |
I added the link for information only. Essentially:
|
Early on, the @PowerShell/powershell-committee discussed introducing a |
thanks for the update, looks promising! |
Does anyone have a link to the fix or know what release version it will be available in? I'm still getting crypt32.dll errors in powershell_6.1.3-1.ubuntu.16.04_amd64.deb (same deal with the 6.2.0-rc.1 preview package). I'm also curious how this fix affects Import/Export-CliXml when the data to be serialized contains SecureString or PSCredential objects. |
@rmbolger Could you please check with latest build (6.2.0-RC)? |
I'm seeing the same as @rmbolger
|
The cmdlets load directly the CRYPT32.dll
|
On Unix systems, fallback to plaintext manipulation instead of using the DPAPI which is not available. ## PR Context Currently, existing scripts that use SecureString cmdlets fail with an error complaining about crypt32.dll not being available. This change allows these cmdlets to be used, but there is no encryption of the string. .Net already [states](https://docs.microsoft.com/en-us/dotnet/api/system.security.securestring?view=netcore-2.1#remarks) that the contents of a SecureString are not encrypted on .Net Core. Fix #1654 Co-authored-by: Travis Plunk <[email protected]>
On Unix systems, fallback to plaintext manipulation instead of using the DPAPI which is not available. ## PR Context Currently, existing scripts that use SecureString cmdlets fail with an error complaining about crypt32.dll not being available. This change allows these cmdlets to be used, but there is no encryption of the string. .Net already [states](https://docs.microsoft.com/en-us/dotnet/api/system.security.securestring?view=netcore-2.1#remarks) that the contents of a SecureString are not encrypted on .Net Core. Fix #1654 Co-authored-by: Travis Plunk <[email protected]>
Steps to reproduce
Expected behavior
No error
Actual behavior
The following error is thrown
Environment data
Updates by @TravisEz13 on 2016-04-10
Environment data
Workaround
The following works
The text was updated successfully, but these errors were encountered: