Debian Codegraph @

pkg/detectors/aws/aws_secret_key_detector.go

raw symbols SCIP
1 package aws
2
3 import (
4 "github.com/DefangLabs/secret-detector/pkg/detectors/helpers"
5 "github.com/DefangLabs/secret-detector/pkg/secrets"
6 )
7
8 const (
9 SecretKeyDetectorName = "aws_secret_key"
10 secretKeyDetectorSecretType = "AWS Secret Key"
11 awsSecretKeyRegex = `(?:AWS|aws).{0,20}['\"][0-9a-zA-Z\/+]{40}['\"]`
12 )
13
14 func init() {
15 secrets.GetDetectorFactory().Register(SecretKeyDetectorName, NewSecretKeyDetector)
16 }
17
18 type awsSecretKeyDetector struct {
19 secrets.Detector
20 }
21
22 func NewSecretKeyDetector(config ...string) secrets.Detector {
23 return &awsSecretKeyDetector{
24 Detector: helpers.NewRegexDetectorBuilder(secretKeyDetectorSecretType, awsSecretKeyRegex).Build(),
25 }
26 }