Skip to content

Commit

Permalink
fix: regex for hostnames (#494)
Browse files Browse the repository at this point in the history
* fix: regex for ends with github.com

* fix: regex for hooks.zapier.com

* fix: regex for hooks.slack.com

* fix: regex for signalwire.com

* fix: regex for kanbantool.com

* fix: regex for invoiceoceam.com

* fix: regex for invoiceocean.com

* fix: regex for freshdesk.com

* fix: regex for discord.com

* fix: regex for deputy.com
  • Loading branch information
dcRUSTy committed May 2, 2022
1 parent 48a0c28 commit a74bea0
Show file tree
Hide file tree
Showing 12 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion pkg/detectors/deputy/deputy.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ var (

//Make sure that your group is surrounded in boundry characters such as below to reduce false positives
keyPat = regexp.MustCompile(detectors.PrefixRegex([]string{"deputy"}) + `\b([0-9a-z]{32})\b`)
urlPat = regexp.MustCompile(`\b([0-9a-z]{1,}.as.deputy.com)\b`)
urlPat = regexp.MustCompile(`\b([0-9a-z]{1,}\.as\.deputy\.com)\b`)
)

// Keywords are used for efficiently pre-filtering chunks.
Expand Down
2 changes: 1 addition & 1 deletion pkg/detectors/deputy/deputy/deputy.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ var (

//Make sure that your group is surrounded in boundry characters such as below to reduce false positives
keyPat = regexp.MustCompile(detectors.PrefixRegex([]string{"deputy"}) + `\b([0-9a-z]{32})\b`)
urlPat = regexp.MustCompile(`\b([0-9a-z]{1,}.as.deputy.com)\b`)
urlPat = regexp.MustCompile(`\b([0-9a-z]{1,}\.as\.deputy\.com)\b`)
)

// Keywords are used for efficiently pre-filtering chunks.
Expand Down
2 changes: 1 addition & 1 deletion pkg/detectors/discordwebhook/discordwebhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ var (
client = common.SaneHttpClient()

//Make sure that your group is surrounded in boundry characters such as below to reduce false positives
keyPat = regexp.MustCompile(`(https:\/\/discord.com\/api\/webhooks\/[0-9]{18}\/[0-9a-zA-Z-]{68})`)
keyPat = regexp.MustCompile(`(https:\/\/discord\.com\/api\/webhooks\/[0-9]{18}\/[0-9a-zA-Z-]{68})`)
)

// Keywords are used for efficiently pre-filtering chunks.
Expand Down
2 changes: 1 addition & 1 deletion pkg/detectors/freshdesk/freshdesk.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ var (
client = common.SaneHttpClient()

//Make sure that your group is surrounded in boundry characters such as below to reduce false positives
urlPat = regexp.MustCompile(`\b([0-9a-z-]{1,}.freshdesk.com)\b`)
urlPat = regexp.MustCompile(`\b([0-9a-z-]{1,}\.freshdesk\.com)\b`)
keyPat = regexp.MustCompile(detectors.PrefixRegex([]string{"freshdesk"}) + `\b([0-9A-Za-z]{20})\b`)
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/detectors/freshdesk/freshdesk/freshdesk.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ var (
client = common.SaneHttpClient()

//Make sure that your group is surrounded in boundry characters such as below to reduce false positives
urlPat = regexp.MustCompile(`\b([0-9a-z-]{1,}.freshdesk.com)\b`)
urlPat = regexp.MustCompile(`\b([0-9a-z-]{1,}\.freshdesk\.com)\b`)
keyPat = regexp.MustCompile(detectors.PrefixRegex([]string{"freshdesk"}) + `\b([0-9A-Za-z]{20})\b`)
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/detectors/invoiceocean/invoiceocean.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ var (

//Make sure that your group is surrounded in boundry characters such as below to reduce false positives
keyPat = regexp.MustCompile(detectors.PrefixRegex([]string{"invoiceocean"}) + `\b([0-9A-Za-z]{20})\b`)
urlPat = regexp.MustCompile(`\b([0-9a-z]{1,}.invoiceocean.com)\b`)
urlPat = regexp.MustCompile(`\b([0-9a-z]{1,}\.invoiceocean\.com)\b`)
)

// Keywords are used for efficiently pre-filtering chunks.
Expand Down
2 changes: 1 addition & 1 deletion pkg/detectors/invoiceocean/invoiceocean/invoiceocean.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ var (

//Make sure that your group is surrounded in boundry characters such as below to reduce false positives
keyPat = regexp.MustCompile(detectors.PrefixRegex([]string{"invoiceocean"}) + `\b([0-9A-Za-z]{20})\b`)
urlPat = regexp.MustCompile(`\b([0-9a-z]{1,}.invoiceocean.com)\b`)
urlPat = regexp.MustCompile(`\b([0-9a-z]{1,}\.invoiceocean\.com)\b`)
)

// Keywords are used for efficiently pre-filtering chunks.
Expand Down
2 changes: 1 addition & 1 deletion pkg/detectors/kanban/kanban/kanban.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ var (

//Make sure that your group is surrounded in boundry characters such as below to reduce false positives
keyPat = regexp.MustCompile(detectors.PrefixRegex([]string{"kanban"}) + `\b([0-9A-Z]{12})\b`)
urlPat = regexp.MustCompile(`\b([0-9a-z]{1,}.kanbantool.com)\b`)
urlPat = regexp.MustCompile(`\b([0-9a-z]{1,}\.kanbantool\.com)\b`)
)

// Keywords are used for efficiently pre-filtering chunks.
Expand Down
2 changes: 1 addition & 1 deletion pkg/detectors/signalwire/signalwire.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ var (
//Make sure that your group is surrounded in boundry characters such as below to reduce false positives
keyPat = regexp.MustCompile(detectors.PrefixRegex([]string{"signalwire"}) + `\b([0-9A-Za-z]{50})\b`)
idPat = regexp.MustCompile(detectors.PrefixRegex([]string{"signalwire"}) + `\b([0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12})\b`)
urlPat = regexp.MustCompile(`\b([0-9a-z-]{3,64}.signalwire.com)\b`)
urlPat = regexp.MustCompile(`\b([0-9a-z-]{3,64}\.signalwire\.com)\b`)
)

// Keywords are used for efficiently pre-filtering chunks.
Expand Down
2 changes: 1 addition & 1 deletion pkg/detectors/slackwebhook/slackwebhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ var (
client = common.SaneHttpClient()

//Make sure that your group is surrounded in boundry characters such as below to reduce false positives
keyPat = regexp.MustCompile(`(https:\/\/hooks.slack.com\/services\/[A-Za-z0-9+\/]{44,46})`)
keyPat = regexp.MustCompile(`(https:\/\/hooks\.slack\.com\/services\/[A-Za-z0-9+\/]{44,46})`)
)

// Keywords are used for efficiently pre-filtering chunks.
Expand Down
2 changes: 1 addition & 1 deletion pkg/detectors/zapierwebhook/zapierwebhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ var (
client = common.SaneHttpClient()

//Make sure that your group is surrounded in boundry characters such as below to reduce false positives
keyPat = regexp.MustCompile(`(https:\/\/hooks.zapier.com\/hooks\/catch\/[A-Za-z0-9\/]{16})`)
keyPat = regexp.MustCompile(`(https:\/\/hooks\.zapier\.com\/hooks\/catch\/[A-Za-z0-9\/]{16})`)
)

// Keywords are used for efficiently pre-filtering chunks.
Expand Down
2 changes: 1 addition & 1 deletion pkg/sources/github/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ type Source struct {

// Ensure the Source satisfies the interface at compile time
var _ sources.Source = (*Source)(nil)
var endsWithGithub = regexp.MustCompile(`github.com/?$`)
var endsWithGithub = regexp.MustCompile(`github\.com/?$`)

// Type returns the type of source.
// It is used for matching source types in configuration and job input.
Expand Down

0 comments on commit a74bea0

Please sign in to comment.