|
|
|
[
Permlink
| « Hide
]
Robin Shen [17/Jan/19 06:17 AM]
Currently git password is displayed in the config file, and customer does not like this behavior.
I think this is still a topic and a way how to mitigate that is to create a script or any other binary with:
----------------------------------------- #!/bin/bash echo $GIT_PASSWORD ----------------------------------------- and run the git command with the environment variables GIT_ASKPASS=/path/to/askpass-script.sh GIT_PASSWORD=<the password> set this way it will use the password supplied via the environment variable and not store it at all because it is no part of the URL The benefit of using this approach is that the password is only visible in plaintext to the git process (and of course if you have the knowledge how to get the environment variables of another process, but at least it is not stored permanently) Another even more secure way would be to have a logic to decrypt the password in the script and store the PW encrypted in GIT_PASSWORD, so the only way how to get the PW would be to read the memory of the git process and extract the PW from there somehow. One addition: I did not test these. The stack overflow entry here https://stackoverflow.com/questions/8536732/can-i-hold-git-credentials-in-environment-variables claims that the method I described also will store the PW in the config file. So this is something to test.
|