Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change of masking mechanism #6

Open
zbalkan opened this issue Sep 6, 2023 · 0 comments
Open

Change of masking mechanism #6

zbalkan opened this issue Sep 6, 2023 · 0 comments

Comments

@zbalkan
Copy link

zbalkan commented Sep 6, 2023

Generally PAN is masked excluding the first 6 and last 4 numbers, allowing further investigations. The line below fully replaces the number with as substitute.

It would be better to allow the masking to be configurable like this:

  <pan>
    # mastercard
    formats /(5[1-5][0-9]{2}(?:\ |\-|)[0-9]{2})[0-9]{2}(?:\ |\-|)[0-9]{4}(?:\ |\-|)([0-9]{4})/
    checksum_algorithm luhn
    mask \\1******\\2
  </pan>

This can be possible by changing the replacement code:

 match = match.gsub(@regexp, @mask)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant