Skip to content

Commit 48ea14b

Browse files
authoredOct 31, 2024··
feat: update global & generic allowlist (#1618)
1 parent 81f0002 commit 48ea14b

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed
 

‎cmd/generate/config/base/config.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ func CreateGlobalConfig() config.Config {
8282
regexp.MustCompile(`(^|/)npm-shrinkwrap\.json$`),
8383
regexp.MustCompile(`(^|/)bower_components/.*?$`),
8484
// TODO: Add more common static assets, such as swagger-ui.
85-
regexp.MustCompile(`(^|/)(angular|jquery(-?ui)?|plotly|swagger-?ui)[a-zA-Z0-9.-]+(\.min)?\.js(\.map)?$`),
85+
regexp.MustCompile(`(^|/)(angular|jquery(-?ui)?|plotly|swagger-?ui)[a-zA-Z0-9.-]*(\.min)?\.js(\.map)?$`),
8686

8787
// ----------- Python files -----------
8888
// Dependencies and lock files.

‎cmd/generate/config/base/config_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ func TestConfigAllowlistPaths(t *testing.T) {
9898
`swagger/swaggerui/swagger-ui-bundle.js.map`,
9999
`swagger/swaggerui/swagger-ui-es-bundle.js.map`,
100100
`src/main/static/swagger-ui.min.js`,
101+
`swagger/swaggerui/swagger-ui.js`,
101102
},
102103
},
103104
"python": {

‎cmd/generate/config/rules/generic.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ func GenericCredential() *config.Rule {
5959
`|(credentials?[_.-]?id|withCredentials)` + // Jenkins plugins
6060
// Key
6161
`|(bucket|foreign|hot|natural|primary|schema|sequence)[_.-]?key` +
62-
`|key[_.-]?(alias|board|code|ring|stone|storetype|word|up|down|left|right)` +
62+
`|key[_.-]?(alias|board|code|ring|selector|size|stone|storetype|word|up|down|left|right)` +
6363
`|key(store|tab)[_.-]?(file|path)` +
6464
`|issuerkeyhash` + // part of ssl cert
6565
`|(?-i:[DdMm]onkey|[DM]ONKEY)|keying` + // common words containing "key"
@@ -162,6 +162,8 @@ func GenericCredential() *config.Rule {
162162
`sequenceKey = "18"`,
163163
`app.keystore.file=env/cert.p12`,
164164
`-DKEYTAB_FILE=/tmp/app.keytab`,
165+
` doc.Security.KeySize = PdfEncryptionKeySize.Key128Bit;`,
166+
`o.keySelector=n,o.haKey=!1,`,
165167
// TODO: Requires line-level allowlists.
166168
//`<add key="SchemaTable" value="G:\SchemaTable.xml" />`,
167169
// `secret:

‎config/gitleaks.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ keywords = [
550550
[rules.allowlist]
551551
regexTarget = "match"
552552
regexes = [
553-
'''(?i)(accessor|access[_.-]?id|api[_.-]?(version|id)|rapid|capital|[a-z0-9-]*?api[a-z0-9-]*?:jar:|author|X-MS-Exchange-Organization-Auth|Authentication-Results|(credentials?[_.-]?id|withCredentials)|(bucket|foreign|hot|natural|primary|schema|sequence)[_.-]?key|key[_.-]?(alias|board|code|ring|stone|storetype|word|up|down|left|right)|key(store|tab)[_.-]?(file|path)|issuerkeyhash|(?-i:[DdMm]onkey|[DM]ONKEY)|keying|(secret)[_.-]?name|UserSecretsId|(api|credentials|token)[_.-]?(endpoint|ur[il])|public[_.-]?(key|token)|(key|token)[_.-]?file)''',
553+
'''(?i)(accessor|access[_.-]?id|api[_.-]?(version|id)|rapid|capital|[a-z0-9-]*?api[a-z0-9-]*?:jar:|author|X-MS-Exchange-Organization-Auth|Authentication-Results|(credentials?[_.-]?id|withCredentials)|(bucket|foreign|hot|natural|primary|schema|sequence)[_.-]?key|key[_.-]?(alias|board|code|ring|selector|size|stone|storetype|word|up|down|left|right)|key(store|tab)[_.-]?(file|path)|issuerkeyhash|(?-i:[DdMm]onkey|[DM]ONKEY)|keying|(secret)[_.-]?name|UserSecretsId|(api|credentials|token)[_.-]?(endpoint|ur[il])|public[_.-]?(key|token)|(key|token)[_.-]?file)''',
554554
]
555555
stopwords = [
556556
"000000",

0 commit comments

Comments
 (0)
Please sign in to comment.