Forum Discussion
ee
Oct 02, 2024Cirrus
F5 Data Guard - Expose last 4 digits for Custom Pattern
Hi, as from the screenshot below, we are able to choose to expose the last 4 digits for credit card numbers and U.S. Social Security Numbers. How about if we want to expose the last 4 digits for the ...
yakai
Oct 02, 2024Cirrus
Hello,
I believe that this use case can be done with irules.
You will need to identify a pattern, search for this pattern in your response page, and then replace the the response with only last for digits.
This irule ma
when HTTP_RESPONSE {
set response_data [HTTP::response]
# Regex to match the email pattern
set pattern {([a-zA-Z0-9._%+-]+)@([a-zA-Z0-9.-]+\.[a-zA-Z]{2,})}
# Replace the matched email with asterisks and keep the last four characters of the email
regsub -all $pattern $response_data {****@\$2} masked_response
# Replace the original response with the masked one
HTTP::response replace 0 [HTTP::header Content-Length] $masked_response
}
regards
- eeOct 03, 2024Cirrus
Thanks for the guidance. I have lack of information regarding the irules, does this irules affect one policy or the whole application which enabling the Data Guard feature?
- yakaiOct 03, 2024Cirrus
This should not have a negative impact on your application, however I will advise to test it on a test VS before applying it on production VS
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects