PII Masking regex policy does not mask sensitive information as expected
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 71
- Forks
- 111
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 110
Description
Please select the area the issue is related to
Area/Policies (Policies, Policy Hub, Policy Engine etc)
Please select the aspect the issue is related to
Aspect/API (API backends, definitions, contracts, interfaces, OpenAPI)
Description
The PII Masking regex policy doesn't work as expected, information that is supposed to be masked is sent to the upstream.
Steps to Reproduce
- Deploy a self-hosted gateway and a sample backend to log request details in the same network
- Deploy and API proxy pointed to the backend
- Add
PII Masking regexpolicy with the following configuration
(piiEntity: EMAIL, piiRegex: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,}$) - Send a request with an email in the body (e.g. tom@gmail.com)
- notice the logs in the backend, the email will be present in the logs
- Same issue is present when a regex for phone numbers is configured.
(piiEntity: PHONE, piiRegex: ^07[0-9]{8}$)
e.g.: 0776666666
Severity Level of the Issue
Severity/Major (Important functionality is broken. Should be prioritized. Doesn't need immediate attention)
Environment Details (with versions)
Stage
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue through the self-hosted gateway, API proxy, and sample backend, using the PII Masking regex policy with the provided email and phone patterns. Trace the policy's request handling and compare the gateway input with the backend logs; it is done when configured sensitive values are absent from upstream requests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- api, security
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100