Data masking
This policy hides sensitive fields by replacing their values with masked data.
This policy is used to mask sensitive data at the application level. At the application level you must have an Identify and Authorize policy configured to identify the application for which the masking is applied. If no application is specified then it is applied for all the other responses. Fields can be masked or filtered in the response messages to be sent. You can configure the masking criteria as required for the XPath, JSON Path, and Regex expressions based on the content-types.
In IBM API Studio, this policy is identified by
the kind DataMasking.
For the DataMasking policy kind, configure these specifications:
| Code view | Form view | Description |
|---|---|---|
| matchApplications | Consumer applications |
Specifies the applications for which the masking criteria must be applied. |
applyForTransactionLogging |
Apply for transaction logging | Specifies whether the data masking criteria is applied to transaction logging. |
applyForPayload |
Apply for payload | Specifies whether the data masking criterion is applied to the response payload. |
transformations |
Masking criteria |
You can configure the following under
|
Example of a Data masking policy in code view.
kind: DataMasking
apiVersion: api.ibm.com/v2
metadata:
name: res_datamasking
version: 1.0
namespace: wm_project
spec:
matchApplications:
- 2d4e28ae-6209-44ec-ba4e-64c5fcc9b63d
- 495d12eb-1712-46a0-9b23-142a3374e3a9
transformations:
set:
- jpath: jpathexpression1
maskValue: jpathmask1
- xpath: xpathexpression1
namespaces:
- prefix: ps1
URI: http://test.com
- prefix: ps2
URI: http://test2.com
maskValue: xpathmask1
- regex: regexexpression1
maskValue: regexmask1
- jpath: jpath
maskValue: value1
- xpath: xpath
maskValue: value2
- regex: regex
maskValue: value3
remove:
- xpath: ${request-x}
- jpath: ${request-j}
- regex: ${request-r}
- xpath: ${request-1}
- jpath: ${request-2}
- regex: ${request-3}
applyForTransactionLogging: true
applyForPayload: true