diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f9eb2cea..397d0a3c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -78,7 +78,7 @@ If you want to add a new rule to the [default Gitleaks configuration](https://gi token that is unique enough not to require an identifier then you can use this function. For example, Pulumi's API Token has the prefix `pul-` which is unique enough to use `generateUniqueToken`. But something like Beamer's API - token that has a `b_` prefix is not unqiue enough to use `generateUniqueToken`, + token that has a `b_` prefix is not unique enough to use `generateUniqueToken`, so instead we use `generateSemiGenericRegex` and require a `beamer` identifier is part of the rule. If a token's prefix has more than `3` characters then you could diff --git a/README.md b/README.md index b84a4d91..0a9bef4c 100644 --- a/README.md +++ b/README.md @@ -272,7 +272,7 @@ Gitleaks offers a configuration format you can follow to write your own secret d title = "Gitleaks title" # Extend the base (this) configuration. When you extend a configuration -# the base rules take precendence over the extended rules. I.e, if there are +# the base rules take precedence over the extended rules. I.e., if there are # duplicate rules in both the base configuration and the extended configuration # the base rules will override the extended rules. # Another thing to know with extending configurations is you can chain together diff --git a/cmd/generate/config/rules/telegram.go b/cmd/generate/config/rules/telegram.go index e17027fb..bda8b8c3 100644 --- a/cmd/generate/config/rules/telegram.go +++ b/cmd/generate/config/rules/telegram.go @@ -28,9 +28,9 @@ func TelegramBotToken() *config.Rule { minToken := secrets.NewSecret(numeric("5") + ":A" + alphaNumericExtendedShort("34")) maxToken := secrets.NewSecret(numeric("16") + ":A" + alphaNumericExtendedShort("34")) tps := []string{ - // variable assigment + // variable assignment generateSampleSecret("telegram", validToken), - // URL contaning token + // URL containing token generateSampleSecret("url", "https://api.telegram.org/bot"+validToken+"/sendMessage"), // object constructor `const bot = new Telegraf("` + validToken + `")`, diff --git a/detect/baseline.go b/detect/baseline.go index b002fd4b..b1efb458 100644 --- a/detect/baseline.go +++ b/detect/baseline.go @@ -13,7 +13,7 @@ import ( func IsNew(finding report.Finding, baseline []report.Finding) bool { // Explicitly testing each property as it gives significantly better performance in comparison to cmp.Equal(). Drawback is that - // the code requires maintanance if/when the Finding struct changes + // the code requires maintenance if/when the Finding struct changes for _, b := range baseline { if finding.Author == b.Author && diff --git a/detect/detect_test.go b/detect/detect_test.go index f6f95458..750139f0 100644 --- a/detect/detect_test.go +++ b/detect/detect_test.go @@ -23,7 +23,7 @@ func TestDetect(t *testing.T) { fragment Fragment // NOTE: for expected findings, all line numbers will be 0 // because line deltas are added _after_ the finding is created. - // I.e, if the finding is from a --no-git file, the line number will be + // I.e., if the finding is from a --no-git file, the line number will be // increase by 1 in DetectFromFiles(). If the finding is from git, // the line number will be increased by the patch delta. expectedFindings []report.Finding diff --git a/detect/utils.go b/detect/utils.go index a7dc79ec..52ce0134 100644 --- a/detect/utils.go +++ b/detect/utils.go @@ -74,7 +74,7 @@ func filter(findings []report.Finding, redact bool) []report.Finding { genericMatch := strings.Replace(f.Match, f.Secret, "REDACTED", -1) betterMatch := strings.Replace(fPrime.Match, fPrime.Secret, "REDACTED", -1) - log.Trace().Msgf("skipping %s finding (%s), %s rule takes precendence (%s)", f.RuleID, genericMatch, fPrime.RuleID, betterMatch) + log.Trace().Msgf("skipping %s finding (%s), %s rule takes precedence (%s)", f.RuleID, genericMatch, fPrime.RuleID, betterMatch) include = false break } diff --git a/report/finding.go b/report/finding.go index 7a3028ae..d89d445c 100644 --- a/report/finding.go +++ b/report/finding.go @@ -38,7 +38,7 @@ type Finding struct { // Rule is the name of the rule that was matched RuleID string - // unique identifer + // unique identifier Fingerprint string }