Data masking
Data masking hides sensitive information to keep it safe. It replaces real data with similar substitute values so the original data remains protected when it’s not required.
This policy is used to mask sensitive data at the application level. At the application level, you must configure an Identify and Authorize policy to identify the application for which the masking is applied. If no application is specified, then the policy is applied for all the other requests. Fields can be masked or filtered in the request messages received. You can configure the masking criteria for the XPath, JSON Path, and Regex expressions based on the content type.
In IBM API Studio, the kind
DataMasking identifies the policy.
Example of a Data masking policy in code view.
kind: DataMasking
apiVersion: api.ibm.com/v2
metadata:
name: datamasking
version: 1.0
namespace: wm_project
spec:
enabled: false
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
For the DataMasking policy kind, configure these specifications:
| Code view | Form view | Description |
|---|---|---|
| matchApplications | Consumer applications |
Specifies the applications for which the masking criterion must be applied. |
applyForTransactionLogging |
Apply for transaction logging |
Specifies whether the data masking criterion is applied to transaction logging. |
applyForPayload |
Apply for payload |
Specifies whether the data masking criterion is applied to the request payload. |
transformations |
Masking criteria |
You can configure the following under
|