Skip to content

Commit

Permalink
Merge pull request #20 from hazcod/work/commandbot
Browse files Browse the repository at this point in the history
fix: fix domain check
  • Loading branch information
hazcod authored Aug 20, 2021
2 parents 0aca67d + 18b8050 commit cdeeb00
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pkg/falcon/extractor.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,13 @@ func findEmailTag(tags []string, emailDomains []string) (email string, err error

domainFound := false
for _, domain := range emailDomains {
if ! strings.Contains(email, strings.ToLower(domain)) {
encodedDomain := strings.ToLower(strings.ReplaceAll(domain, ".", "/"))

if ! strings.HasSuffix(email, encodedDomain) {
continue
}

email = strings.Replace(email, fmt.Sprintf("/%s", domain), fmt.Sprintf("@%s", domain), 1)
email = strings.Replace(email, fmt.Sprintf("/%s", encodedDomain), fmt.Sprintf("@%s", domain), 1)
email = strings.ReplaceAll(email, "/", ".")

domainFound = true
Expand Down Expand Up @@ -134,7 +136,7 @@ func GetMessages(config *config.Config, ctx context.Context) (results map[string
queryResult, err := client.SpotlightVulnerabilities.QueryVulnerabilities(
&spotlight_vulnerabilities.QueryVulnerabilitiesParams{
Context: ctx,
Filter: "status:'open',remediation.ids:'*'",
Filter: "status:'open'",
Limit: &falconAPIMaxRecords,
},
)
Expand Down

0 comments on commit cdeeb00

Please sign in to comment.