Skip to content

Commit

Permalink
appointedd boundary
Browse files Browse the repository at this point in the history
  • Loading branch information
zricethezav committed Feb 14, 2024
1 parent 9a925db commit 0b1c277
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/detectors/appointedd/appointedd.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package appointedd

import (
"context"
"fmt"
"io"
"net/http"
"strings"
Expand All @@ -22,7 +23,7 @@ var (
client = common.SaneHttpClient()

// Make sure that your group is surrounded in boundary characters such as below to reduce false positives
keyPat = regexp.MustCompile(detectors.PrefixRegex([]string{"appointedd"}) + `\b([a-zA-Z0-9=+]{87}=)`)
keyPat = regexp.MustCompile(detectors.PrefixRegex([]string{"appointedd"}) + `\b([a-zA-Z0-9=+]{88)`)
)

// Keywords are used for efficiently pre-filtering chunks.
Expand All @@ -34,6 +35,8 @@ func (s Scanner) Keywords() []string {
// FromData will find and optionally verify appointedd secrets in a given set of bytes.
func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (results []detectors.Result, err error) {
dataStr := string(data)
fmt.Println(keyPat.String())
fmt.Println("data", dataStr)

matches := keyPat.FindAllStringSubmatch(dataStr, -1)

Expand All @@ -42,6 +45,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
continue
}
resMatch := strings.TrimSpace(match[1])
fmt.Println(resMatch)

s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_Appointedd,
Expand Down

0 comments on commit 0b1c277

Please sign in to comment.