Skip to content

Test our custom gitleaks configuration

Craig Smith requested to merge craigmsmith-test-custom-gitleaks-regexp into master

What does this MR do?

In !221 (comment 1415815305), @jamesliu-gitlab mentioned that some of our custom regular expressions defined in gitleaks.toml ensure that the tokens are not matched when they're part of a longer string, but are matched when they are part of an assign statement. For example, for the fake token:

sk-000000000000000000000000000000000000000000000000

should not be matched when it's enclosed in a long string

RANDOMTEXTsk-000000000000000000000000000000000000000000000000RANDOMTEXT

but should match when included in an assignment

password="sk-000000000000000000000000000000000000000000000000"

Seeing this, I wondered if this should be the case for all of our custom regular expressions, and if so, can we enforce this with code.

What are the relevant issue numbers?

N/A

Does this MR meet the acceptance criteria?

Edited by Craig Smith

Merge request reports