mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-27 11:44:23 +01:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
39947b0b0d | ||
|
|
79cac73f72 | ||
|
|
247f423a39 | ||
|
|
821b232394 | ||
|
|
57ac4b3dc7 | ||
|
|
db69e8266e | ||
|
|
4b543280a1 | ||
|
|
979f213b93 | ||
|
|
59c0cc7183 | ||
|
|
6c52f878cc | ||
|
|
247a5e7214 | ||
|
|
8d23afd45d | ||
|
|
ac4b5146b0 | ||
|
|
76c9e3175b | ||
|
|
afe046b3b4 | ||
|
|
8b8920d4c3 | ||
|
|
a59289ca9b | ||
|
|
870194be13 | ||
|
|
179c607541 | ||
|
|
8de8938ad4 | ||
|
|
ca7aa14542 | ||
|
|
01e60c81e6 | ||
|
|
54f5f04a1f | ||
|
|
221d5c40e7 | ||
|
|
128b50f67b |
No files matched your search
@@ -26,4 +26,4 @@ jobs:
|
||||
run: make test
|
||||
|
||||
- name: Validate Config
|
||||
run: cd cmd/generate/config && go run main.go
|
||||
run: go generate ./... && git diff --exit-code
|
||||
@@ -9,3 +9,8 @@
|
||||
description: Detect hardcoded secrets using Gitleaks
|
||||
entry: zricethezav/gitleaks protect --verbose --redact --staged
|
||||
language: docker_image
|
||||
- id: gitleaks-system
|
||||
name: Detect hardcoded secrets
|
||||
description: Detect hardcoded secrets using Gitleaks
|
||||
entry: gitleaks protect --verbose --redact --staged
|
||||
language: system
|
||||
+3
-7
@@ -88,15 +88,11 @@ If you want to add a new rule to the [default Gitleaks configuration](https://gi
|
||||
validation part. You can use `generateSampleSecret` to create a secret for the
|
||||
true positives (`tps` in the example above) used in `validate`.
|
||||
|
||||
1. Update `cmd/generate/config/main.go`. Add a line like
|
||||
`configRules = append(configRules, rules.Beamer())` in `main()`. Try and keep
|
||||
1. Update `cmd/generate/config/main.go`. Extend `configRules` slice with
|
||||
the `rules.Beamer(),` in `main()`. Try and keep
|
||||
this alphabetically pretty please.
|
||||
|
||||
1. Change directories into `cmd/generate/config` and run `go run main.go`
|
||||
|
||||
```
|
||||
cd cmd/generate/config && go run main.go
|
||||
```
|
||||
1. Run `go generate ./...`
|
||||
|
||||
1. Check out your new rules in `config/gitleaks.toml` and see if everything looks good.
|
||||
|
||||
|
||||
+3
-5
@@ -1,14 +1,12 @@
|
||||
FROM golang:1.19 AS build
|
||||
FROM golang:1.21 AS build
|
||||
WORKDIR /go/src/github.com/zricethezav/gitleaks
|
||||
COPY . .
|
||||
RUN VERSION=$(git describe --tags --abbrev=0) && \
|
||||
CGO_ENABLED=0 go build -o bin/gitleaks -ldflags "-X="github.com/zricethezav/gitleaks/v8/cmd.Version=${VERSION}
|
||||
|
||||
FROM alpine:3.16
|
||||
RUN adduser -D gitleaks && \
|
||||
apk add --no-cache bash git openssh-client
|
||||
FROM alpine:3.19
|
||||
RUN apk add --no-cache bash git openssh-client
|
||||
COPY --from=build /go/src/github.com/zricethezav/gitleaks/bin/* /usr/bin/
|
||||
USER gitleaks
|
||||
|
||||
RUN git config --global --add safe.directory '*'
|
||||
|
||||
|
||||
@@ -382,7 +382,7 @@ stopwords = [
|
||||
]
|
||||
```
|
||||
|
||||
Refer to the default [gitleaks config](https://github.com/zricethezav/gitleaks/blob/master/config/gitleaks.toml) for examples or follow the [contributing guidelines](https://github.com/zricethezav/gitleaks/blob/master/README.md) if you would like to contribute to the default configuration. Additionally, you can check out [this gitleaks blog post](https://blog.gitleaks.io/stop-leaking-secrets-configuration-2-3-aeed293b1fbf) which covers advanced configuration setups.
|
||||
Refer to the default [gitleaks config](https://github.com/zricethezav/gitleaks/blob/master/config/gitleaks.toml) for examples or follow the [contributing guidelines](https://github.com/gitleaks/gitleaks/blob/master/CONTRIBUTING.md) if you would like to contribute to the default configuration. Additionally, you can check out [this gitleaks blog post](https://blog.gitleaks.io/stop-leaking-secrets-configuration-2-3-aeed293b1fbf) which covers advanced configuration setups.
|
||||
|
||||
### Additional Configuration
|
||||
|
||||
|
||||
+16
-168
@@ -2,28 +2,19 @@ package cmd
|
||||
|
||||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/rs/zerolog"
|
||||
"github.com/rs/zerolog/log"
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/viper"
|
||||
|
||||
"github.com/zricethezav/gitleaks/v8/config"
|
||||
"github.com/zricethezav/gitleaks/v8/detect"
|
||||
"github.com/zricethezav/gitleaks/v8/report"
|
||||
"github.com/zricethezav/gitleaks/v8/sources"
|
||||
)
|
||||
|
||||
func init() {
|
||||
rootCmd.AddCommand(detectCmd)
|
||||
detectCmd.Flags().String("log-opts", "", "git log options")
|
||||
detectCmd.Flags().Bool("no-git", false, "treat git repo as a regular directory and scan those files, --log-opts has no effect on the scan when --no-git is set")
|
||||
detectCmd.Flags().Bool("pipe", false, "scan input from stdin, ex: `cat some_file | gitleaks detect --pipe`")
|
||||
detectCmd.Flags().Bool("follow-symlinks", false, "scan files that are symlinks to other files")
|
||||
detectCmd.Flags().StringSlice("enable-rule", []string{}, "only enable specific rules by id, ex: `gitleaks detect --enable-rule=atlassian-api-token --enable-rule=slack-access-token`")
|
||||
detectCmd.Flags().StringP("gitleaks-ignore-path", "i", ".", "path to .gitleaksignore file or folder containing one")
|
||||
}
|
||||
|
||||
var detectCmd = &cobra.Command{
|
||||
@@ -35,117 +26,22 @@ var detectCmd = &cobra.Command{
|
||||
func runDetect(cmd *cobra.Command, args []string) {
|
||||
initConfig()
|
||||
var (
|
||||
vc config.ViperConfig
|
||||
findings []report.Finding
|
||||
err error
|
||||
)
|
||||
|
||||
// Load config
|
||||
if err = viper.Unmarshal(&vc); err != nil {
|
||||
log.Fatal().Err(err).Msg("Failed to load config")
|
||||
}
|
||||
cfg, err := vc.Translate()
|
||||
if err != nil {
|
||||
log.Fatal().Err(err).Msg("Failed to load config")
|
||||
}
|
||||
cfg.Path, _ = cmd.Flags().GetString("config")
|
||||
// setup config (aka, the thing that defines rules)
|
||||
cfg := Config(cmd)
|
||||
|
||||
// start timer
|
||||
start := time.Now()
|
||||
|
||||
// Setup detector
|
||||
detector := detect.NewDetector(cfg)
|
||||
// set color flag at first
|
||||
if detector.NoColor, err = cmd.Flags().GetBool("no-color"); err != nil {
|
||||
log.Fatal().Err(err).Msg("")
|
||||
}
|
||||
// also init logger again without color
|
||||
if detector.NoColor {
|
||||
log.Logger = log.Output(zerolog.ConsoleWriter{
|
||||
Out: os.Stderr,
|
||||
NoColor: detector.NoColor,
|
||||
})
|
||||
}
|
||||
detector.Config.Path, err = cmd.Flags().GetString("config")
|
||||
if err != nil {
|
||||
log.Fatal().Err(err).Msg("")
|
||||
}
|
||||
// grab source
|
||||
source, err := cmd.Flags().GetString("source")
|
||||
if err != nil {
|
||||
log.Fatal().Err(err).Msg("")
|
||||
}
|
||||
// if config path is not set, then use the {source}/.gitleaks.toml path.
|
||||
// note that there may not be a `{source}/.gitleaks.toml` file, this is ok.
|
||||
if detector.Config.Path == "" {
|
||||
detector.Config.Path = filepath.Join(source, ".gitleaks.toml")
|
||||
}
|
||||
// set verbose flag
|
||||
if detector.Verbose, err = cmd.Flags().GetBool("verbose"); err != nil {
|
||||
log.Fatal().Err(err).Msg("")
|
||||
}
|
||||
// set redact flag
|
||||
if detector.Redact, err = cmd.Flags().GetUint("redact"); err != nil {
|
||||
log.Fatal().Err(err).Msg("")
|
||||
}
|
||||
if detector.MaxTargetMegaBytes, err = cmd.Flags().GetInt("max-target-megabytes"); err != nil {
|
||||
log.Fatal().Err(err).Msg("")
|
||||
}
|
||||
// set ignore gitleaks:allow flag
|
||||
if detector.IgnoreGitleaksAllow, err = cmd.Flags().GetBool("ignore-gitleaks-allow"); err != nil {
|
||||
log.Fatal().Err(err).Msg("")
|
||||
}
|
||||
|
||||
gitleaksIgnorePath, err := cmd.Flags().GetString("gitleaks-ignore-path")
|
||||
if err != nil {
|
||||
log.Fatal().Err(err).Msg("could not get .gitleaksignore path")
|
||||
}
|
||||
|
||||
if fileExists(gitleaksIgnorePath) {
|
||||
if err = detector.AddGitleaksIgnore(gitleaksIgnorePath); err != nil {
|
||||
log.Fatal().Err(err).Msg("could not call AddGitleaksIgnore")
|
||||
}
|
||||
}
|
||||
|
||||
if fileExists(filepath.Join(gitleaksIgnorePath, ".gitleaksignore")) {
|
||||
if err = detector.AddGitleaksIgnore(filepath.Join(gitleaksIgnorePath, ".gitleaksignore")); err != nil {
|
||||
log.Fatal().Err(err).Msg("could not call AddGitleaksIgnore")
|
||||
}
|
||||
}
|
||||
|
||||
if fileExists(filepath.Join(source, ".gitleaksignore")) {
|
||||
if err = detector.AddGitleaksIgnore(filepath.Join(source, ".gitleaksignore")); err != nil {
|
||||
log.Fatal().Err(err).Msg("could not call AddGitleaksIgnore")
|
||||
}
|
||||
}
|
||||
|
||||
// ignore findings from the baseline (an existing report in json format generated earlier)
|
||||
baselinePath, _ := cmd.Flags().GetString("baseline-path")
|
||||
if baselinePath != "" {
|
||||
err = detector.AddBaseline(baselinePath, source)
|
||||
if err != nil {
|
||||
log.Error().Msgf("Could not load baseline. The path must point of a gitleaks report generated using the default format: %s", err)
|
||||
}
|
||||
}
|
||||
|
||||
// If set, only apply rules that are defined in the flag
|
||||
rules, _ := cmd.Flags().GetStringSlice("enable-rule")
|
||||
if len(rules) > 0 {
|
||||
log.Info().Msg("Overriding enabled rules: " + strings.Join(rules, ", "))
|
||||
ruleOverride := make(map[string]config.Rule)
|
||||
for _, ruleName := range rules {
|
||||
if rule, ok := cfg.Rules[ruleName]; ok {
|
||||
ruleOverride[ruleName] = rule
|
||||
} else {
|
||||
log.Fatal().Msgf("Requested rule %s not found in rules", ruleName)
|
||||
}
|
||||
}
|
||||
detector.Config.Rules = ruleOverride
|
||||
}
|
||||
|
||||
// set follow symlinks flag
|
||||
if detector.FollowSymlinks, err = cmd.Flags().GetBool("follow-symlinks"); err != nil {
|
||||
log.Fatal().Err(err).Msg("")
|
||||
}
|
||||
detector := Detector(cmd, cfg, source)
|
||||
|
||||
// set exit code
|
||||
exitCode, err := cmd.Flags().GetInt("exit-code")
|
||||
@@ -167,7 +63,11 @@ func runDetect(cmd *cobra.Command, args []string) {
|
||||
|
||||
// start the detector scan
|
||||
if noGit {
|
||||
findings, err = detector.DetectFiles(source)
|
||||
paths, err := sources.DirectoryTargets(source, detector.Sema, detector.FollowSymlinks)
|
||||
if err != nil {
|
||||
log.Fatal().Err(err)
|
||||
}
|
||||
findings, err = detector.DetectFiles(paths)
|
||||
if err != nil {
|
||||
// don't exit on error, just log it
|
||||
log.Error().Err(err).Msg("")
|
||||
@@ -185,68 +85,16 @@ func runDetect(cmd *cobra.Command, args []string) {
|
||||
if err != nil {
|
||||
log.Fatal().Err(err).Msg("")
|
||||
}
|
||||
findings, err = detector.DetectGit(source, logOpts, detect.DetectType)
|
||||
gitCmd, err := sources.NewGitLogCmd(source, logOpts)
|
||||
if err != nil {
|
||||
log.Fatal().Err(err).Msg("")
|
||||
}
|
||||
findings, err = detector.DetectGit(gitCmd)
|
||||
if err != nil {
|
||||
// don't exit on error, just log it
|
||||
log.Error().Err(err).Msg("")
|
||||
}
|
||||
}
|
||||
|
||||
// log info about the scan
|
||||
if err == nil {
|
||||
log.Info().Msgf("scan completed in %s", FormatDuration(time.Since(start)))
|
||||
if len(findings) != 0 {
|
||||
log.Warn().Msgf("leaks found: %d", len(findings))
|
||||
} else {
|
||||
log.Info().Msg("no leaks found")
|
||||
}
|
||||
} else {
|
||||
log.Warn().Msgf("partial scan completed in %s", FormatDuration(time.Since(start)))
|
||||
if len(findings) != 0 {
|
||||
log.Warn().Msgf("%d leaks found in partial scan", len(findings))
|
||||
} else {
|
||||
log.Warn().Msg("no leaks found in partial scan")
|
||||
}
|
||||
}
|
||||
|
||||
// write report if desired
|
||||
reportPath, _ := cmd.Flags().GetString("report-path")
|
||||
ext, _ := cmd.Flags().GetString("report-format")
|
||||
if reportPath != "" {
|
||||
if err := report.Write(findings, cfg, ext, reportPath); err != nil {
|
||||
log.Fatal().Err(err).Msg("could not write")
|
||||
}
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
if len(findings) != 0 {
|
||||
os.Exit(exitCode)
|
||||
}
|
||||
}
|
||||
|
||||
func fileExists(fileName string) bool {
|
||||
// check for a .gitleaksignore file
|
||||
info, err := os.Stat(fileName)
|
||||
if err != nil && !os.IsNotExist(err) {
|
||||
return false
|
||||
}
|
||||
|
||||
if info != nil && err == nil {
|
||||
if !info.IsDir() {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func FormatDuration(d time.Duration) string {
|
||||
scale := 100 * time.Second
|
||||
// look for the max scale that is smaller than d
|
||||
for scale > d {
|
||||
scale = scale / 10
|
||||
}
|
||||
return d.Round(scale / 100).String()
|
||||
findingSummaryAndExit(findings, cmd, cfg, exitCode, start, err)
|
||||
}
|
||||
+185
-171
@@ -14,179 +14,193 @@ const (
|
||||
templatePath = "rules/config.tmpl"
|
||||
)
|
||||
|
||||
//go:generate go run $GOFILE ../../../config/gitleaks.toml
|
||||
|
||||
func main() {
|
||||
var configRules []*config.Rule
|
||||
configRules = append(configRules, rules.AdafruitAPIKey())
|
||||
configRules = append(configRules, rules.AdobeClientID())
|
||||
configRules = append(configRules, rules.AdobeClientSecret())
|
||||
configRules = append(configRules, rules.AgeSecretKey())
|
||||
configRules = append(configRules, rules.Airtable())
|
||||
configRules = append(configRules, rules.AlgoliaApiKey())
|
||||
configRules = append(configRules, rules.AlibabaAccessKey())
|
||||
configRules = append(configRules, rules.AlibabaSecretKey())
|
||||
configRules = append(configRules, rules.AsanaClientID())
|
||||
configRules = append(configRules, rules.AsanaClientSecret())
|
||||
configRules = append(configRules, rules.Atlassian())
|
||||
configRules = append(configRules, rules.Authress())
|
||||
configRules = append(configRules, rules.AWS())
|
||||
configRules = append(configRules, rules.BitBucketClientID())
|
||||
configRules = append(configRules, rules.BitBucketClientSecret())
|
||||
configRules = append(configRules, rules.BittrexAccessKey())
|
||||
configRules = append(configRules, rules.BittrexSecretKey())
|
||||
configRules = append(configRules, rules.Beamer())
|
||||
configRules = append(configRules, rules.CodecovAccessToken())
|
||||
configRules = append(configRules, rules.CoinbaseAccessToken())
|
||||
configRules = append(configRules, rules.Clojars())
|
||||
configRules = append(configRules, rules.ConfluentAccessToken())
|
||||
configRules = append(configRules, rules.ConfluentSecretKey())
|
||||
configRules = append(configRules, rules.Contentful())
|
||||
configRules = append(configRules, rules.Databricks())
|
||||
configRules = append(configRules, rules.DatadogtokenAccessToken())
|
||||
configRules = append(configRules, rules.DefinedNetworkingAPIToken())
|
||||
configRules = append(configRules, rules.DigitalOceanPAT())
|
||||
configRules = append(configRules, rules.DigitalOceanOAuthToken())
|
||||
configRules = append(configRules, rules.DigitalOceanRefreshToken())
|
||||
configRules = append(configRules, rules.DiscordAPIToken())
|
||||
configRules = append(configRules, rules.DiscordClientID())
|
||||
configRules = append(configRules, rules.DiscordClientSecret())
|
||||
configRules = append(configRules, rules.Doppler())
|
||||
configRules = append(configRules, rules.DropBoxAPISecret())
|
||||
configRules = append(configRules, rules.DropBoxLongLivedAPIToken())
|
||||
configRules = append(configRules, rules.DropBoxShortLivedAPIToken())
|
||||
configRules = append(configRules, rules.DroneciAccessToken())
|
||||
configRules = append(configRules, rules.Duffel())
|
||||
configRules = append(configRules, rules.Dynatrace())
|
||||
configRules = append(configRules, rules.EasyPost())
|
||||
configRules = append(configRules, rules.EasyPostTestAPI())
|
||||
configRules = append(configRules, rules.EtsyAccessToken())
|
||||
configRules = append(configRules, rules.Facebook())
|
||||
configRules = append(configRules, rules.FastlyAPIToken())
|
||||
configRules = append(configRules, rules.FinicityClientSecret())
|
||||
configRules = append(configRules, rules.FinicityAPIToken())
|
||||
configRules = append(configRules, rules.FlickrAccessToken())
|
||||
configRules = append(configRules, rules.FinnhubAccessToken())
|
||||
configRules = append(configRules, rules.FlutterwavePublicKey())
|
||||
configRules = append(configRules, rules.FlutterwaveSecretKey())
|
||||
configRules = append(configRules, rules.FlutterwaveEncKey())
|
||||
configRules = append(configRules, rules.FrameIO())
|
||||
configRules = append(configRules, rules.FreshbooksAccessToken())
|
||||
configRules = append(configRules, rules.GoCardless())
|
||||
// TODO figure out what makes sense for GCP
|
||||
// configRules = append(configRules, rules.GCPServiceAccount())
|
||||
configRules = append(configRules, rules.GCPAPIKey())
|
||||
configRules = append(configRules, rules.GitHubPat())
|
||||
configRules = append(configRules, rules.GitHubFineGrainedPat())
|
||||
configRules = append(configRules, rules.GitHubOauth())
|
||||
configRules = append(configRules, rules.GitHubApp())
|
||||
configRules = append(configRules, rules.GitHubRefresh())
|
||||
configRules = append(configRules, rules.GitlabPat())
|
||||
configRules = append(configRules, rules.GitlabPipelineTriggerToken())
|
||||
configRules = append(configRules, rules.GitlabRunnerRegistrationToken())
|
||||
configRules = append(configRules, rules.GitterAccessToken())
|
||||
configRules = append(configRules, rules.GrafanaApiKey())
|
||||
configRules = append(configRules, rules.GrafanaCloudApiToken())
|
||||
configRules = append(configRules, rules.GrafanaServiceAccountToken())
|
||||
configRules = append(configRules, rules.Hashicorp())
|
||||
configRules = append(configRules, rules.HashicorpField())
|
||||
configRules = append(configRules, rules.Heroku())
|
||||
configRules = append(configRules, rules.HubSpot())
|
||||
configRules = append(configRules, rules.HuggingFaceAccessToken())
|
||||
configRules = append(configRules, rules.HuggingFaceOrganizationApiToken())
|
||||
configRules = append(configRules, rules.Intercom())
|
||||
configRules = append(configRules, rules.JFrogAPIKey())
|
||||
configRules = append(configRules, rules.JFrogIdentityToken())
|
||||
configRules = append(configRules, rules.JWT())
|
||||
configRules = append(configRules, rules.JWTBase64())
|
||||
configRules = append(configRules, rules.KrakenAccessToken())
|
||||
configRules = append(configRules, rules.KucoinAccessToken())
|
||||
configRules = append(configRules, rules.KucoinSecretKey())
|
||||
configRules = append(configRules, rules.LaunchDarklyAccessToken())
|
||||
configRules = append(configRules, rules.LinearAPIToken())
|
||||
configRules = append(configRules, rules.LinearClientSecret())
|
||||
configRules = append(configRules, rules.LinkedinClientID())
|
||||
configRules = append(configRules, rules.LinkedinClientSecret())
|
||||
configRules = append(configRules, rules.LobAPIToken())
|
||||
configRules = append(configRules, rules.LobPubAPIToken())
|
||||
configRules = append(configRules, rules.MailChimp())
|
||||
configRules = append(configRules, rules.MailGunPubAPIToken())
|
||||
configRules = append(configRules, rules.MailGunPrivateAPIToken())
|
||||
configRules = append(configRules, rules.MailGunSigningKey())
|
||||
configRules = append(configRules, rules.MapBox())
|
||||
configRules = append(configRules, rules.MattermostAccessToken())
|
||||
configRules = append(configRules, rules.MessageBirdAPIToken())
|
||||
configRules = append(configRules, rules.MessageBirdClientID())
|
||||
configRules = append(configRules, rules.NetlifyAccessToken())
|
||||
configRules = append(configRules, rules.NewRelicUserID())
|
||||
configRules = append(configRules, rules.NewRelicUserKey())
|
||||
configRules = append(configRules, rules.NewRelicBrowserAPIKey())
|
||||
configRules = append(configRules, rules.NPM())
|
||||
configRules = append(configRules, rules.NytimesAccessToken())
|
||||
configRules = append(configRules, rules.OktaAccessToken())
|
||||
configRules = append(configRules, rules.OpenAI())
|
||||
configRules = append(configRules, rules.PlaidAccessID())
|
||||
configRules = append(configRules, rules.PlaidSecretKey())
|
||||
configRules = append(configRules, rules.PlaidAccessToken())
|
||||
configRules = append(configRules, rules.PlanetScalePassword())
|
||||
configRules = append(configRules, rules.PlanetScaleAPIToken())
|
||||
configRules = append(configRules, rules.PlanetScaleOAuthToken())
|
||||
configRules = append(configRules, rules.PostManAPI())
|
||||
configRules = append(configRules, rules.Prefect())
|
||||
configRules = append(configRules, rules.PrivateKey())
|
||||
configRules = append(configRules, rules.PulumiAPIToken())
|
||||
configRules = append(configRules, rules.PyPiUploadToken())
|
||||
configRules = append(configRules, rules.RapidAPIAccessToken())
|
||||
configRules = append(configRules, rules.ReadMe())
|
||||
configRules = append(configRules, rules.RubyGemsAPIToken())
|
||||
configRules = append(configRules, rules.ScalingoAPIToken())
|
||||
configRules = append(configRules, rules.SendbirdAccessID())
|
||||
configRules = append(configRules, rules.SendbirdAccessToken())
|
||||
configRules = append(configRules, rules.SendGridAPIToken())
|
||||
configRules = append(configRules, rules.SendInBlueAPIToken())
|
||||
configRules = append(configRules, rules.SentryAccessToken())
|
||||
configRules = append(configRules, rules.ShippoAPIToken())
|
||||
configRules = append(configRules, rules.ShopifyAccessToken())
|
||||
configRules = append(configRules, rules.ShopifyCustomAccessToken())
|
||||
configRules = append(configRules, rules.ShopifyPrivateAppAccessToken())
|
||||
configRules = append(configRules, rules.ShopifySharedSecret())
|
||||
configRules = append(configRules, rules.SidekiqSecret())
|
||||
configRules = append(configRules, rules.SidekiqSensitiveUrl())
|
||||
configRules = append(configRules, rules.SlackBotToken())
|
||||
configRules = append(configRules, rules.SlackUserToken())
|
||||
configRules = append(configRules, rules.SlackAppLevelToken())
|
||||
configRules = append(configRules, rules.SlackConfigurationToken())
|
||||
configRules = append(configRules, rules.SlackConfigurationRefreshToken())
|
||||
configRules = append(configRules, rules.SlackLegacyBotToken())
|
||||
configRules = append(configRules, rules.SlackLegacyWorkspaceToken())
|
||||
configRules = append(configRules, rules.SlackLegacyToken())
|
||||
configRules = append(configRules, rules.SlackWebHookUrl())
|
||||
configRules = append(configRules, rules.Snyk())
|
||||
configRules = append(configRules, rules.StripeAccessToken())
|
||||
configRules = append(configRules, rules.SquareAccessToken())
|
||||
configRules = append(configRules, rules.SquareSpaceAccessToken())
|
||||
configRules = append(configRules, rules.SumoLogicAccessID())
|
||||
configRules = append(configRules, rules.SumoLogicAccessToken())
|
||||
configRules = append(configRules, rules.TeamsWebhook())
|
||||
configRules = append(configRules, rules.TelegramBotToken())
|
||||
configRules = append(configRules, rules.TravisCIAccessToken())
|
||||
configRules = append(configRules, rules.Twilio())
|
||||
configRules = append(configRules, rules.TwitchAPIToken())
|
||||
configRules = append(configRules, rules.TwitterAPIKey())
|
||||
configRules = append(configRules, rules.TwitterAPISecret())
|
||||
configRules = append(configRules, rules.TwitterAccessToken())
|
||||
configRules = append(configRules, rules.TwitterAccessSecret())
|
||||
configRules = append(configRules, rules.TwitterBearerToken())
|
||||
configRules = append(configRules, rules.Typeform())
|
||||
configRules = append(configRules, rules.VaultBatchToken())
|
||||
configRules = append(configRules, rules.VaultServiceToken())
|
||||
configRules = append(configRules, rules.YandexAPIKey())
|
||||
configRules = append(configRules, rules.YandexAWSAccessToken())
|
||||
configRules = append(configRules, rules.YandexAccessToken())
|
||||
configRules = append(configRules, rules.ZendeskSecretKey())
|
||||
configRules = append(configRules, rules.GenericCredential())
|
||||
configRules = append(configRules, rules.InfracostAPIToken())
|
||||
if len(os.Args) < 2 {
|
||||
os.Stderr.WriteString("Specify path to the gitleaks.toml config\n")
|
||||
os.Exit(2)
|
||||
}
|
||||
gitleaksConfigPath := os.Args[1]
|
||||
|
||||
configRules := []*config.Rule{
|
||||
rules.AdafruitAPIKey(),
|
||||
rules.AdobeClientID(),
|
||||
rules.AdobeClientSecret(),
|
||||
rules.AgeSecretKey(),
|
||||
rules.Airtable(),
|
||||
rules.AlgoliaApiKey(),
|
||||
rules.AlibabaAccessKey(),
|
||||
rules.AlibabaSecretKey(),
|
||||
rules.AsanaClientID(),
|
||||
rules.AsanaClientSecret(),
|
||||
rules.Atlassian(),
|
||||
rules.Authress(),
|
||||
rules.AWS(),
|
||||
rules.BitBucketClientID(),
|
||||
rules.BitBucketClientSecret(),
|
||||
rules.BittrexAccessKey(),
|
||||
rules.BittrexSecretKey(),
|
||||
rules.Beamer(),
|
||||
rules.CodecovAccessToken(),
|
||||
rules.CoinbaseAccessToken(),
|
||||
rules.Clojars(),
|
||||
rules.CloudflareAPIKey(),
|
||||
rules.CloudflareGlobalAPIKey(),
|
||||
rules.CloudflareOriginCAKey(),
|
||||
rules.ConfluentAccessToken(),
|
||||
rules.ConfluentSecretKey(),
|
||||
rules.Contentful(),
|
||||
rules.Databricks(),
|
||||
rules.DatadogtokenAccessToken(),
|
||||
rules.DefinedNetworkingAPIToken(),
|
||||
rules.DigitalOceanPAT(),
|
||||
rules.DigitalOceanOAuthToken(),
|
||||
rules.DigitalOceanRefreshToken(),
|
||||
rules.DiscordAPIToken(),
|
||||
rules.DiscordClientID(),
|
||||
rules.DiscordClientSecret(),
|
||||
rules.Doppler(),
|
||||
rules.DropBoxAPISecret(),
|
||||
rules.DropBoxLongLivedAPIToken(),
|
||||
rules.DropBoxShortLivedAPIToken(),
|
||||
rules.DroneciAccessToken(),
|
||||
rules.Duffel(),
|
||||
rules.Dynatrace(),
|
||||
rules.EasyPost(),
|
||||
rules.EasyPostTestAPI(),
|
||||
rules.EtsyAccessToken(),
|
||||
rules.FacebookSecret(),
|
||||
rules.FacebookAccessToken(),
|
||||
rules.FacebookPageAccessToken(),
|
||||
rules.FastlyAPIToken(),
|
||||
rules.FinicityClientSecret(),
|
||||
rules.FinicityAPIToken(),
|
||||
rules.FlickrAccessToken(),
|
||||
rules.FinnhubAccessToken(),
|
||||
rules.FlutterwavePublicKey(),
|
||||
rules.FlutterwaveSecretKey(),
|
||||
rules.FlutterwaveEncKey(),
|
||||
rules.FrameIO(),
|
||||
rules.FreshbooksAccessToken(),
|
||||
rules.GoCardless(),
|
||||
// TODO figure out what makes sense for GCP
|
||||
// rules.GCPServiceAccount(),
|
||||
rules.GCPAPIKey(),
|
||||
rules.GitHubPat(),
|
||||
rules.GitHubFineGrainedPat(),
|
||||
rules.GitHubOauth(),
|
||||
rules.GitHubApp(),
|
||||
rules.GitHubRefresh(),
|
||||
rules.GitlabPat(),
|
||||
rules.GitlabPipelineTriggerToken(),
|
||||
rules.GitlabRunnerRegistrationToken(),
|
||||
rules.GitterAccessToken(),
|
||||
rules.GrafanaApiKey(),
|
||||
rules.GrafanaCloudApiToken(),
|
||||
rules.GrafanaServiceAccountToken(),
|
||||
rules.Hashicorp(),
|
||||
rules.HashicorpField(),
|
||||
rules.Heroku(),
|
||||
rules.HubSpot(),
|
||||
rules.HuggingFaceAccessToken(),
|
||||
rules.HuggingFaceOrganizationApiToken(),
|
||||
rules.Intercom(),
|
||||
rules.JFrogAPIKey(),
|
||||
rules.JFrogIdentityToken(),
|
||||
rules.JWT(),
|
||||
rules.JWTBase64(),
|
||||
rules.KrakenAccessToken(),
|
||||
rules.KucoinAccessToken(),
|
||||
rules.KucoinSecretKey(),
|
||||
rules.LaunchDarklyAccessToken(),
|
||||
rules.LinearAPIToken(),
|
||||
rules.LinearClientSecret(),
|
||||
rules.LinkedinClientID(),
|
||||
rules.LinkedinClientSecret(),
|
||||
rules.LobAPIToken(),
|
||||
rules.LobPubAPIToken(),
|
||||
rules.MailChimp(),
|
||||
rules.MailGunPubAPIToken(),
|
||||
rules.MailGunPrivateAPIToken(),
|
||||
rules.MailGunSigningKey(),
|
||||
rules.MapBox(),
|
||||
rules.MattermostAccessToken(),
|
||||
rules.MessageBirdAPIToken(),
|
||||
rules.MessageBirdClientID(),
|
||||
rules.NetlifyAccessToken(),
|
||||
rules.NewRelicUserID(),
|
||||
rules.NewRelicUserKey(),
|
||||
rules.NewRelicBrowserAPIKey(),
|
||||
rules.NPM(),
|
||||
rules.NytimesAccessToken(),
|
||||
rules.OktaAccessToken(),
|
||||
rules.OpenAI(),
|
||||
rules.PlaidAccessID(),
|
||||
rules.PlaidSecretKey(),
|
||||
rules.PlaidAccessToken(),
|
||||
rules.PlanetScalePassword(),
|
||||
rules.PlanetScaleAPIToken(),
|
||||
rules.PlanetScaleOAuthToken(),
|
||||
rules.PostManAPI(),
|
||||
rules.Prefect(),
|
||||
rules.PrivateKey(),
|
||||
rules.PulumiAPIToken(),
|
||||
rules.PyPiUploadToken(),
|
||||
rules.RapidAPIAccessToken(),
|
||||
rules.ReadMe(),
|
||||
rules.RubyGemsAPIToken(),
|
||||
rules.ScalingoAPIToken(),
|
||||
rules.SendbirdAccessID(),
|
||||
rules.SendbirdAccessToken(),
|
||||
rules.SendGridAPIToken(),
|
||||
rules.SendInBlueAPIToken(),
|
||||
rules.SentryAccessToken(),
|
||||
rules.ShippoAPIToken(),
|
||||
rules.ShopifyAccessToken(),
|
||||
rules.ShopifyCustomAccessToken(),
|
||||
rules.ShopifyPrivateAppAccessToken(),
|
||||
rules.ShopifySharedSecret(),
|
||||
rules.SidekiqSecret(),
|
||||
rules.SidekiqSensitiveUrl(),
|
||||
rules.SlackBotToken(),
|
||||
rules.SlackUserToken(),
|
||||
rules.SlackAppLevelToken(),
|
||||
rules.SlackConfigurationToken(),
|
||||
rules.SlackConfigurationRefreshToken(),
|
||||
rules.SlackLegacyBotToken(),
|
||||
rules.SlackLegacyWorkspaceToken(),
|
||||
rules.SlackLegacyToken(),
|
||||
rules.SlackWebHookUrl(),
|
||||
rules.Snyk(),
|
||||
rules.StripeAccessToken(),
|
||||
rules.SquareAccessToken(),
|
||||
rules.SquareSpaceAccessToken(),
|
||||
rules.SumoLogicAccessID(),
|
||||
rules.SumoLogicAccessToken(),
|
||||
rules.TeamsWebhook(),
|
||||
rules.TelegramBotToken(),
|
||||
rules.TravisCIAccessToken(),
|
||||
rules.Twilio(),
|
||||
rules.TwitchAPIToken(),
|
||||
rules.TwitterAPIKey(),
|
||||
rules.TwitterAPISecret(),
|
||||
rules.TwitterAccessToken(),
|
||||
rules.TwitterAccessSecret(),
|
||||
rules.TwitterBearerToken(),
|
||||
rules.Typeform(),
|
||||
rules.VaultBatchToken(),
|
||||
rules.VaultServiceToken(),
|
||||
rules.YandexAPIKey(),
|
||||
rules.YandexAWSAccessToken(),
|
||||
rules.YandexAccessToken(),
|
||||
rules.ZendeskSecretKey(),
|
||||
rules.GenericCredential(),
|
||||
rules.InfracostAPIToken(),
|
||||
}
|
||||
|
||||
// ensure rules have unique ids
|
||||
ruleLookUp := make(map[string]config.Rule)
|
||||
ruleLookUp := make(map[string]config.Rule, len(configRules))
|
||||
for _, rule := range configRules {
|
||||
// check if rule is in ruleLookUp
|
||||
if _, ok := ruleLookUp[rule.RuleID]; ok {
|
||||
@@ -202,7 +216,7 @@ func main() {
|
||||
log.Fatal().Err(err).Msg("Failed to parse template")
|
||||
}
|
||||
|
||||
f, err := os.Create("../../../config/gitleaks.toml")
|
||||
f, err := os.Create(gitleaksConfigPath)
|
||||
if err != nil {
|
||||
log.Fatal().Err(err).Msg("Failed to create rules.toml")
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
func AdafruitAPIKey() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Adafruit API Key",
|
||||
Description: "Identified a potential Adafruit API Key, which could lead to unauthorized access to Adafruit services and sensitive data exposure.",
|
||||
RuleID: "adafruit-api-key",
|
||||
Regex: generateSemiGenericRegex([]string{"adafruit"}, alphaNumericExtendedShort("32"), true),
|
||||
Keywords: []string{"adafruit"},
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
func AdobeClientID() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Adobe Client ID (OAuth Web)",
|
||||
Description: "Detected a pattern that resembles an Adobe OAuth Web Client ID, posing a risk of compromised Adobe integrations and data breaches.",
|
||||
RuleID: "adobe-client-id",
|
||||
Regex: generateSemiGenericRegex([]string{"adobe"}, hex("32"), true),
|
||||
Keywords: []string{"adobe"},
|
||||
@@ -24,7 +24,7 @@ func AdobeClientID() *config.Rule {
|
||||
func AdobeClientSecret() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Adobe Client Secret",
|
||||
Description: "Discovered a potential Adobe Client Secret, which, if exposed, could allow unauthorized Adobe service access and data manipulation.",
|
||||
RuleID: "adobe-client-secret",
|
||||
Regex: generateUniqueTokenRegex(`(p8e-)(?i)[a-z0-9]{32}`, true),
|
||||
Keywords: []string{"p8e-"},
|
||||
|
||||
@@ -9,8 +9,8 @@ import (
|
||||
func AgeSecretKey() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Age secret key",
|
||||
RuleID: "age secret key",
|
||||
Description: "Discovered a potential Age encryption tool secret key, risking data decryption and unauthorized access to sensitive information.",
|
||||
RuleID: "age-secret-key",
|
||||
Regex: regexp.MustCompile(`AGE-SECRET-KEY-1[QPZRY9X8GF2TVDW0S3JN54KHCE6MUA7L]{58}`),
|
||||
Keywords: []string{"AGE-SECRET-KEY-1"},
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
func Airtable() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Airtable API Key",
|
||||
Description: "Uncovered a possible Airtable API Key, potentially compromising database access and leading to data leakage or alteration.",
|
||||
RuleID: "airtable-api-key",
|
||||
Regex: generateSemiGenericRegex([]string{"airtable"}, alphaNumeric("17"), true),
|
||||
Keywords: []string{"airtable"},
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
func AlgoliaApiKey() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Algolia API Key",
|
||||
Description: "Identified an Algolia API Key, which could result in unauthorized search operations and data exposure on Algolia-managed platforms.",
|
||||
RuleID: "algolia-api-key",
|
||||
Regex: generateSemiGenericRegex([]string{"algolia"}, `[a-z0-9]{32}`, true),
|
||||
Keywords: []string{"algolia"},
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
func AlibabaAccessKey() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Alibaba AccessKey ID",
|
||||
Description: "Detected an Alibaba Cloud AccessKey ID, posing a risk of unauthorized cloud resource access and potential data compromise.",
|
||||
RuleID: "alibaba-access-key-id",
|
||||
Regex: generateUniqueTokenRegex(`(LTAI)(?i)[a-z0-9]{20}`, true),
|
||||
Keywords: []string{"LTAI"},
|
||||
@@ -25,7 +25,7 @@ func AlibabaAccessKey() *config.Rule {
|
||||
func AlibabaSecretKey() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Alibaba Secret Key",
|
||||
Description: "Discovered a potential Alibaba Cloud Secret Key, potentially allowing unauthorized operations and data access within Alibaba Cloud.",
|
||||
RuleID: "alibaba-secret-key",
|
||||
Regex: generateSemiGenericRegex([]string{"alibaba"},
|
||||
alphaNumeric("30"), true),
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
func AsanaClientID() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Asana Client ID",
|
||||
Description: "Discovered a potential Asana Client ID, risking unauthorized access to Asana projects and sensitive task information.",
|
||||
RuleID: "asana-client-id",
|
||||
Regex: generateSemiGenericRegex([]string{"asana"}, numeric("16"), true),
|
||||
Keywords: []string{"asana"},
|
||||
@@ -24,7 +24,7 @@ func AsanaClientID() *config.Rule {
|
||||
func AsanaClientSecret() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Asana Client Secret",
|
||||
Description: "Identified an Asana Client Secret, which could lead to compromised project management integrity and unauthorized access.",
|
||||
RuleID: "asana-client-secret",
|
||||
Regex: generateSemiGenericRegex([]string{"asana"}, alphaNumeric("32"), true),
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
func Atlassian() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Atlassian API token",
|
||||
Description: "Detected an Atlassian API token, posing a threat to project management and collaboration tool security and data confidentiality.",
|
||||
RuleID: "atlassian-api-token",
|
||||
Regex: generateSemiGenericRegex([]string{
|
||||
"atlassian", "confluence", "jira"}, alphaNumeric("24"), true),
|
||||
|
||||
@@ -9,9 +9,9 @@ import (
|
||||
|
||||
func Authress() *config.Rule {
|
||||
// Rule Definition
|
||||
// (Note: When changes are made to this, rerun `cd cmd/generate/config && go run main.go` and commit the config/gitleaks.toml file
|
||||
// (Note: When changes are made to this, rerun `go generate ./...` and commit the config/gitleaks.toml file
|
||||
r := config.Rule{
|
||||
Description: "Authress Service Client Access Key",
|
||||
Description: "Uncovered a possible Authress Service Client Access Key, which may compromise access control services and sensitive data.",
|
||||
RuleID: "authress-service-client-access-key",
|
||||
Regex: generateUniqueTokenRegex(`(?:sc|ext|scauth|authress)_[a-z0-9]{5,30}\.[a-z0-9]{4,6}\.acc[_-][a-z0-9-]{10,32}\.[a-z0-9+/_=-]{30,120}`, true),
|
||||
Keywords: []string{"sc_", "ext_", "scauth_", "authress_"},
|
||||
|
||||
@@ -9,19 +9,15 @@ import (
|
||||
func AWS() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "AWS",
|
||||
Description: "Identified a pattern that may indicate AWS credentials, risking unauthorized cloud resource access and data breaches on AWS platforms.",
|
||||
RuleID: "aws-access-token",
|
||||
Regex: regexp.MustCompile(
|
||||
"(?:A3T[A-Z0-9]|AKIA|AGPA|AIDA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{16}"),
|
||||
"(?:A3T[A-Z0-9]|AKIA|ASIA|ABIA|ACCA)[A-Z0-9]{16}"),
|
||||
Keywords: []string{
|
||||
"AKIA",
|
||||
"AGPA",
|
||||
"AIDA",
|
||||
"AROA",
|
||||
"AIPA",
|
||||
"ANPA",
|
||||
"ANVA",
|
||||
"ASIA",
|
||||
"ABIA",
|
||||
"ACCA",
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
func Beamer() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Beamer API token",
|
||||
Description: "Detected a Beamer API token, potentially compromising content management and exposing sensitive notifications and updates.",
|
||||
RuleID: "beamer-api-token",
|
||||
Regex: generateSemiGenericRegex([]string{"beamer"},
|
||||
`b_[a-z0-9=_\-]{44}`, true),
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
func BitBucketClientID() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Bitbucket Client ID",
|
||||
Description: "Discovered a potential Bitbucket Client ID, risking unauthorized repository access and potential codebase exposure.",
|
||||
RuleID: "bitbucket-client-id",
|
||||
Regex: generateSemiGenericRegex([]string{"bitbucket"}, alphaNumeric("32"), true),
|
||||
Keywords: []string{"bitbucket"},
|
||||
@@ -24,7 +24,7 @@ func BitBucketClientID() *config.Rule {
|
||||
func BitBucketClientSecret() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Bitbucket Client Secret",
|
||||
Description: "Discovered a potential Bitbucket Client Secret, posing a risk of compromised code repositories and unauthorized access.",
|
||||
RuleID: "bitbucket-client-secret",
|
||||
Regex: generateSemiGenericRegex([]string{"bitbucket"}, alphaNumericExtended("64"), true),
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
func BittrexAccessKey() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Bittrex Access Key",
|
||||
Description: "Identified a Bittrex Access Key, which could lead to unauthorized access to cryptocurrency trading accounts and financial loss.",
|
||||
RuleID: "bittrex-access-key",
|
||||
Regex: generateSemiGenericRegex([]string{"bittrex"}, alphaNumeric("32"), true),
|
||||
Keywords: []string{"bittrex"},
|
||||
@@ -24,7 +24,7 @@ func BittrexAccessKey() *config.Rule {
|
||||
func BittrexSecretKey() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Bittrex Secret Key",
|
||||
Description: "Detected a Bittrex Secret Key, potentially compromising cryptocurrency transactions and financial security.",
|
||||
RuleID: "bittrex-secret-key",
|
||||
Regex: generateSemiGenericRegex([]string{"bittrex"}, alphaNumeric("32"), true),
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
func Clojars() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Clojars API token",
|
||||
Description: "Uncovered a possible Clojars API token, risking unauthorized access to Clojure libraries and potential code manipulation.",
|
||||
RuleID: "clojars-api-token",
|
||||
Regex: regexp.MustCompile(`(?i)(CLOJARS_)[a-z0-9]{60}`),
|
||||
Keywords: []string{"clojars"},
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
package rules
|
||||
|
||||
import (
|
||||
"github.com/zricethezav/gitleaks/v8/config"
|
||||
)
|
||||
|
||||
var global_keys = []string{
|
||||
`cloudflare_global_api_key = "d3d1443e0adc9c24564c6c5676d679d47e2ca"`, // gitleaks:allow
|
||||
`CLOUDFLARE_GLOBAL_API_KEY: 674538c7ecac77d064958a04a83d9e9db068c`, // gitleaks:allow
|
||||
`cloudflare: "0574b9f43978174cc2cb9a1068681225433c4"`, // gitleaks:allow
|
||||
}
|
||||
|
||||
var api_keys = []string{
|
||||
`cloudflare_api_key = "Bu0rrK-lerk6y0Suqo1qSqlDDajOk61wZchCkje4"`, // gitleaks:allow
|
||||
`CLOUDFLARE_API_KEY: 5oK0U90ME14yU6CVxV90crvfqVlNH2wRKBwcLWDc`, // gitleaks:allow
|
||||
`cloudflare: "oj9Yoyq0zmOyWmPPob1aoY5YSNNuJ0fbZSOURBlX"`, // gitleaks:allow
|
||||
}
|
||||
|
||||
var origin_ca_keys = []string{
|
||||
`CLOUDFLARE_ORIGIN_CA: v1.0-aaa334dc886f30631ba0a610-0d98ef66290d7e50aac7c27b5986c99e6f3f1084c881d8ac0eae5de1d1aa0644076ff57022069b3237d19afe60ad045f207ef2b16387ee37b749441b2ae2e9ebe5b4606e846475d4a5`,
|
||||
`CLOUDFLARE_ORIGIN_CA: v1.0-15d20c7fccb4234ac5cdd756-d5c2630d1b606535cf9320ae7456b090e0896cec64169a92fae4e931ab0f72f111b2e4ffed5b2bb40f6fba6b2214df23b188a23693d59ce3fb0d28f7e89a2206d98271b002dac695ed`,
|
||||
}
|
||||
|
||||
var identifiers = []string{"cloudflare"}
|
||||
|
||||
func CloudflareGlobalAPIKey() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Detected a Cloudflare Global API Key, potentially compromising cloud application deployments and operational security.",
|
||||
RuleID: "cloudflare-global-api-key",
|
||||
Regex: generateSemiGenericRegex(identifiers, hex("37"), true),
|
||||
|
||||
Keywords: identifiers,
|
||||
}
|
||||
|
||||
// validate
|
||||
tps := global_keys
|
||||
fps := append(api_keys, origin_ca_keys...)
|
||||
|
||||
return validate(r, tps, fps)
|
||||
}
|
||||
|
||||
func CloudflareAPIKey() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Detected a Cloudflare API Key, potentially compromising cloud application deployments and operational security.",
|
||||
RuleID: "cloudflare-api-key",
|
||||
Regex: generateSemiGenericRegex(identifiers, alphaNumericExtendedShort("40"), true),
|
||||
|
||||
Keywords: identifiers,
|
||||
}
|
||||
|
||||
// validate
|
||||
tps := api_keys
|
||||
fps := append(global_keys, origin_ca_keys...)
|
||||
|
||||
return validate(r, tps, fps)
|
||||
}
|
||||
|
||||
func CloudflareOriginCAKey() *config.Rule {
|
||||
ca_identifiers := append(identifiers, "v1.0-")
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Detected a Cloudflare Origin CA Key, potentially compromising cloud application deployments and operational security.",
|
||||
RuleID: "cloudflare-origin-ca-key",
|
||||
Regex: generateUniqueTokenRegex(`v1\.0-`+hex("24")+"-"+hex("146"), false),
|
||||
|
||||
Keywords: ca_identifiers,
|
||||
}
|
||||
|
||||
// validate
|
||||
tps := origin_ca_keys
|
||||
fps := append(global_keys, api_keys...)
|
||||
|
||||
return validate(r, tps, fps)
|
||||
}
|
||||
@@ -9,7 +9,7 @@ func CodecovAccessToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "codecov-access-token",
|
||||
Description: "Codecov Access Token",
|
||||
Description: "Found a pattern resembling a Codecov Access Token, posing a risk of unauthorized access to code coverage reports and sensitive data.",
|
||||
Regex: generateSemiGenericRegex([]string{"codecov"}, alphaNumeric("32"), true),
|
||||
Keywords: []string{
|
||||
"codecov",
|
||||
|
||||
@@ -9,7 +9,7 @@ func CoinbaseAccessToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "coinbase-access-token",
|
||||
Description: "Coinbase Access Token",
|
||||
Description: "Detected a Coinbase Access Token, posing a risk of unauthorized access to cryptocurrency accounts and financial transactions.",
|
||||
Regex: generateSemiGenericRegex([]string{"coinbase"},
|
||||
alphaNumericExtendedShort("64"), true),
|
||||
Keywords: []string{
|
||||
|
||||
@@ -9,7 +9,7 @@ func ConfluentSecretKey() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "confluent-secret-key",
|
||||
Description: "Confluent Secret Key",
|
||||
Description: "Found a Confluent Secret Key, potentially risking unauthorized operations and data access within Confluent services.",
|
||||
Regex: generateSemiGenericRegex([]string{"confluent"}, alphaNumeric("64"), true),
|
||||
Keywords: []string{
|
||||
"confluent",
|
||||
@@ -27,7 +27,7 @@ func ConfluentAccessToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "confluent-access-token",
|
||||
Description: "Confluent Access Token",
|
||||
Description: "Identified a Confluent Access Token, which could compromise access to streaming data platforms and sensitive data flow.",
|
||||
Regex: generateSemiGenericRegex([]string{"confluent"}, alphaNumeric("16"), true),
|
||||
|
||||
Keywords: []string{
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
func Contentful() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Contentful delivery API token",
|
||||
Description: "Discovered a Contentful delivery API token, posing a risk to content management systems and data integrity.",
|
||||
RuleID: "contentful-delivery-api-token",
|
||||
Regex: generateSemiGenericRegex([]string{"contentful"},
|
||||
alphaNumericExtended("43"), true),
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
func Databricks() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Databricks API token",
|
||||
Description: "Uncovered a Databricks API token, which may compromise big data analytics platforms and sensitive data processing.",
|
||||
RuleID: "databricks-api-token",
|
||||
Regex: generateUniqueTokenRegex(`dapi[a-h0-9]{32}`, true),
|
||||
Keywords: []string{"dapi"},
|
||||
|
||||
@@ -9,7 +9,7 @@ func DatadogtokenAccessToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "datadog-access-token",
|
||||
Description: "Datadog Access Token",
|
||||
Description: "Detected a Datadog Access Token, potentially risking monitoring and analytics data exposure and manipulation.",
|
||||
Regex: generateSemiGenericRegex([]string{"datadog"},
|
||||
alphaNumeric("40"), true),
|
||||
Keywords: []string{
|
||||
|
||||
@@ -9,7 +9,7 @@ func DefinedNetworkingAPIToken() *config.Rule {
|
||||
// Define Rule
|
||||
r := config.Rule{
|
||||
// Human redable description of the rule
|
||||
Description: "Defined Networking API token",
|
||||
Description: "Identified a Defined Networking API token, which could lead to unauthorized network operations and data breaches.",
|
||||
|
||||
// Unique ID for the rule
|
||||
RuleID: "defined-networking-api-token",
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
|
||||
func DigitalOceanPAT() *config.Rule {
|
||||
r := config.Rule{
|
||||
Description: "DigitalOcean Personal Access Token",
|
||||
Description: "Discovered a DigitalOcean Personal Access Token, posing a threat to cloud infrastructure security and data privacy.",
|
||||
RuleID: "digitalocean-pat",
|
||||
Regex: generateUniqueTokenRegex(`dop_v1_[a-f0-9]{64}`, true),
|
||||
Keywords: []string{"dop_v1_"},
|
||||
@@ -21,7 +21,7 @@ func DigitalOceanPAT() *config.Rule {
|
||||
|
||||
func DigitalOceanOAuthToken() *config.Rule {
|
||||
r := config.Rule{
|
||||
Description: "DigitalOcean OAuth Access Token",
|
||||
Description: "Found a DigitalOcean OAuth Access Token, risking unauthorized cloud resource access and data compromise.",
|
||||
RuleID: "digitalocean-access-token",
|
||||
|
||||
Regex: generateUniqueTokenRegex(`doo_v1_[a-f0-9]{64}`, true),
|
||||
@@ -36,7 +36,7 @@ func DigitalOceanOAuthToken() *config.Rule {
|
||||
|
||||
func DigitalOceanRefreshToken() *config.Rule {
|
||||
r := config.Rule{
|
||||
Description: "DigitalOcean OAuth Refresh Token",
|
||||
Description: "Uncovered a DigitalOcean OAuth Refresh Token, which could allow prolonged unauthorized access and resource manipulation.",
|
||||
RuleID: "digitalocean-refresh-token",
|
||||
|
||||
Regex: generateUniqueTokenRegex(`dor_v1_[a-f0-9]{64}`, true),
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
func DiscordAPIToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Discord API key",
|
||||
Description: "Detected a Discord API key, potentially compromising communication channels and user data privacy on Discord.",
|
||||
RuleID: "discord-api-token",
|
||||
Regex: generateSemiGenericRegex([]string{"discord"}, hex("64"), true),
|
||||
Keywords: []string{"discord"},
|
||||
@@ -24,7 +24,7 @@ func DiscordAPIToken() *config.Rule {
|
||||
func DiscordClientID() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Discord client ID",
|
||||
Description: "Identified a Discord client ID, which may lead to unauthorized integrations and data exposure in Discord applications.",
|
||||
RuleID: "discord-client-id",
|
||||
Regex: generateSemiGenericRegex([]string{"discord"}, numeric("18"), true),
|
||||
Keywords: []string{"discord"},
|
||||
@@ -40,7 +40,7 @@ func DiscordClientID() *config.Rule {
|
||||
func DiscordClientSecret() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Discord client secret",
|
||||
Description: "Discovered a potential Discord client secret, risking compromised Discord bot integrations and data leaks.",
|
||||
RuleID: "discord-client-secret",
|
||||
Regex: generateSemiGenericRegex([]string{"discord"}, alphaNumericExtended("32"), true),
|
||||
Keywords: []string{"discord"},
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
func Doppler() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Doppler API token",
|
||||
Description: "Discovered a Doppler API token, posing a risk to environment and secrets management security.",
|
||||
RuleID: "doppler-api-token",
|
||||
Regex: regexp.MustCompile(`(dp\.pt\.)(?i)[a-z0-9]{43}`),
|
||||
Keywords: []string{"doppler"},
|
||||
|
||||
@@ -9,7 +9,7 @@ func DroneciAccessToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "droneci-access-token",
|
||||
Description: "Droneci Access Token",
|
||||
Description: "Detected a Droneci Access Token, potentially compromising continuous integration and deployment workflows.",
|
||||
Regex: generateSemiGenericRegex([]string{"droneci"}, alphaNumeric("32"), true),
|
||||
|
||||
Keywords: []string{
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
func DropBoxAPISecret() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Dropbox API secret",
|
||||
Description: "Identified a Dropbox API secret, which could lead to unauthorized file access and data breaches in Dropbox storage.",
|
||||
RuleID: "dropbox-api-token",
|
||||
Regex: generateSemiGenericRegex([]string{"dropbox"}, alphaNumeric("15"), true),
|
||||
|
||||
@@ -26,7 +26,7 @@ func DropBoxShortLivedAPIToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "dropbox-short-lived-api-token",
|
||||
Description: "Dropbox short lived API token",
|
||||
Description: "Discovered a Dropbox short-lived API token, posing a risk of temporary but potentially harmful data access and manipulation.",
|
||||
Regex: generateSemiGenericRegex([]string{"dropbox"}, `sl\.[a-z0-9\-=_]{135}`, true),
|
||||
Keywords: []string{"dropbox"},
|
||||
}
|
||||
@@ -39,7 +39,7 @@ func DropBoxLongLivedAPIToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "dropbox-long-lived-api-token",
|
||||
Description: "Dropbox long lived API token",
|
||||
Description: "Found a Dropbox long-lived API token, risking prolonged unauthorized access to cloud storage and sensitive data.",
|
||||
Regex: generateSemiGenericRegex([]string{"dropbox"}, `[a-z0-9]{11}(AAAAAAAAAA)[a-z0-9\-_=]{43}`, true),
|
||||
Keywords: []string{"dropbox"},
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ func Duffel() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "duffel-api-token",
|
||||
Description: "Duffel API token",
|
||||
Description: "Uncovered a Duffel API token, which may compromise travel platform integrations and sensitive customer data.",
|
||||
Regex: regexp.MustCompile(`duffel_(test|live)_(?i)[a-z0-9_\-=]{43}`),
|
||||
Keywords: []string{"duffel"},
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
func Dynatrace() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Dynatrace API token",
|
||||
Description: "Detected a Dynatrace API token, potentially risking application performance monitoring and data exposure.",
|
||||
RuleID: "dynatrace-api-token",
|
||||
Regex: regexp.MustCompile(`dt0c01\.(?i)[a-z0-9]{24}\.[a-z0-9]{64}`),
|
||||
Keywords: []string{"dynatrace"},
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
func EasyPost() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "EasyPost API token",
|
||||
Description: "Identified an EasyPost API token, which could lead to unauthorized postal and shipment service access and data exposure.",
|
||||
RuleID: "easypost-api-token",
|
||||
Regex: regexp.MustCompile(`\bEZAK(?i)[a-z0-9]{54}`),
|
||||
Keywords: []string{"EZAK"},
|
||||
@@ -26,7 +26,7 @@ func EasyPost() *config.Rule {
|
||||
func EasyPostTestAPI() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "EasyPost test API token",
|
||||
Description: "Detected an EasyPost test API token, risking exposure of test environments and potentially sensitive shipment data.",
|
||||
RuleID: "easypost-test-api-token",
|
||||
Regex: regexp.MustCompile(`\bEZTK(?i)[a-z0-9]{54}`),
|
||||
Keywords: []string{"EZTK"},
|
||||
|
||||
@@ -9,7 +9,7 @@ func EtsyAccessToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "etsy-access-token",
|
||||
Description: "Etsy Access Token",
|
||||
Description: "Found an Etsy Access Token, potentially compromising Etsy shop management and customer data.",
|
||||
Regex: generateSemiGenericRegex([]string{"etsy"}, alphaNumeric("24"), true),
|
||||
|
||||
Keywords: []string{
|
||||
|
||||
@@ -5,11 +5,13 @@ import (
|
||||
"github.com/zricethezav/gitleaks/v8/config"
|
||||
)
|
||||
|
||||
func Facebook() *config.Rule {
|
||||
// This rule includes both App Secret and Client Access Token
|
||||
// https://developers.facebook.com/docs/facebook-login/guides/access-tokens/
|
||||
func FacebookSecret() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Facebook Access Token",
|
||||
RuleID: "facebook",
|
||||
Description: "Discovered a Facebook Application secret, posing a risk of unauthorized access to Facebook accounts and personal data exposure.",
|
||||
RuleID: "facebook-secret",
|
||||
Regex: generateSemiGenericRegex([]string{"facebook"}, hex("32"), true),
|
||||
|
||||
Keywords: []string{"facebook"},
|
||||
@@ -18,6 +20,46 @@ func Facebook() *config.Rule {
|
||||
// validate
|
||||
tps := []string{
|
||||
generateSampleSecret("facebook", secrets.NewSecret(hex("32"))),
|
||||
`facebook_app_secret = "6dca6432e45d933e13650d1882bd5e69"`, // gitleaks:allow
|
||||
`facebook_client_access_token: 26f5fd13099f2c1331aafb86f6489692`, // gitleaks:allow
|
||||
}
|
||||
return validate(r, tps, nil)
|
||||
}
|
||||
|
||||
// https://developers.facebook.com/docs/facebook-login/guides/access-tokens/#apptokens
|
||||
func FacebookAccessToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Discovered a Facebook Access Token, posing a risk of unauthorized access to Facebook accounts and personal data exposure.",
|
||||
RuleID: "facebook-access-token",
|
||||
Regex: generateUniqueTokenRegex(`\d{15,16}(\||%)[0-9a-z\-_]{27,40}`, true),
|
||||
}
|
||||
|
||||
// validate
|
||||
tps := []string{
|
||||
`{"access_token":"911602140448729|AY-lRJZq9BoDLobvAiP25L7RcMg","token_type":"bearer"}`, // gitleaks:allow
|
||||
`1308742762612587|rhoK1cbv0DOU_RTX_87O4MkX7AI`, // gitleaks:allow
|
||||
`1477036645700765|wRPf2v3mt2JfMqCLK8n7oltrEmc`, // gitleaks:allow
|
||||
}
|
||||
return validate(r, tps, nil)
|
||||
}
|
||||
|
||||
// https://developers.facebook.com/docs/facebook-login/guides/access-tokens/#pagetokens
|
||||
func FacebookPageAccessToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Discovered a Facebook Page Access Token, posing a risk of unauthorized access to Facebook accounts and personal data exposure.",
|
||||
RuleID: "facebook-page-access-token",
|
||||
Regex: generateUniqueTokenRegex("EAA[MC]"+alphaNumeric("20,"), true),
|
||||
Keywords: []string{"EAAM", "EAAC"},
|
||||
}
|
||||
|
||||
// validate
|
||||
tps := []string{
|
||||
`EAAM9GOnCB9kBO2frzOAWGN2zMnZClQshlWydZCrBNdodesbwimx1mfVJgqZBP5RSpMfUzWhtjTTXHG5I1UlvlwRZCgjm3ZBVGeTYiqAAoxyED6HaUdhpGVNoPUwAuAWWFsi9OvyYBQt22DGLqMIgD7VktuCTTZCWKasz81Q822FPhMTB9VFFyClNzQ0NLZClt9zxpsMMrUZCo1VU1rL3CKavir5QTfBjfCEzHNlWAUDUV2YZD`, // gitleaks:allow
|
||||
`EAAM9GOnCB9kBO2zXpAtRBmCrsPPjdA3KeBl4tqsEpcYd09cpjm9MZCBIklZBjIQBKGIJgFwm8IE17G5pipsfRBRBEHMWxvJsL7iHLUouiprxKRQfAagw8BEEDucceqxTiDhVW2IZAQNNbf0d1JhcapAGntx5S1Csm4j0GgZB3DuUfI2HJ9aViTtdfH2vjBy0wtpXm2iamevohGfoF4NgyRHusDLjqy91uYMkfrkc`, // gitleaks:allow
|
||||
`- name: FACEBOOK_TOKEN
|
||||
value: "EAACEdEose0cBA1bad3afsf2aew"`, // gitleaks:allow
|
||||
}
|
||||
return validate(r, tps, nil)
|
||||
}
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
func FastlyAPIToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Fastly API key",
|
||||
Description: "Uncovered a Fastly API key, which may compromise CDN and edge cloud services, leading to content delivery and security issues.",
|
||||
RuleID: "fastly-api-token",
|
||||
Regex: generateSemiGenericRegex([]string{"fastly"}, alphaNumericExtended("32"), true),
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
func FinicityClientSecret() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Finicity Client Secret",
|
||||
Description: "Identified a Finicity Client Secret, which could lead to compromised financial service integrations and data breaches.",
|
||||
RuleID: "finicity-client-secret",
|
||||
Regex: generateSemiGenericRegex([]string{"finicity"}, alphaNumeric("20"), true),
|
||||
|
||||
@@ -25,7 +25,7 @@ func FinicityClientSecret() *config.Rule {
|
||||
func FinicityAPIToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Finicity API token",
|
||||
Description: "Detected a Finicity API token, potentially risking financial data access and unauthorized financial operations.",
|
||||
RuleID: "finicity-api-token",
|
||||
Regex: generateSemiGenericRegex([]string{"finicity"}, hex("32"), true),
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ func FinnhubAccessToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "finnhub-access-token",
|
||||
Description: "Finnhub Access Token",
|
||||
Description: "Found a Finnhub Access Token, risking unauthorized access to financial market data and analytics.",
|
||||
Regex: generateSemiGenericRegex([]string{"finnhub"}, alphaNumeric("20"), true),
|
||||
|
||||
Keywords: []string{
|
||||
|
||||
@@ -9,7 +9,7 @@ func FlickrAccessToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "flickr-access-token",
|
||||
Description: "Flickr Access Token",
|
||||
Description: "Discovered a Flickr Access Token, posing a risk of unauthorized photo management and potential data leakage.",
|
||||
Regex: generateSemiGenericRegex([]string{"flickr"}, alphaNumeric("32"), true),
|
||||
|
||||
Keywords: []string{
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
func FlutterwavePublicKey() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Finicity Public Key",
|
||||
Description: "Detected a Finicity Public Key, potentially exposing public cryptographic operations and integrations.",
|
||||
RuleID: "flutterwave-public-key",
|
||||
Regex: regexp.MustCompile(`FLWPUBK_TEST-(?i)[a-h0-9]{32}-X`),
|
||||
Keywords: []string{"FLWPUBK_TEST"},
|
||||
@@ -26,7 +26,7 @@ func FlutterwavePublicKey() *config.Rule {
|
||||
func FlutterwaveSecretKey() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Flutterwave Secret Key",
|
||||
Description: "Identified a Flutterwave Secret Key, risking unauthorized financial transactions and data breaches.",
|
||||
RuleID: "flutterwave-secret-key",
|
||||
Regex: regexp.MustCompile(`FLWSECK_TEST-(?i)[a-h0-9]{32}-X`),
|
||||
Keywords: []string{"FLWSECK_TEST"},
|
||||
@@ -42,7 +42,7 @@ func FlutterwaveSecretKey() *config.Rule {
|
||||
func FlutterwaveEncKey() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Flutterwave Encryption Key",
|
||||
Description: "Uncovered a Flutterwave Encryption Key, which may compromise payment processing and sensitive financial information.",
|
||||
RuleID: "flutterwave-encryption-key",
|
||||
Regex: regexp.MustCompile(`FLWSECK_TEST-(?i)[a-h0-9]{12}`),
|
||||
Keywords: []string{"FLWSECK_TEST"},
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
func FrameIO() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Frame.io API token",
|
||||
Description: "Found a Frame.io API token, potentially compromising video collaboration and project management.",
|
||||
RuleID: "frameio-api-token",
|
||||
Regex: regexp.MustCompile(`fio-u-(?i)[a-z0-9\-_=]{64}`),
|
||||
Keywords: []string{"fio-u-"},
|
||||
|
||||
@@ -9,7 +9,7 @@ func FreshbooksAccessToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "freshbooks-access-token",
|
||||
Description: "Freshbooks Access Token",
|
||||
Description: "Discovered a Freshbooks Access Token, posing a risk to accounting software access and sensitive financial data exposure.",
|
||||
Regex: generateSemiGenericRegex([]string{"freshbooks"}, alphaNumeric("64"), true),
|
||||
|
||||
Keywords: []string{
|
||||
|
||||
@@ -28,7 +28,7 @@ func GCPAPIKey() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "gcp-api-key",
|
||||
Description: "GCP API key",
|
||||
Description: "Uncovered a GCP API key, which could lead to unauthorized access to Google Cloud services and data breaches.",
|
||||
Regex: generateUniqueTokenRegex(`AIza[0-9A-Za-z\\-_]{35}`, true),
|
||||
|
||||
Keywords: []string{
|
||||
|
||||
@@ -8,7 +8,7 @@ func GenericCredential() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "generic-api-key",
|
||||
Description: "Generic API Key",
|
||||
Description: "Detected a Generic API Key, potentially exposing access to various services and sensitive operations.",
|
||||
Regex: generateSemiGenericRegex([]string{
|
||||
"key",
|
||||
"api",
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
func GitHubPat() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "GitHub Personal Access Token",
|
||||
Description: "Uncovered a GitHub Personal Access Token, potentially leading to unauthorized repository access and sensitive content exposure.",
|
||||
RuleID: "github-pat",
|
||||
Regex: regexp.MustCompile(`ghp_[0-9a-zA-Z]{36}`),
|
||||
Keywords: []string{"ghp_"},
|
||||
@@ -26,7 +26,7 @@ func GitHubPat() *config.Rule {
|
||||
func GitHubFineGrainedPat() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "GitHub Fine-Grained Personal Access Token",
|
||||
Description: "Found a GitHub Fine-Grained Personal Access Token, risking unauthorized repository access and code manipulation.",
|
||||
RuleID: "github-fine-grained-pat",
|
||||
Regex: regexp.MustCompile(`github_pat_[0-9a-zA-Z_]{82}`),
|
||||
Keywords: []string{"github_pat_"},
|
||||
@@ -42,7 +42,7 @@ func GitHubFineGrainedPat() *config.Rule {
|
||||
func GitHubOauth() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "GitHub OAuth Access Token",
|
||||
Description: "Discovered a GitHub OAuth Access Token, posing a risk of compromised GitHub account integrations and data leaks.",
|
||||
RuleID: "github-oauth",
|
||||
Regex: regexp.MustCompile(`gho_[0-9a-zA-Z]{36}`),
|
||||
Keywords: []string{"gho_"},
|
||||
@@ -58,7 +58,7 @@ func GitHubOauth() *config.Rule {
|
||||
func GitHubApp() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "GitHub App Token",
|
||||
Description: "Identified a GitHub App Token, which may compromise GitHub application integrations and source code security.",
|
||||
RuleID: "github-app-token",
|
||||
Regex: regexp.MustCompile(`(ghu|ghs)_[0-9a-zA-Z]{36}`),
|
||||
Keywords: []string{"ghu_", "ghs_"},
|
||||
@@ -75,7 +75,7 @@ func GitHubApp() *config.Rule {
|
||||
func GitHubRefresh() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "GitHub Refresh Token",
|
||||
Description: "Detected a GitHub Refresh Token, which could allow prolonged unauthorized access to GitHub services.",
|
||||
RuleID: "github-refresh-token",
|
||||
Regex: regexp.MustCompile(`ghr_[0-9a-zA-Z]{36}`),
|
||||
Keywords: []string{"ghr_"},
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
func GitlabPat() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "GitLab Personal Access Token",
|
||||
Description: "Identified a GitLab Personal Access Token, risking unauthorized access to GitLab repositories and codebase exposure.",
|
||||
RuleID: "gitlab-pat",
|
||||
Regex: regexp.MustCompile(`glpat-[0-9a-zA-Z\-\_]{20}`),
|
||||
Keywords: []string{"glpat-"},
|
||||
@@ -26,7 +26,7 @@ func GitlabPat() *config.Rule {
|
||||
func GitlabPipelineTriggerToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "GitLab Pipeline Trigger Token",
|
||||
Description: "Found a GitLab Pipeline Trigger Token, potentially compromising continuous integration workflows and project security.",
|
||||
RuleID: "gitlab-ptt",
|
||||
Regex: regexp.MustCompile(`glptt-[0-9a-f]{40}`),
|
||||
Keywords: []string{"glptt-"},
|
||||
@@ -42,7 +42,7 @@ func GitlabPipelineTriggerToken() *config.Rule {
|
||||
func GitlabRunnerRegistrationToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "GitLab Runner Registration Token",
|
||||
Description: "Discovered a GitLab Runner Registration Token, posing a risk to CI/CD pipeline integrity and unauthorized access.",
|
||||
RuleID: "gitlab-rrt",
|
||||
Regex: regexp.MustCompile(`GR1348941[0-9a-zA-Z\-\_]{20}`),
|
||||
Keywords: []string{"GR1348941"},
|
||||
|
||||
@@ -9,7 +9,7 @@ func GitterAccessToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "gitter-access-token",
|
||||
Description: "Gitter Access Token",
|
||||
Description: "Uncovered a Gitter Access Token, which may lead to unauthorized access to chat and communication services.",
|
||||
Regex: generateSemiGenericRegex([]string{"gitter"},
|
||||
alphaNumericExtendedShort("40"), true),
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ func GoCardless() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "gocardless-api-token",
|
||||
Description: "GoCardless API token",
|
||||
Description: "Detected a GoCardless API token, potentially risking unauthorized direct debit payment operations and financial data exposure.",
|
||||
Regex: generateSemiGenericRegex([]string{"gocardless"}, `live_(?i)[a-z0-9\-_=]{40}`, true),
|
||||
|
||||
Keywords: []string{
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
func GrafanaApiKey() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Grafana api key (or Grafana cloud api key)",
|
||||
Description: "Identified a Grafana API key, which could compromise monitoring dashboards and sensitive data analytics.",
|
||||
RuleID: "grafana-api-key",
|
||||
|
||||
Regex: generateUniqueTokenRegex(`eyJrIjoi[A-Za-z0-9]{70,400}={0,2}`, true),
|
||||
@@ -27,7 +27,7 @@ func GrafanaApiKey() *config.Rule {
|
||||
func GrafanaCloudApiToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Grafana cloud api token",
|
||||
Description: "Found a Grafana cloud API token, risking unauthorized access to cloud-based monitoring services and data exposure.",
|
||||
RuleID: "grafana-cloud-api-token",
|
||||
|
||||
Regex: generateUniqueTokenRegex(`glc_[A-Za-z0-9+/]{32,400}={0,2}`, true),
|
||||
@@ -46,7 +46,7 @@ func GrafanaCloudApiToken() *config.Rule {
|
||||
func GrafanaServiceAccountToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Grafana service account token",
|
||||
Description: "Discovered a Grafana service account token, posing a risk of compromised monitoring services and data integrity.",
|
||||
RuleID: "grafana-service-account-token",
|
||||
|
||||
Regex: generateUniqueTokenRegex(`glsa_[A-Za-z0-9]{32}_[A-Fa-f0-9]{8}`, true),
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
func Hashicorp() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "HashiCorp Terraform user/org API token",
|
||||
Description: "Uncovered a HashiCorp Terraform user/org API token, which may lead to unauthorized infrastructure management and security breaches.",
|
||||
RuleID: "hashicorp-tf-api-token",
|
||||
Regex: regexp.MustCompile(`(?i)[a-z0-9]{14}\.atlasv1\.[a-z0-9\-_=]{60,70}`),
|
||||
Keywords: []string{"atlasv1"},
|
||||
@@ -28,7 +28,7 @@ func HashicorpField() *config.Rule {
|
||||
keywords := []string{"administrator_login_password", "password"}
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "HashiCorp Terraform password field",
|
||||
Description: "Identified a HashiCorp Terraform password field, risking unauthorized infrastructure configuration and security breaches.",
|
||||
RuleID: "hashicorp-tf-password",
|
||||
Regex: generateSemiGenericRegex(keywords, fmt.Sprintf(`"%s"`, alphaNumericExtended("8,20")), true),
|
||||
Keywords: keywords,
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
func Heroku() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Heroku API Key",
|
||||
Description: "Detected a Heroku API Key, potentially compromising cloud application deployments and operational security.",
|
||||
RuleID: "heroku-api-key",
|
||||
Regex: generateSemiGenericRegex([]string{"heroku"}, hex8_4_4_4_12(), true),
|
||||
|
||||
@@ -17,6 +17,7 @@ func Heroku() *config.Rule {
|
||||
// validate
|
||||
tps := []string{
|
||||
`const HEROKU_KEY = "12345678-ABCD-ABCD-ABCD-1234567890AB"`, // gitleaks:allow
|
||||
`heroku_api_key = "832d2129-a846-4e27-99f4-7004b6ad53ef"`, // gitleaks:allow
|
||||
}
|
||||
return validate(r, tps, nil)
|
||||
}
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
func HubSpot() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "HubSpot API Token",
|
||||
Description: "Found a HubSpot API Token, posing a risk to CRM data integrity and unauthorized marketing operations.",
|
||||
RuleID: "hubspot-api-key",
|
||||
Regex: generateSemiGenericRegex([]string{"hubspot"},
|
||||
`[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}`, true),
|
||||
|
||||
@@ -16,7 +16,7 @@ func HuggingFaceAccessToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "huggingface-access-token",
|
||||
Description: "Hugging Face Access token",
|
||||
Description: "Discovered a Hugging Face Access token, which could lead to unauthorized access to AI models and sensitive data.",
|
||||
Regex: regexp.MustCompile(`(?:^|[\\'"` + "`" + ` >=:])(hf_[a-zA-Z]{34})(?:$|[\\'"` + "`" + ` <])`),
|
||||
|
||||
Entropy: 1,
|
||||
@@ -71,7 +71,7 @@ func HuggingFaceOrganizationApiToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "huggingface-organization-api-token",
|
||||
Description: "Hugging Face Organization API token",
|
||||
Description: "Uncovered a Hugging Face Organization API token, potentially compromising AI organization accounts and associated data.",
|
||||
Regex: regexp.MustCompile(`(?:^|[\\'"` + "`" + ` >=:\(,)])(api_org_[a-zA-Z]{34})(?:$|[\\'"` + "`" + ` <\),])`),
|
||||
|
||||
Entropy: 2,
|
||||
|
||||
@@ -9,7 +9,7 @@ func InfracostAPIToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
// Human readable description of the rule
|
||||
Description: "Infracost API Token",
|
||||
Description: "Detected an Infracost API Token, risking unauthorized access to cloud cost estimation tools and financial data.",
|
||||
|
||||
// Unique ID for the rule
|
||||
RuleID: "infracost-api-token",
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
func Intercom() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Intercom API Token",
|
||||
Description: "Identified an Intercom API Token, which could compromise customer communication channels and data privacy.",
|
||||
RuleID: "intercom-api-key",
|
||||
Regex: generateSemiGenericRegex([]string{"intercom"}, alphaNumericExtended("60"), true),
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ func JFrogAPIKey() *config.Rule {
|
||||
// Define Rule
|
||||
r := config.Rule{
|
||||
// Human readable description of the rule
|
||||
Description: "JFrog API Key",
|
||||
Description: "Found a JFrog API Key, posing a risk of unauthorized access to software artifact repositories and build pipelines.",
|
||||
|
||||
// Unique ID for the rule
|
||||
RuleID: "jfrog-api-key",
|
||||
@@ -39,7 +39,7 @@ func JFrogIdentityToken() *config.Rule {
|
||||
// Define Rule
|
||||
r := config.Rule{
|
||||
// Human readable description of the rule
|
||||
Description: "JFrog Identity Token",
|
||||
Description: "Discovered a JFrog Identity Token, potentially compromising access to JFrog services and sensitive software artifacts.",
|
||||
|
||||
// Unique ID for the rule
|
||||
RuleID: "jfrog-identity-token",
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
func JWT() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "JSON Web Token",
|
||||
Description: "Uncovered a JSON Web Token, which may lead to unauthorized access to web applications and sensitive user data.",
|
||||
RuleID: "jwt",
|
||||
Regex: generateUniqueTokenRegex(`ey[a-zA-Z0-9]{17,}\.ey[a-zA-Z0-9\/\\_-]{17,}\.(?:[a-zA-Z0-9\/\\_-]{10,}={0,2})?`, false),
|
||||
Keywords: []string{"ey"},
|
||||
@@ -68,7 +68,7 @@ func JWTBase64() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "jwt-base64",
|
||||
Description: "Base64-encoded JSON Web Token",
|
||||
Description: "Detected a Base64-encoded JSON Web Token, posing a risk of exposing encoded authentication and data exchange information.",
|
||||
Regex: regexp.MustCompile(
|
||||
`\bZXlK(?:(?P<alg>aGJHY2lPaU)|(?P<apu>aGNIVWlPaU)|(?P<apv>aGNIWWlPaU)|(?P<aud>aGRXUWlPaU)|(?P<b64>aU5qUWlP)|(?P<crit>amNtbDBJanBi)|(?P<cty>amRIa2lPaU)|(?P<epk>bGNHc2lPbn)|(?P<enc>bGJtTWlPaU)|(?P<jku>cWEzVWlPaU)|(?P<jwk>cWQyc2lPb)|(?P<iss>cGMzTWlPaU)|(?P<iv>cGRpSTZJ)|(?P<kid>cmFXUWlP)|(?P<key_ops>clpYbGZiM0J6SWpwY)|(?P<kty>cmRIa2lPaUp)|(?P<nonce>dWIyNWpaU0k2)|(?P<p2c>d01tTWlP)|(?P<p2s>d01uTWlPaU)|(?P<ppt>d2NIUWlPaU)|(?P<sub>emRXSWlPaU)|(?P<svt>emRuUWlP)|(?P<tag>MFlXY2lPaU)|(?P<typ>MGVYQWlPaUp)|(?P<url>MWNtd2l)|(?P<use>MWMyVWlPaUp)|(?P<ver>MlpYSWlPaU)|(?P<version>MlpYSnphVzl1SWpv)|(?P<x>NElqb2)|(?P<x5c>NE5XTWlP)|(?P<x5t>NE5YUWlPaU)|(?P<x5ts256>NE5YUWpVekkxTmlJNkl)|(?P<x5u>NE5YVWlPaU)|(?P<zip>NmFYQWlPaU))[a-zA-Z0-9\/\\_+\-\r\n]{40,}={0,2}`),
|
||||
Keywords: []string{"zxlk"},
|
||||
|
||||
@@ -9,7 +9,7 @@ func KrakenAccessToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "kraken-access-token",
|
||||
Description: "Kraken Access Token",
|
||||
Description: "Identified a Kraken Access Token, potentially compromising cryptocurrency trading accounts and financial security.",
|
||||
Regex: generateSemiGenericRegex([]string{"kraken"},
|
||||
alphaNumericExtendedLong("80,90"), true),
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ func KucoinAccessToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "kucoin-access-token",
|
||||
Description: "Kucoin Access Token",
|
||||
Description: "Found a Kucoin Access Token, risking unauthorized access to cryptocurrency exchange services and transactions.",
|
||||
Regex: generateSemiGenericRegex([]string{"kucoin"}, hex("24"), true),
|
||||
|
||||
Keywords: []string{
|
||||
@@ -28,7 +28,7 @@ func KucoinSecretKey() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "kucoin-secret-key",
|
||||
Description: "Kucoin Secret Key",
|
||||
Description: "Discovered a Kucoin Secret Key, which could lead to compromised cryptocurrency operations and financial data breaches.",
|
||||
Regex: generateSemiGenericRegex([]string{"kucoin"}, hex8_4_4_4_12(), true),
|
||||
|
||||
Keywords: []string{
|
||||
|
||||
@@ -9,7 +9,7 @@ func LaunchDarklyAccessToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "launchdarkly-access-token",
|
||||
Description: "Launchdarkly Access Token",
|
||||
Description: "Uncovered a Launchdarkly Access Token, potentially compromising feature flag management and application functionality.",
|
||||
Regex: generateSemiGenericRegex([]string{"launchdarkly"}, alphaNumericExtended("40"), true),
|
||||
|
||||
Keywords: []string{
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
func LinearAPIToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Linear API Token",
|
||||
Description: "Detected a Linear API Token, posing a risk to project management tools and sensitive task data.",
|
||||
RuleID: "linear-api-key",
|
||||
Regex: regexp.MustCompile(`lin_api_(?i)[a-z0-9]{40}`),
|
||||
Keywords: []string{"lin_api_"},
|
||||
@@ -26,7 +26,7 @@ func LinearAPIToken() *config.Rule {
|
||||
func LinearClientSecret() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Linear Client Secret",
|
||||
Description: "Identified a Linear Client Secret, which may compromise secure integrations and sensitive project management data.",
|
||||
RuleID: "linear-client-secret",
|
||||
Regex: generateSemiGenericRegex([]string{"linear"}, hex("32"), true),
|
||||
Keywords: []string{"linear"},
|
||||
|
||||
@@ -9,7 +9,7 @@ func LinkedinClientSecret() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "linkedin-client-secret",
|
||||
Description: "LinkedIn Client secret",
|
||||
Description: "Discovered a LinkedIn Client secret, potentially compromising LinkedIn application integrations and user data.",
|
||||
Regex: generateSemiGenericRegex([]string{
|
||||
"linkedin",
|
||||
"linked-in",
|
||||
@@ -32,7 +32,7 @@ func LinkedinClientID() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "linkedin-client-id",
|
||||
Description: "LinkedIn Client ID",
|
||||
Description: "Found a LinkedIn Client ID, risking unauthorized access to LinkedIn integrations and professional data exposure.",
|
||||
Regex: generateSemiGenericRegex([]string{
|
||||
"linkedin",
|
||||
"linked-in",
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
func LobPubAPIToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Lob Publishable API Key",
|
||||
Description: "Detected a Lob Publishable API Key, posing a risk of exposing mail and print service integrations.",
|
||||
RuleID: "lob-pub-api-key",
|
||||
Regex: generateSemiGenericRegex([]string{"lob"}, `(test|live)_pub_[a-f0-9]{31}`, true),
|
||||
|
||||
@@ -29,7 +29,7 @@ func LobPubAPIToken() *config.Rule {
|
||||
func LobAPIToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Lob API Key",
|
||||
Description: "Uncovered a Lob API Key, which could lead to unauthorized access to mailing and address verification services.",
|
||||
RuleID: "lob-api-key",
|
||||
Regex: generateSemiGenericRegex([]string{"lob"}, `(live|test)_[a-f0-9]{35}`, true),
|
||||
Keywords: []string{
|
||||
|
||||
@@ -9,8 +9,8 @@ func MailChimp() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "mailchimp-api-key",
|
||||
Description: "Mailchimp API key",
|
||||
Regex: generateSemiGenericRegex([]string{"mailchimp"}, `[a-f0-9]{32}-us20`, true),
|
||||
Description: "Identified a Mailchimp API key, potentially compromising email marketing campaigns and subscriber data.",
|
||||
Regex: generateSemiGenericRegex([]string{"MailchimpSDK.initialize", "mailchimp"}, hex("32")+`-us\d\d`, true),
|
||||
|
||||
Keywords: []string{
|
||||
"mailchimp",
|
||||
@@ -20,6 +20,12 @@ func MailChimp() *config.Rule {
|
||||
// validate
|
||||
tps := []string{
|
||||
generateSampleSecret("mailchimp", secrets.NewSecret(hex("32"))+"-us20"),
|
||||
`mailchimp_api_key: cefa780880ba5f5696192a34f6292c35-us18`, // gitleaks:allow
|
||||
`MAILCHIMPE_KEY = "b5b9f8e50c640da28993e8b6a48e3e53-us18"`, // gitleaks:allow
|
||||
}
|
||||
return validate(r, tps, nil)
|
||||
fps := []string{
|
||||
// False Negative
|
||||
`MailchimpSDK.initialize(token: 3012a5754bbd716926f99c028f7ea428-us18)`, // gitleaks:allow
|
||||
}
|
||||
return validate(r, tps, fps)
|
||||
}
|
||||
@@ -9,7 +9,7 @@ func MailGunPrivateAPIToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "mailgun-private-api-token",
|
||||
Description: "Mailgun private API token",
|
||||
Description: "Found a Mailgun private API token, risking unauthorized email service operations and data breaches.",
|
||||
Regex: generateSemiGenericRegex([]string{"mailgun"}, `key-[a-f0-9]{32}`, true),
|
||||
|
||||
Keywords: []string{
|
||||
@@ -28,7 +28,7 @@ func MailGunPubAPIToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "mailgun-pub-key",
|
||||
Description: "Mailgun public validation key",
|
||||
Description: "Discovered a Mailgun public validation key, which could expose email verification processes and associated data.",
|
||||
Regex: generateSemiGenericRegex([]string{"mailgun"}, `pubkey-[a-f0-9]{32}`, true),
|
||||
|
||||
Keywords: []string{
|
||||
@@ -47,7 +47,7 @@ func MailGunSigningKey() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "mailgun-signing-key",
|
||||
Description: "Mailgun webhook signing key",
|
||||
Description: "Uncovered a Mailgun webhook signing key, potentially compromising email automation and data integrity.",
|
||||
Regex: generateSemiGenericRegex([]string{"mailgun"}, `[a-h0-9]{32}-[a-h0-9]{8}-[a-h0-9]{8}`, true),
|
||||
|
||||
Keywords: []string{
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
func MapBox() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "MapBox API token",
|
||||
Description: "Detected a MapBox API token, posing a risk to geospatial services and sensitive location data exposure.",
|
||||
RuleID: "mapbox-api-token",
|
||||
Regex: generateSemiGenericRegex([]string{"mapbox"}, `pk\.[a-z0-9]{60}\.[a-z0-9]{22}`, true),
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ func MattermostAccessToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "mattermost-access-token",
|
||||
Description: "Mattermost Access Token",
|
||||
Description: "Identified a Mattermost Access Token, which may compromise team communication channels and data privacy.",
|
||||
Regex: generateSemiGenericRegex([]string{"mattermost"}, alphaNumeric("26"), true),
|
||||
|
||||
Keywords: []string{
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
func MessageBirdAPIToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "MessageBird API token",
|
||||
Description: "Found a MessageBird API token, risking unauthorized access to communication platforms and message data.",
|
||||
RuleID: "messagebird-api-token",
|
||||
Regex: generateSemiGenericRegex([]string{
|
||||
"messagebird",
|
||||
@@ -35,7 +35,7 @@ func MessageBirdAPIToken() *config.Rule {
|
||||
func MessageBirdClientID() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "MessageBird client ID",
|
||||
Description: "Discovered a MessageBird client ID, potentially compromising API integrations and sensitive communication data.",
|
||||
RuleID: "messagebird-client-id",
|
||||
Regex: generateSemiGenericRegex([]string{
|
||||
"messagebird",
|
||||
|
||||
@@ -9,7 +9,7 @@ func NetlifyAccessToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "netlify-access-token",
|
||||
Description: "Netlify Access Token",
|
||||
Description: "Detected a Netlify Access Token, potentially compromising web hosting services and site management.",
|
||||
Regex: generateSemiGenericRegex([]string{"netlify"},
|
||||
alphaNumericExtended("40,46"), true),
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ func NewRelicUserID() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "new-relic-user-api-key",
|
||||
Description: "New Relic user API Key",
|
||||
Description: "Discovered a New Relic user API Key, which could lead to compromised application insights and performance monitoring.",
|
||||
Regex: generateSemiGenericRegex([]string{
|
||||
"new-relic",
|
||||
"newrelic",
|
||||
@@ -32,7 +32,7 @@ func NewRelicUserKey() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "new-relic-user-api-id",
|
||||
Description: "New Relic user API ID",
|
||||
Description: "Found a New Relic user API ID, posing a risk to application monitoring services and data integrity.",
|
||||
Regex: generateSemiGenericRegex([]string{
|
||||
"new-relic",
|
||||
"newrelic",
|
||||
@@ -57,7 +57,7 @@ func NewRelicBrowserAPIKey() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "new-relic-browser-api-token",
|
||||
Description: "New Relic ingest browser API token",
|
||||
Description: "Identified a New Relic ingest browser API token, risking unauthorized access to application performance data and analytics.",
|
||||
Regex: generateSemiGenericRegex([]string{
|
||||
"new-relic",
|
||||
"newrelic",
|
||||
|
||||
@@ -9,7 +9,7 @@ func NPM() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "npm-access-token",
|
||||
Description: "npm access token",
|
||||
Description: "Uncovered an npm access token, potentially compromising package management and code repository access.",
|
||||
Regex: generateUniqueTokenRegex(`npm_[a-z0-9]{36}`, true),
|
||||
|
||||
Keywords: []string{
|
||||
|
||||
@@ -9,7 +9,7 @@ func NytimesAccessToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "nytimes-access-token",
|
||||
Description: "Nytimes Access Token",
|
||||
Description: "Detected a Nytimes Access Token, risking unauthorized access to New York Times APIs and content services.",
|
||||
Regex: generateSemiGenericRegex([]string{
|
||||
"nytimes", "new-york-times,", "newyorktimes"},
|
||||
alphaNumericExtended("32"), true),
|
||||
|
||||
@@ -9,7 +9,7 @@ func OktaAccessToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "okta-access-token",
|
||||
Description: "Okta Access Token",
|
||||
Description: "Identified an Okta Access Token, which may compromise identity management services and user authentication data.",
|
||||
Regex: generateSemiGenericRegex([]string{"okta"},
|
||||
alphaNumericExtended("42"), true),
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ func OpenAI() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "openai-api-key",
|
||||
Description: "OpenAI API Key",
|
||||
Description: "Found an OpenAI API Key, posing a risk of unauthorized access to AI services and data manipulation.",
|
||||
Regex: generateUniqueTokenRegex(`sk-[a-zA-Z0-9]{20}T3BlbkFJ[a-zA-Z0-9]{20}`, true),
|
||||
|
||||
Keywords: []string{
|
||||
|
||||
@@ -11,7 +11,7 @@ func PlaidAccessID() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "plaid-client-id",
|
||||
Description: "Plaid Client ID",
|
||||
Description: "Uncovered a Plaid Client ID, which could lead to unauthorized financial service integrations and data breaches.",
|
||||
Regex: generateSemiGenericRegex([]string{"plaid"}, alphaNumeric("24"), true),
|
||||
|
||||
Entropy: 3.5,
|
||||
@@ -31,7 +31,7 @@ func PlaidSecretKey() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "plaid-secret-key",
|
||||
Description: "Plaid Secret key",
|
||||
Description: "Detected a Plaid Secret key, risking unauthorized access to financial accounts and sensitive transaction data.",
|
||||
Regex: generateSemiGenericRegex([]string{"plaid"}, alphaNumeric("30"), true),
|
||||
|
||||
Entropy: 3.5,
|
||||
@@ -51,7 +51,7 @@ func PlaidAccessToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "plaid-api-token",
|
||||
Description: "Plaid API Token",
|
||||
Description: "Discovered a Plaid API Token, potentially compromising financial data aggregation and banking services.",
|
||||
Regex: generateSemiGenericRegex([]string{"plaid"},
|
||||
fmt.Sprintf("access-(?:sandbox|development|production)-%s", hex8_4_4_4_12()), true),
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ func PlanetScalePassword() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "planetscale-password",
|
||||
Description: "PlanetScale password",
|
||||
Description: "Discovered a PlanetScale password, which could lead to unauthorized database operations and data breaches.",
|
||||
Regex: generateUniqueTokenRegex(`pscale_pw_(?i)[a-z0-9=\-_\.]{32,64}`, true),
|
||||
|
||||
Keywords: []string{
|
||||
@@ -30,7 +30,7 @@ func PlanetScaleAPIToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "planetscale-api-token",
|
||||
Description: "PlanetScale API token",
|
||||
Description: "Identified a PlanetScale API token, potentially compromising database management and operations.",
|
||||
Regex: generateUniqueTokenRegex(`pscale_tkn_(?i)[a-z0-9=\-_\.]{32,64}`, true),
|
||||
|
||||
Keywords: []string{
|
||||
@@ -51,7 +51,7 @@ func PlanetScaleOAuthToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "planetscale-oauth-token",
|
||||
Description: "PlanetScale OAuth token",
|
||||
Description: "Found a PlanetScale OAuth token, posing a risk to database access control and sensitive data integrity.",
|
||||
Regex: generateUniqueTokenRegex(`pscale_oauth_(?i)[a-z0-9=\-_\.]{32,64}`, true),
|
||||
|
||||
Keywords: []string{
|
||||
|
||||
@@ -9,7 +9,7 @@ func PostManAPI() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "postman-api-token",
|
||||
Description: "Postman API token",
|
||||
Description: "Uncovered a Postman API token, potentially compromising API testing and development workflows.",
|
||||
Regex: generateUniqueTokenRegex(`PMAK-(?i)[a-f0-9]{24}\-[a-f0-9]{34}`, true),
|
||||
|
||||
Keywords: []string{
|
||||
|
||||
@@ -9,7 +9,7 @@ func Prefect() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "prefect-api-token",
|
||||
Description: "Prefect API token",
|
||||
Description: "Detected a Prefect API token, risking unauthorized access to workflow management and automation services.",
|
||||
Regex: generateUniqueTokenRegex(`pnu_[a-z0-9]{36}`, true),
|
||||
|
||||
Keywords: []string{
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
func PrivateKey() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Private Key",
|
||||
Description: "Identified a Private Key, which may compromise cryptographic security and sensitive data encryption.",
|
||||
RuleID: "private-key",
|
||||
Regex: regexp.MustCompile(`(?i)-----BEGIN[ A-Z0-9_-]{0,100}PRIVATE KEY( BLOCK)?-----[\s\S-]*KEY( BLOCK)?----`),
|
||||
Keywords: []string{"-----BEGIN"},
|
||||
|
||||
@@ -9,7 +9,7 @@ func PulumiAPIToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "pulumi-api-token",
|
||||
Description: "Pulumi API token",
|
||||
Description: "Found a Pulumi API token, posing a risk to infrastructure as code services and cloud resource management.",
|
||||
Regex: generateUniqueTokenRegex(`pul-[a-f0-9]{40}`, true),
|
||||
|
||||
Keywords: []string{
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
func PyPiUploadToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "PyPI upload token",
|
||||
Description: "Discovered a PyPI upload token, potentially compromising Python package distribution and repository integrity.",
|
||||
RuleID: "pypi-upload-token",
|
||||
Regex: regexp.MustCompile(
|
||||
`pypi-AgEIcHlwaS5vcmc[A-Za-z0-9\-_]{50,1000}`),
|
||||
|
||||
@@ -9,7 +9,7 @@ func RapidAPIAccessToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "rapidapi-access-token",
|
||||
Description: "RapidAPI Access Token",
|
||||
Description: "Uncovered a RapidAPI Access Token, which could lead to unauthorized access to various APIs and data services.",
|
||||
Regex: generateSemiGenericRegex([]string{"rapidapi"},
|
||||
alphaNumericExtendedShort("50"), true),
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ func ReadMe() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "readme-api-token",
|
||||
Description: "Readme API token",
|
||||
Description: "Detected a Readme API token, risking unauthorized documentation management and content exposure.",
|
||||
Regex: generateUniqueTokenRegex(`rdme_[a-z0-9]{70}`, true),
|
||||
|
||||
Keywords: []string{
|
||||
|
||||
@@ -9,7 +9,7 @@ func RubyGemsAPIToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "rubygems-api-token",
|
||||
Description: "Rubygem API token",
|
||||
Description: "Identified a Rubygem API token, potentially compromising Ruby library distribution and package management.",
|
||||
Regex: generateUniqueTokenRegex(`rubygems_[a-f0-9]{48}`, true),
|
||||
|
||||
Keywords: []string{
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
package rules
|
||||
|
||||
import (
|
||||
"regexp"
|
||||
|
||||
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
|
||||
"github.com/zricethezav/gitleaks/v8/config"
|
||||
)
|
||||
@@ -10,15 +8,16 @@ import (
|
||||
func ScalingoAPIToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Scalingo API token",
|
||||
Description: "Found a Scalingo API token, posing a risk to cloud platform services and application deployment security.",
|
||||
RuleID: "scalingo-api-token",
|
||||
Regex: regexp.MustCompile(`\btk-us-[a-zA-Z0-9-_]{48}\b`),
|
||||
Regex: generateUniqueTokenRegex(`tk-us-[a-zA-Z0-9-_]{48}`, false),
|
||||
Keywords: []string{"tk-us-"},
|
||||
}
|
||||
|
||||
// validate
|
||||
tps := []string{
|
||||
generateSampleSecret("scalingo", "tk-us-"+secrets.NewSecret(alphaNumericExtendedShort("48"))),
|
||||
`scalingo_api_token = "tk-us-loys7ib9yrxcys_ta2sq85mjar6lgcsspkd9x61s7h5epf_-"`, // gitleaks:allow
|
||||
}
|
||||
return validate(r, tps, nil)
|
||||
}
|
||||
@@ -9,7 +9,7 @@ func SendbirdAccessToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "sendbird-access-token",
|
||||
Description: "Sendbird Access Token",
|
||||
Description: "Uncovered a Sendbird Access Token, potentially risking unauthorized access to communication services and user data.",
|
||||
Regex: generateSemiGenericRegex([]string{"sendbird"}, hex("40"), true),
|
||||
|
||||
Keywords: []string{
|
||||
@@ -28,7 +28,7 @@ func SendbirdAccessID() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "sendbird-access-id",
|
||||
Description: "Sendbird Access ID",
|
||||
Description: "Discovered a Sendbird Access ID, which could compromise chat and messaging platform integrations.",
|
||||
Regex: generateSemiGenericRegex([]string{"sendbird"}, hex8_4_4_4_12(), true),
|
||||
|
||||
Keywords: []string{
|
||||
|
||||
@@ -9,7 +9,7 @@ func SendGridAPIToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "sendgrid-api-token",
|
||||
Description: "SendGrid API token",
|
||||
Description: "Detected a SendGrid API token, posing a risk of unauthorized email service operations and data exposure.",
|
||||
Regex: generateUniqueTokenRegex(`SG\.(?i)[a-z0-9=_\-\.]{66}`, true),
|
||||
|
||||
Keywords: []string{
|
||||
|
||||
@@ -9,7 +9,7 @@ func SendInBlueAPIToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "sendinblue-api-token",
|
||||
Description: "Sendinblue API token",
|
||||
Description: "Identified a Sendinblue API token, which may compromise email marketing services and subscriber data privacy.",
|
||||
Regex: generateUniqueTokenRegex(`xkeysib-[a-f0-9]{64}\-(?i)[a-z0-9]{16}`, true),
|
||||
|
||||
Keywords: []string{
|
||||
|
||||
@@ -9,7 +9,7 @@ func SentryAccessToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "sentry-access-token",
|
||||
Description: "Sentry Access Token",
|
||||
Description: "Found a Sentry Access Token, risking unauthorized access to error tracking services and sensitive application data.",
|
||||
Regex: generateSemiGenericRegex([]string{"sentry"}, hex("64"), true),
|
||||
|
||||
Keywords: []string{
|
||||
|
||||
@@ -9,7 +9,7 @@ func ShippoAPIToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "shippo-api-token",
|
||||
Description: "Shippo API token",
|
||||
Description: "Discovered a Shippo API token, potentially compromising shipping services and customer order data.",
|
||||
Regex: generateUniqueTokenRegex(`shippo_(live|test)_[a-f0-9]{40}`, true),
|
||||
|
||||
Keywords: []string{
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
func ShopifySharedSecret() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Shopify shared secret",
|
||||
Description: "Found a Shopify shared secret, posing a risk to application authentication and e-commerce platform security.",
|
||||
RuleID: "shopify-shared-secret",
|
||||
Regex: regexp.MustCompile(`shpss_[a-fA-F0-9]{32}`),
|
||||
Keywords: []string{"shpss_"},
|
||||
@@ -24,7 +24,7 @@ func ShopifySharedSecret() *config.Rule {
|
||||
func ShopifyAccessToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Shopify access token",
|
||||
Description: "Uncovered a Shopify access token, which could lead to unauthorized e-commerce platform access and data breaches.",
|
||||
RuleID: "shopify-access-token",
|
||||
Regex: regexp.MustCompile(`shpat_[a-fA-F0-9]{32}`),
|
||||
Keywords: []string{"shpat_"},
|
||||
@@ -38,7 +38,7 @@ func ShopifyAccessToken() *config.Rule {
|
||||
func ShopifyCustomAccessToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Shopify custom access token",
|
||||
Description: "Detected a Shopify custom access token, potentially compromising custom app integrations and e-commerce data security.",
|
||||
RuleID: "shopify-custom-access-token",
|
||||
Regex: regexp.MustCompile(`shpca_[a-fA-F0-9]{32}`),
|
||||
Keywords: []string{"shpca_"},
|
||||
@@ -52,7 +52,7 @@ func ShopifyCustomAccessToken() *config.Rule {
|
||||
func ShopifyPrivateAppAccessToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Shopify private app access token",
|
||||
Description: "Identified a Shopify private app access token, risking unauthorized access to private app data and store operations.",
|
||||
RuleID: "shopify-private-app-access-token",
|
||||
Regex: regexp.MustCompile(`shppa_[a-fA-F0-9]{32}`),
|
||||
Keywords: []string{"shppa_"},
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
func SidekiqSecret() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Sidekiq Secret",
|
||||
Description: "Discovered a Sidekiq Secret, which could lead to compromised background job processing and application data breaches.",
|
||||
RuleID: "sidekiq-secret",
|
||||
|
||||
Regex: generateSemiGenericRegex([]string{"BUNDLE_ENTERPRISE__CONTRIBSYS__COM", "BUNDLE_GEMS__CONTRIBSYS__COM"},
|
||||
@@ -34,7 +34,7 @@ func SidekiqSecret() *config.Rule {
|
||||
func SidekiqSensitiveUrl() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Sidekiq Sensitive URL",
|
||||
Description: "Uncovered a Sidekiq Sensitive URL, potentially exposing internal job queues and sensitive operation details.",
|
||||
RuleID: "sidekiq-sensitive-url",
|
||||
SecretGroup: 2,
|
||||
Regex: regexp.MustCompile(`(?i)\b(http(?:s??):\/\/)([a-f0-9]{8}:[a-f0-9]{8})@(?:gems.contribsys.com|enterprise.contribsys.com)(?:[\/|\#|\?|:]|$)`),
|
||||
|
||||
@@ -12,7 +12,7 @@ import (
|
||||
func SlackBotToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Slack Bot token",
|
||||
Description: "Identified a Slack Bot token, which may compromise bot integrations and communication channel security.",
|
||||
RuleID: "slack-bot-token",
|
||||
Regex: regexp.MustCompile(
|
||||
`(xoxb-[0-9]{10,13}\-[0-9]{10,13}[a-zA-Z0-9-]*)`),
|
||||
@@ -43,7 +43,7 @@ func SlackBotToken() *config.Rule {
|
||||
func SlackUserToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Slack User",
|
||||
Description: "Found a Slack User token, posing a risk of unauthorized user impersonation and data access within Slack workspaces.",
|
||||
RuleID: "slack-user-token",
|
||||
// The last segment seems to be consistently 32 characters. I've made it 28-34 just in case.
|
||||
Regex: regexp.MustCompile(`(xox[pe](?:-[0-9]{10,13}){3}-[a-zA-Z0-9-]{28,34})`),
|
||||
@@ -81,7 +81,7 @@ func SlackUserToken() *config.Rule {
|
||||
func SlackAppLevelToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Slack App-level token",
|
||||
Description: "Detected a Slack App-level token, risking unauthorized access to Slack applications and workspace data.",
|
||||
RuleID: "slack-app-token",
|
||||
// This regex is based on a limited number of examples and may not be 100% accurate.
|
||||
Regex: regexp.MustCompile(`(?i)(xapp-\d-[A-Z0-9]+-\d+-[a-z0-9]+)`),
|
||||
@@ -102,7 +102,7 @@ func SlackAppLevelToken() *config.Rule {
|
||||
func SlackConfigurationToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Slack Configuration access token",
|
||||
Description: "Found a Slack Configuration access token, posing a risk to workspace configuration and sensitive data access.",
|
||||
RuleID: "slack-config-access-token",
|
||||
Regex: regexp.MustCompile(`(?i)(xoxe.xox[bp]-\d-[A-Z0-9]{163,166})`),
|
||||
Keywords: []string{"xoxe.xoxb-", "xoxe.xoxp-"},
|
||||
@@ -127,7 +127,7 @@ func SlackConfigurationToken() *config.Rule {
|
||||
func SlackConfigurationRefreshToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Slack Configuration refresh token",
|
||||
Description: "Discovered a Slack Configuration refresh token, potentially allowing prolonged unauthorized access to configuration settings.",
|
||||
RuleID: "slack-config-refresh-token",
|
||||
Regex: regexp.MustCompile(`(?i)(xoxe-\d-[A-Z0-9]{146})`),
|
||||
Keywords: []string{"xoxe-"},
|
||||
@@ -145,7 +145,7 @@ func SlackConfigurationRefreshToken() *config.Rule {
|
||||
// Reference: https://api.slack.com/authentication/token-types#legacy_bot
|
||||
func SlackLegacyBotToken() *config.Rule {
|
||||
r := config.Rule{
|
||||
Description: "Slack Legacy bot token",
|
||||
Description: "Uncovered a Slack Legacy bot token, which could lead to compromised legacy bot operations and data exposure.",
|
||||
RuleID: "slack-legacy-bot-token",
|
||||
// This rule is based off the limited information I could find and may not be 100% accurate.
|
||||
Regex: regexp.MustCompile(
|
||||
@@ -188,7 +188,7 @@ func SlackLegacyBotToken() *config.Rule {
|
||||
// Reference: https://api.slack.com/authentication/token-types#workspace
|
||||
func SlackLegacyWorkspaceToken() *config.Rule {
|
||||
r := config.Rule{
|
||||
Description: "Slack Legacy Workspace token",
|
||||
Description: "Identified a Slack Legacy Workspace token, potentially compromising access to workspace data and legacy features.",
|
||||
RuleID: "slack-legacy-workspace-token",
|
||||
// This is by far the least confident pattern.
|
||||
Regex: regexp.MustCompile(
|
||||
@@ -223,7 +223,7 @@ func SlackLegacyWorkspaceToken() *config.Rule {
|
||||
func SlackLegacyToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Slack Legacy token",
|
||||
Description: "Detected a Slack Legacy token, risking unauthorized access to older Slack integrations and user data.",
|
||||
RuleID: "slack-legacy-token",
|
||||
Regex: regexp.MustCompile(`(xox[os]-\d+-\d+-\d+-[a-fA-F\d]+)`),
|
||||
Keywords: []string{"xoxo", "xoxs"},
|
||||
@@ -254,7 +254,7 @@ func SlackLegacyToken() *config.Rule {
|
||||
func SlackWebHookUrl() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Slack Webhook",
|
||||
Description: "Discovered a Slack Webhook, which could lead to unauthorized message posting and data leakage in Slack channels.",
|
||||
RuleID: "slack-webhook-url",
|
||||
// If this generates too many false-positives we should define an allowlist (e.g., "xxxx", "00000").
|
||||
Regex: regexp.MustCompile(
|
||||
|
||||
@@ -16,7 +16,7 @@ func Snyk() *config.Rule {
|
||||
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Snyk API token",
|
||||
Description: "Uncovered a Snyk API token, potentially compromising software vulnerability scanning and code security.",
|
||||
RuleID: "snyk-api-token",
|
||||
|
||||
Regex: generateSemiGenericRegex(keywords, hex8_4_4_4_12(), true),
|
||||
|
||||
@@ -9,14 +9,16 @@ func SquareAccessToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "square-access-token",
|
||||
Description: "Square Access Token",
|
||||
Regex: generateUniqueTokenRegex(`sq0atp-[0-9A-Za-z\-_]{22}`, true),
|
||||
Keywords: []string{"sq0atp-"},
|
||||
Description: "Detected a Square Access Token, risking unauthorized payment processing and financial transaction exposure.",
|
||||
Regex: generateUniqueTokenRegex(`(EAAA|sq0atp-)[0-9A-Za-z\-_]{22,60}`, true),
|
||||
Keywords: []string{"sq0atp-", "EAAA"},
|
||||
}
|
||||
|
||||
// validate
|
||||
tps := []string{
|
||||
generateSampleSecret("square", secrets.NewSecret(`sq0atp-[0-9A-Za-z\-_]{22}`)),
|
||||
"ARG token=sq0atp-812erere3wewew45678901", // gitleaks:allow
|
||||
"ARG token=EAAAlsBxkkVgvmr7FasTFbM6VUGZ31EJ4jZKTJZySgElBDJ_wyafHuBFquFexY7E", // gitleaks:allow",
|
||||
}
|
||||
return validate(r, tps, nil)
|
||||
}
|
||||
@@ -33,6 +35,7 @@ func SquareSecret() *config.Rule {
|
||||
// validate
|
||||
tps := []string{
|
||||
generateSampleSecret("square", secrets.NewSecret(`sq0csp-[0-9A-Za-z\\-_]{43}`)),
|
||||
`value: "sq0csp-0p9h7g6f4s3s3s3-4a3ardgwa6ADRDJDDKUFYDYDYDY"`, // gitleaks:allow
|
||||
}
|
||||
return validate(r, tps, nil)
|
||||
}
|
||||
@@ -9,7 +9,7 @@ func SquareSpaceAccessToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "squarespace-access-token",
|
||||
Description: "Squarespace Access Token",
|
||||
Description: "Identified a Squarespace Access Token, which may compromise website management and content control on Squarespace.",
|
||||
Regex: generateSemiGenericRegex([]string{"squarespace"}, hex8_4_4_4_12(), true),
|
||||
|
||||
Keywords: []string{
|
||||
|
||||
Loaded 100 of 138 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user