Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/gitleaks/gitleaks
/ functions
Functions
501 in github.com/gitleaks/gitleaks
⨍
Functions
501
◇
Types & classes
65
↓ 319 callers
Function
NewSecret
(regex string)
cmd/generate/secrets/regen.go:9
↓ 302 callers
Function
MustCompile
(str string)
regexp/wasilibs_regex.go:13
↓ 223 callers
Function
GenerateSampleSecrets
See: https://github.com/gitleaks/gitleaks/issues/1222
cmd/generate/config/utils/generate.go:85
↓ 218 callers
Function
Validate
(rule config.Rule, truePositives []string, falsePositives []string)
cmd/generate/config/utils/validate.go:16
↓ 179 callers
Function
AlphaNumeric
(size string)
cmd/generate/config/utils/patterns.go:19
↓ 103 callers
Function
GenerateSemiGenericRegex
(identifiers []string, secretRegex string, isCaseInsensitive bool)
cmd/generate/config/utils/generate.go:34
↓ 61 callers
Function
Hex
(size string)
cmd/generate/config/utils/patterns.go:15
↓ 59 callers
Function
Fatal
()
logging/log.go:44
↓ 53 callers
Function
GenerateUniqueTokenRegex
(secretRegex string, isCaseInsensitive bool)
cmd/generate/config/utils/generate.go:69
↓ 35 callers
Function
Numeric
(size string)
cmd/generate/config/utils/patterns.go:11
↓ 32 callers
Function
AlphaNumericExtended
(size string)
cmd/generate/config/utils/patterns.go:27
↓ 29 callers
Function
Debug
()
logging/log.go:26
↓ 26 callers
Function
AlphaNumericExtendedShort
(size string)
cmd/generate/config/utils/patterns.go:23
↓ 23 callers
Function
GenerateSampleSecret
(identifier string, secret string)
cmd/generate/config/utils/generate.go:80
↓ 20 callers
Function
Error
()
logging/log.go:36
↓ 17 callers
Method
Close
Close closes the underlying reader and then waits for the command to complete, releasing its resources.
sources/git.go:45
↓ 17 callers
Method
String
()
cmd/scm/scm.go:21
↓ 16 callers
Function
Warn
()
logging/log.go:32
↓ 13 callers
Function
Hex8_4_4_4_12
()
cmd/generate/config/utils/patterns.go:35
↓ 13 callers
Method
PathAllowed
PathAllowed returns true if the path is allowed to be ignored.
config/allowlist.go:136
↓ 12 callers
Method
Translate
()
config/config.go:109
↓ 10 callers
Method
FullPath
FullPath returns the File.Path with any preceding outer paths
sources/file.go:254
↓ 10 callers
Function
Info
()
logging/log.go:29
↓ 10 callers
Function
newPlausibleSecret
(regex string)
cmd/generate/config/rules/generic.go:283
↓ 9 callers
Method
String
()
config/allowlist.go:20
↓ 9 callers
Function
mustGetStringFlag
(cmd *cobra.Command, name string)
cmd/root.go:542
↓ 8 callers
Method
DetectSource
DetectSource scans the given source and returns a list of findings
detect/detect.go:208
↓ 8 callers
Method
RegexAllowed
RegexAllowed returns true if the regex is allowed to be ignored.
config/allowlist.go:149
↓ 8 callers
Method
String
String displays the command used for GitCmd
sources/git.go:193
↓ 8 callers
Method
Validate
Validate guards against common misconfigurations.
config/rule.go:64
↓ 7 callers
Method
AddGitleaksIgnore
(gitleaksIgnorePath string)
detect/detect.go:153
↓ 7 callers
Method
Detect
Detect scans the given fragment and returns a list of findings
detect/detect.go:270
↓ 7 callers
Function
NewDetector
NewDetector creates a new detector with the given config
detect/detect.go:115
↓ 7 callers
Function
NewDetectorDefaultConfig
NewDetectorDefaultConfig creates a new detector with the default config
detect/detect.go:135
↓ 7 callers
Function
With
()
logging/log.go:18
↓ 6 callers
Method
Close
()
report/report_test.go:40
↓ 6 callers
Method
CommitAllowed
CommitAllowed returns true if the commit is allowed to be ignored.
config/allowlist.go:117
↓ 6 callers
Function
CreateGlobalConfig
()
cmd/generate/config/base/config.go:11
↓ 6 callers
Method
Fragments
Fragments yields fragments for the this source
sources/file.go:52
↓ 6 callers
Method
String
String returns a string representation for clearer debugging
detect/codec/start_end.go:55
↓ 6 callers
Method
detectRule
detectRule scans the given fragment for the given rule and returns a list of findings
detect/detect.go:371
↓ 6 callers
Function
mustGetBoolFlag
(cmd *cobra.Command, name string)
cmd/root.go:526
↓ 5 callers
Function
Config
(cmd *cobra.Command)
cmd/root.go:234
↓ 5 callers
Function
Detector
(cmd *cobra.Command, cfg config.Config, source string)
cmd/root.go:249
↓ 5 callers
Function
Trace
()
logging/log.go:22
↓ 5 callers
Function
ValidateWithPaths
(rule config.Rule, truePositives map[string]string, falsePositives map[string]string)
cmd/generate/config/utils/validate.go:41
↓ 5 callers
Method
Wait
Wait waits for the command to exit and waits for any copying to stdin or copying from stdout or stderr to complete. Wait also closes underlying stdou
sources/git.go:188
↓ 5 callers
Function
findingSummaryAndExit
(detector *detect.Detector, findings []report.Finding, exitCode int, start time.Time, err error)
cmd/root.go:438
↓ 5 callers
Function
initConfig
(source string)
cmd/root.go:132
↓ 5 callers
Function
initDiagnostics
()
cmd/root.go:197
↓ 5 callers
Method
overlaps
overlaps returns true if two startEnds overlap
detect/codec/start_end.go:31
↓ 4 callers
Method
PrintRequiredFindings
()
report/finding.go:102
↓ 4 callers
Function
compare
(t *testing.T, a, b []report.Finding)
detect/detect_test.go:100
↓ 4 callers
Function
moveDotGit
(t *testing.T, from, to string)
detect/detect_test.go:2432
↓ 4 callers
Function
mustGetIntFlag
(cmd *cobra.Command, name string)
cmd/root.go:534
↓ 3 callers
Method
AddFinding
AddFinding synchronously adds a finding to the findings slice
detect/detect.go:711
↓ 3 callers
Method
DetectGit
DetectGit runs detections against a GitCmd with its remote info Deprecated: Use sources.Git and detector.DetectSource instead
detect/git.go:19
↓ 3 callers
Method
DetectString
DetectString scans the given string and returns a list of findings
detect/detect.go:201
↓ 3 callers
Function
NewDetectorContext
NewDetectorContext is the same as NewDetector but supports passing in a context to use for timeouts
detect/detect.go:121
↓ 3 callers
Function
NewGitDiffCmdContext
NewGitDiffCmdContext is the same as NewGitDiffCmd but supports passing in a context to use for timeouts
sources/git.go:136
↓ 3 callers
Function
NewGitLogCmdContext
NewGitLogCmdContext is the same as NewGitLogCmd but supports passing in a context to use for timeouts
sources/git.go:71
↓ 3 callers
Function
NewRemoteInfoContext
NewRemoteInfoContext is the same as NewRemoteInfo but supports passing in a context to use for timeouts
sources/git.go:440
↓ 3 callers
Function
NewTemplateReporter
(templatePath string)
report/template.go:19
↓ 3 callers
Method
Redact
Redact removes sensitive information from a finding.
report/finding.go:78
↓ 3 callers
Method
Write
(w io.WriteCloser, findings []Finding)
report/report.go:15
↓ 3 callers
Function
createScmLink
(remote *sources.RemoteInfo, finding report.Finding)
detect/utils.go:23
↓ 3 callers
Function
fileExists
(fileName string)
cmd/root.go:502
↓ 3 callers
Method
merge
merge takes two start/ends and returns a single one that encompasses both
detect/codec/start_end.go:47
↓ 3 callers
Function
printFinding
(f report.Finding, noColor bool)
detect/utils.go:168
↓ 3 callers
Function
shouldSkipPath
shouldSkipPath checks a path against all the allowlists to see if it can be skipped
sources/common.go:38
↓ 3 callers
Function
testTranslate
(t *testing.T, test translateCase)
config/config_test.go:579
↓ 2 callers
Function
AlphaNumericExtendedLong
(size string)
cmd/generate/config/utils/patterns.go:31
↓ 2 callers
Method
ContainsStopWord
(s string)
config/allowlist.go:161
↓ 2 callers
Method
Decode
Decode returns the data with the values decoded in place along with the encoded segment meta data for the next pass of decoding
detect/codec/decoder.go:23
↓ 2 callers
Method
DetectContext
DetectContext is the same as Detect but supports passing in a context to use for timeouts
detect/detect.go:276
↓ 2 callers
Method
DetectFiles
DetectFiles runs detections against a chanel of scan targets Deprecated: Use sources.Files and Detector.DetectSource instead
detect/files.go:17
↓ 2 callers
Function
DirectoryTargets
Deprecated: Use Files and detector.DetectSource instead
sources/files.go:23
↓ 2 callers
Function
FormatDuration
(d time.Duration)
cmd/root.go:517
↓ 2 callers
Function
IsNew
(finding report.Finding, redact uint, baseline []report.Finding)
detect/baseline.go:12
↓ 2 callers
Function
LoadBaseline
(baselinePath string)
detect/baseline.go:37
↓ 2 callers
Method
NewBlobReaderContext
NewBlobReaderContext is the same as NewBlobReader but supports passing in a context to use for timeouts
sources/git.go:207
↓ 2 callers
Function
NewDecoder
NewDecoder creates a default decoder struct
detect/codec/decoder.go:15
↓ 2 callers
Function
NewRemoteInfo
Deprecated: use sources.NewRemoteInfo instead
detect/git.go:33
↓ 2 callers
Function
PlatformFromString
(s string)
cmd/scm/scm.go:33
↓ 2 callers
Method
Read
(p []byte)
detect/reader_test.go:25
↓ 2 callers
Method
Write
(w io.WriteCloser, findings []Finding)
report/json.go:13
↓ 2 callers
Function
abs
abs returns the absolute value of an integer
detect/detect.go:703
↓ 2 callers
Method
add
add adds the values of two startEnds
detect/codec/start_end.go:23
↓ 2 callers
Method
addCommit
AddCommit synchronously adds a commit to the commit slice
detect/detect.go:757
↓ 2 callers
Function
allTrue
(bools []bool)
detect/detect.go:893
↓ 2 callers
Function
anyRegexMatch
(f string, res []*regexp.Regexp)
config/utils.go:9
↓ 2 callers
Function
checkCommitOrPathAllowed
checkCommitOrPathAllowed evaluates |fragment| against all provided |allowlists|. If the match condition is "OR", only commit and path are checked. Ot
detect/detect.go:767
↓ 2 callers
Function
checkFindingAllowed
checkFindingAllowed evaluates |finding| against all provided |allowlists|. If the match condition is "OR", only regex and stopwords are run. (Commit
detect/detect.go:823
↓ 2 callers
Function
createSingleRuleDetector
(r *config.Rule)
cmd/generate/config/utils/validate.go:69
↓ 2 callers
Function
decodeIndividualEscapes
decodeIndividualEscapes decodes individual Unicode escape sequences (\u1234 format) This is a fallback for when we don't have a continuous sequence of
detect/codec/unicode.go:225
↓ 2 callers
Method
extend
(extensionConfig Config)
config/config.go:420
↓ 2 callers
Method
fileFragments
fileFragments reads the file into fragments to yield
sources/file.go:167
↓ 2 callers
Function
getMessage
(f Finding)
report/junit.go:71
↓ 2 callers
Function
hasByte
hasByte can be used to check if a string has at least one of the provided bytes. Note: make sure byteset is long enough to handle the largest byte in
detect/codec/ascii.go:27
↓ 2 callers
Function
isPrintableASCII
isPrintableASCII returns true if all bytes are printable ASCII
detect/codec/ascii.go:14
next →
1–100 of 501, ranked by callers