Skip to content

Commit c98e5e0

Browse files
authored
feat: add Airtable Personnal Access Token detection (gitleaks#1952)
1 parent 4ed0ca4 commit c98e5e0

File tree

3 files changed

+25
-2
lines changed

3 files changed

+25
-2
lines changed

cmd/generate/config/main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ func main() {
3131
rules.AdobeClientID(),
3232
rules.AdobeClientSecret(),
3333
rules.AgeSecretKey(),
34-
rules.Airtable(),
34+
rules.AirtableApiKey(),
35+
rules.AirtablePersonalAccessToken(),
3536
rules.AlgoliaApiKey(),
3637
rules.AlibabaAccessKey(),
3738
rules.AlibabaSecretKey(),

cmd/generate/config/rules/airtable.go

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
package rules
22

33
import (
4+
"regexp"
5+
46
"github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
57
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
68
"github.com/zricethezav/gitleaks/v8/config"
79
)
810

9-
func Airtable() *config.Rule {
11+
func AirtableApiKey() *config.Rule {
1012
// define rule
1113
r := config.Rule{
1214
Description: "Uncovered a possible Airtable API Key, potentially compromising database access and leading to data leakage or alteration.",
@@ -19,3 +21,17 @@ func Airtable() *config.Rule {
1921
tps := utils.GenerateSampleSecrets("airtable", secrets.NewSecret(utils.AlphaNumeric("17")))
2022
return utils.Validate(r, tps, nil)
2123
}
24+
25+
func AirtablePersonalAccessToken() *config.Rule {
26+
// define rule
27+
r := config.Rule{
28+
Description: "Uncovered a possible Airtable Personal AccessToken, potentially compromising database access and leading to data leakage or alteration.",
29+
RuleID: "airtable-personnal-access-token",
30+
Regex: regexp.MustCompile(`\b(pat[[:alnum:]]{14}\.[a-f0-9]{64})\b`),
31+
Keywords: []string{"airtable"},
32+
}
33+
34+
// validate
35+
tps := utils.GenerateSampleSecrets("airtable", "pat"+secrets.NewSecret(utils.AlphaNumeric("14")+"\\."+utils.Hex("64")))
36+
return utils.Validate(r, tps, nil)
37+
}

config/gitleaks.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,12 @@ description = "Uncovered a possible Airtable API Key, potentially compromising d
114114
regex = '''(?i)[\w.-]{0,50}?(?:airtable)(?:[ \t\w.-]{0,20})[\s'"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'"\s=]{0,5}([a-z0-9]{17})(?:[\x60'"\s;]|\\[nr]|$)'''
115115
keywords = ["airtable"]
116116

117+
[[rules]]
118+
id = "airtable-personnal-access-token"
119+
description = "Uncovered a possible Airtable Personal AccessToken, potentially compromising database access and leading to data leakage or alteration."
120+
regex = '''\b(pat[[:alnum:]]{14}\.[a-f0-9]{64})\b'''
121+
keywords = ["airtable"]
122+
117123
[[rules]]
118124
id = "algolia-api-key"
119125
description = "Identified an Algolia API Key, which could result in unauthorized search operations and data exposure on Algolia-managed platforms."

0 commit comments

Comments
 (0)