Closed
Conversation
3 tasks
|
This and #536 seem to be working on similar problems are are both very useful features. Is there anything I can do to help get these merged? |
Contributor
|
Hello @alcastronic & @adrianbn ! Can we resolve the conflicts? Cheers! |
Collaborator
|
gitleaks does not clone in v8 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
Currently gitleaks only has support for ssh keys without a pasphrase. This PR adds the ability to specify the passphrase
for an ssh key via the command line. The password will be retrieved by
syscall.Stdinhence the importsyscallwas added.Furthermore functionallity to support ssh agent authentication is added via the
NewSSHAgentAuthfunction from go-git.Fixes #263 How to pass SSH key password as argument?
ssh key with passphrase
It is possible to use an ssh key with passphrase either by specifing an ssh key with the
--ssh-key=option oruse the default key file location. The ssh passphrase will be retrieved in an interactive prompt when the flag
--ssh-passis specified on the commandline.
Specify an ssh key and ask for the passphrase.
# ./build/gitleaks-linux-amd64 --ssh-key=/home/tronic/.ssh/id_rsa --ssh-pass -r git@github.com:zricethezav/gitleaks.git Enter Password: INFO[0004] cloning... git@github.com:zricethezav/gitleaks.git INFO[0024] scan time: 17 seconds 770 milliseconds 891 microseconds INFO[0024] commits scanned: 612 WARN[0024] leaks found: 745ssh key default location and passphrase
When the
--ssh-keyoption is ommitted the default key location under/home/$user/.ssh/id_rsawill be used.ssh agent
It is also possible to authenticate with an ssh agent.
--ssh-agentoptionWhen the ssh agent option is used gitleaks opens a channel to the local ssh agent.
Checklist: