-
Notifications
You must be signed in to change notification settings - Fork 86
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
FeatureRequest: Enable scrypt to get password from file or environment variable #183
Comments
Can't this be done with -P ? Something like (untested)
|
We do this in our test suite: see
|
though that is indeed a possibility i could sleep sounder if scrypt would care about fetching the password. there are in personal and professional environments multitudes of failures. For me, a file (given via parameter) or environment variable (name fixed on compilation) is more sane than echoing the password into scrypt. current examples on my mind are:
And i must admit i oversaw the second sentence in the manpage for -P which said give password only ONCE. i thought i had to input it two times via stdin, therefore i thought of expect. |
Well, we can avoid
Some shells will let you do
but that's not standard POSIX. Both of these options appear to be good against Could you please elaborate on the threat(s) that you anticipate? |
Of course, thank you! #!/bin/bash If now any pipe with scrypt FAILS, it fails silently and continues, and nothing is encrypted and nothing is pushed. there may be even shell constructs which would push cleartext files to the remote storage. The Threats i see and fear are, that through malicious or flawed shellscripting:
And Shell scripting can be more easily obfuscated, that even with a peer review process that can slip through. If the password can be provided via file, like e.g. ansible-vault does that, too, this makes it easier to protect other files with it and people can reason more easily about the scripts which use scrypt. |
I'm afraid that I still don't follow. Your proposed script contains:
How is that less safe than a theoretical
? Is there a risk that |
Pipes can fail (for example, macosx has another pipe behaviour than linux), cat can fail, shellscripts may have bugs. Shortly said, depending on the quality of your scripts i rather trust scrypt more to do the right thing with fetching and using the password, than shellscripts which can fail in a myriad of ways. |
If your shell can't reliably redirect a program's standard input (either |
Hi @dkmbw, The master branch of scrypt now includes |
That's SO cool! Thank you very much! |
Hi,
i would like to use scrypt in a CICD pipeline. and the current mechanism would need stuff like expect. Is there a possibility, that a password can be used from the process environment or from a certain file which name can be shown via parameter to scrypt?
That would be really helpful.
The text was updated successfully, but these errors were encountered: