talisman icon indicating copy to clipboard operation
talisman copied to clipboard

Problem with Regex (allowed_patterns)

Open johnoliv opened this issue 3 years ago • 3 comments

I need to ignore a known hex-encoded text inside some files using an allowed_patterns regex, but I don't want to skip the whole content.

Example of error: Expected file to not to contain hex-encoded texts such as: "d-b776a0bdace0449c81ca4284683XXXXX",

Expected file to not to contain hex-encoded texts such as: "d-baeb9610e69043be9d315d7e351XXXXX",

image

The text pattern is: Initial d- with 32 characters.

I tried to use the following regex without success: .talismanrc allowed_patterns:

  • ([\w]d-[\w])
  • (\bd-[\w]{32})
  • ([\w]d-[\w])
  • (d-[\w]{32})
  • ([d]-[\w]*)
  • (["]d-[\w]{32}["]*)

More info: OS: macOS 12.5.1 Talisman v1.28.1

johnoliv avatar Sep 19 '22 14:09 johnoliv

Thanks for raising this issue, we'll look into it

jmatias avatar Sep 19 '22 17:09 jmatias

@johnoliv : I tried d-[0-9a-fA-F]{32} on regex101.com with language set to golang. This should help your case.

svishwanath-tw avatar Sep 20 '22 03:09 svishwanath-tw

Hey @svishwanath-tw. Thanks for trying. Although it's a valid regex, it didn't resolve, the talisman report still shows as a high severity error.

image

allowed_patterns:

  • d-[0-9a-fA-F]{32}

johnoliv avatar Sep 20 '22 11:09 johnoliv

Hmm, thats odd. I tried with the regex as well, and even though the regex is valid, talisman still seems to be flagging it as an error. I can take a look at it and see what's happening.

tinamthomas avatar Oct 10 '22 01:10 tinamthomas

Hmm, thats odd. I tried with the regex as well, and even though the regex is valid, talisman still seems to be flagging it as an error. I can take a look at it and see what's happening.

Thank you @tinamthomas. Appreciate your help.

johnoliv avatar Oct 10 '22 13:10 johnoliv