-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Description
Describe the bug
I am trying to add regex to capture secrets from jmeter files. the regex is working in online golang tool. but when i try i with gitleaks it is not working
To Reproduce
-
use below custom rule
[[rules]]
description = "JMX API Key"
id = "jmx-api-key"
regex = '''^\s*<elementProp name="(?:client_secret)"[^>]+>\n(.* name="Argument.name".\n). name="Argument.value">([a-zA-Z0-9]{8,})<[/][^>]+>\n'''
[rules.allowlist]
paths = [
'''(?i)\b\wlnp\w.jmx''',
] -
Test data used:
<elementProp name="client_secret" elementType="Argument"> <stringProp name="Argument.name">client_id</stringProp> <stringProp name="Argument.va1ddlue">${client_id}</stringProp> <stringProp name="Argument.metadata">=</stringProp> </elementProp> <elementProp name="client_secret" elementType="Argument"> <stringProp name="Argument.name">client_secret</stringProp> <stringProp name="Argument.value">UiI6S2TNzIelSDXA</stringProp> <stringProp name="Argument.metadata">=</stringProp> </elementProp> <elementProp name="scope_op6" elementType="Argument"> <stringProp name="Argument.name">scope_op6</stringProp> <stringProp name="Argument.value">PARTNER_PAYMENT_HAS_PAYMENT_METHOD_OIC</stringProp> <stringProp name="Argument.desc">USER_PAYMENT_METHODS_MANAGE</stringProp> <stringProp name="Argument.metadata">=</stringProp> </elementProp>
Expected behavior
This should match hardcoded client_secret in jmx file
Screenshots
working screenshot from online tool.
https://www.akto.io/tools/go-regex-tester

Basic Info (please complete the following information):
- OS: windows
- Gitleaks Version: 8.18.4
Additional context
N/A