Find, verify, and analyze leaked credentials
Go credentialsdevsecopsdynamic-analysisprecommitscanningsecretsecret-managementsecretssecuritysecurity-toolstrufflehogverification
Fix wrong line number in private key detector (#4485) (#4486)
Maciek Sobczak1ef44e7987e3
diff --git a/pkg/detectors/privatekey/privatekey.go b/pkg/detectors/privatekey/privatekey.goindex f07e7bb4b..8deaa0575 100644--- a/pkg/detectors/privatekey/privatekey.go+++ b/pkg/detectors/privatekey/privatekey.go@@ -71,6 +71,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultExtraData: make(map[string]string),}+ // set not normalized match as primary secret value so it is used to calculate line of code+ s1.SetPrimarySecretValue(match)+var passphrase stringparsedKey, err := ssh.ParseRawPrivateKey([]byte(token))if err != nil && strings.Contains(err.Error(), "private key is passphrase protected") {