Skip to content

Commit 3a92697

Browse files
hendrik-buchwald-sonarsourcesonartech
authored andcommitted
APPSEC-2295 Refine post filter for variables (#468)
1 parent b3e0ece commit 3a92697

File tree

4 files changed

+23
-10
lines changed

4 files changed

+23
-10
lines changed

sonar-text-plugin/src/main/resources/org/sonar/plugins/secrets/configuration/mongodb.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ provider:
2727
patternNot:
2828
- "^([\\w\\.\\*])\\1{2,}$"
2929
- "(?i)^(db|my)?_?pass(word|wd)?$"
30-
- "^\\${1,2}[A-Z_]+$"
30+
- "^\\${1,2}\\w+$"
3131
- "^\\${1,2}[{(]"
3232
- "^\\{{2,}"
3333
- "^<[a-z \\-]+>$"

sonar-text-plugin/src/main/resources/org/sonar/plugins/secrets/configuration/mysql.yaml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ provider:
4444
- "^.$"
4545
- "^(?i)pass(word|wd)?$"
4646
- "^%[sv]$"
47-
- "^\\${1,2}[A-Z_]+$"
47+
- "^\\*{3,}$"
48+
- "^\\${1,2}\\w+$"
4849
- "^\\{.*\\}$"
4950
- "^'\\{.*\\}'$"
5051
- "^\\${1,2}[{(]"
@@ -99,6 +100,9 @@ provider:
99100
port=instance_info.port,
100101
database=db_name),
101102
containsSecret: false
103+
- text: |
104+
DBG1(DBG_LIB, "connecting to mysql://%s:***@%s:%d/%s failed: %s",
105+
containsSecret: false
102106
103107
- id: mysql-env-mysql_password-unquoted
104108
rspecKey: S6697
@@ -284,7 +288,7 @@ provider:
284288
- "^(db|my)?_?pass(word|wd)?$"
285289
- "^(assword|ort)$"
286290
- "^\\*{3,}$"
287-
- "^\\${1,2}[A-Z_]+$"
291+
- "^\\${1,2}\\w+$"
288292
- "^\\${1,2}[{(]"
289293
- "^\\{{2,}"
290294
examples:
@@ -326,6 +330,15 @@ provider:
326330
- text: |
327331
mysqladmin ping --user=mysqluser --password=$${MYSQL_USER_PASSWORD}
328332
containsSecret: false
333+
- text: |
334+
command: mysql -h $db_host -P $db_port -u $db_user --password=$db_password $db_database < /opt/operator-settlement/init.sql
335+
containsSecret: false
336+
- text: |
337+
mysql -h$archery_host -P$archery_port -u$archery_user -p$archery_pw $archery_db -N -e "select
338+
containsSecret: false
339+
- text: |
340+
test: mysqladmin ping -h localhost -u $$MYSQL_USER --password=$$MYSQL_PASSWORD
341+
containsSecret: false
329342
330343
- id: mysql-cli-quoted-outer
331344
rspecKey: S6697
@@ -354,7 +367,7 @@ provider:
354367
patternNot:
355368
- "(db|my)?_?pass(word|wd)?"
356369
- "^\\*{3,}$"
357-
- "^\\${1,2}[A-Z_]+$"
370+
- "^\\${1,2}\\w+$"
358371
- "^\\${1,2}[{(]"
359372
- "^\\{{2,}"
360373
examples:
@@ -414,7 +427,7 @@ provider:
414427
patternNot:
415428
- "(?:db|my)?_?pass(?:word|wd)?"
416429
- "^\\*{3,}$"
417-
- "^\\${1,2}[\\w]+$"
430+
- "^\\${1,2}\\w+$"
418431
- "^\\${1,2}[{(]"
419432
- "^\\{{2,}"
420433
examples:

sonar-text-plugin/src/main/resources/org/sonar/plugins/secrets/configuration/odbc.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ provider:
3939
- "^(?i)pass(word|wd)?$"
4040
- "^[Xx]{3,}$"
4141
- "^%[sv]$"
42-
- "^\\${1,2}[A-Z_]+$"
42+
- "^\\${1,2}\\w+$"
4343
- "^\\${1,2}[{(]"
4444
examples:
4545
- text: |
@@ -119,7 +119,7 @@ provider:
119119
- "^(?i)pass(word|wd)?$"
120120
- "^[Xx]{3,}$"
121121
- "^%[sv]$"
122-
- "^\\${1,2}[A-Z_]+$"
122+
- "^\\${1,2}\\w+$"
123123
- "^\\${1,2}[{(]"
124124
examples:
125125
- text: |
@@ -198,7 +198,7 @@ provider:
198198
- "^\\[[\\w\\t \\-]+\\]$"
199199
- "^<[\\w\\t -]{1,10}>?"
200200
- "^\\${1,2}[{(]"
201-
- "^\\${1,2}[A-Z_]+$"
201+
- "^\\${1,2}\\w+$"
202202
- "\\$\\{\\w+(:-\\w+)?\\}"
203203
- "^\\{+[^}]*\\}+$"
204204
- "^`[a-z]+"
@@ -310,7 +310,7 @@ provider:
310310
- "^\\[[\\w\\t \\-]+\\]$"
311311
- "^<[\\w\\t -]{1,10}>?"
312312
- "^\\${1,2}[{(]"
313-
- "^\\${1,2}[A-Z_]+$"
313+
- "^\\${1,2}\\w+$"
314314
- "\\$\\{\\w+(:-\\w+)?\\}"
315315
- "^\\{+[^}]*\\}+$"
316316
- "^`[a-z]+"

sonar-text-plugin/src/main/resources/org/sonar/plugins/secrets/configuration/postgresql.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ provider:
2323
- "^<[\\w\\t -]{1,10}>?"
2424
- "^%[sv]$"
2525
- "^\\${1,2}[{(]"
26-
- "^\\${1,2}[A-Z_]+$"
26+
- "^\\${1,2}\\w+$"
2727
- "\\$\\{\\w+(:-\\w+)?\\}"
2828
- "^\\{+[^}]*\\}+$"
2929
- "^\\*{3,}$"

0 commit comments

Comments
 (0)