mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-12-01 21:44:23 +01:00
feat: improve regex to detect Sonar tokens with prefixes (#1931)
Since Sonar 9.5, a prefix was added to the tokens. See: https://www.sonarsource.com/products/sonarqube/whats-new/sonarqube-9-5/
This commit is contained in:
1 parent
4fb43823ef
commit
a82bc53d89
2 files changed
+12
-7
No files matched your search
@@ -3006,7 +3006,8 @@ keywords = ["snyk"]
|
||||
[[rules]]
|
||||
id = "sonar-api-token"
|
||||
description = "Uncovered a Sonar API token, potentially compromising software vulnerability scanning and code security."
|
||||
regex = '''(?i)[\w.-]{0,50}?(?:sonar[_.-]?(login|token))(?:[ \t\w.-]{0,20})[\s'"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'"\s=]{0,5}([a-z0-9=_\-]{40})(?:[\x60'"\s;]|\\[nr]|$)'''
|
||||
regex = '''(?i)[\w.-]{0,50}?(?:sonar[_.-]?(login|token))(?:[ \t\w.-]{0,20})[\s'"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'"\s=]{0,5}((?:squ_|sqp_|sqa_)?[a-z0-9=_\-]{40})(?:[\x60'"\s;]|\\[nr]|$)'''
|
||||
secretGroup = 2
|
||||
keywords = ["sonar"]
|
||||
|
||||
[[rules]]
|
||||
|
||||
Reference in new issue
Block a user