| 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 |
MWSKeyDetectorName = "aws_mws_key" |
| 10 |
mwsKeyDetectorSecretType = "Amazon Marketplace Web Service (MWS) Key" |
| 11 |
|
| 12 |
mwsKeyRegex = `amzn\.mws\.[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}` |
| 13 |
) |
| 14 |
|
| 15 |
func init() { |
| 16 |
secrets.GetDetectorFactory().Register(MWSKeyDetectorName, NewMWSKeyDetector) |
| 17 |
} |
| 18 |
|
| 19 |
type mwsKeyDetector struct { |
| 20 |
secrets.Detector |
| 21 |
} |
| 22 |
|
| 23 |
func NewMWSKeyDetector(config ...string) secrets.Detector { |
| 24 |
return &mwsKeyDetector{ |
| 25 |
Detector: helpers.NewRegexDetectorBuilder(mwsKeyDetectorSecretType, mwsKeyRegex).Build(), |
| 26 |
} |
| 27 |
} |