# Data Mask Configuration

The `data-mask` plugin removes or replaces sensitive information in request headers, bodies, and URL queries for logging purposes, enhancing data privacy and security.<!-- --> <!-- -->Configuration covers plugin parameters.

## Parameters[​](#parameters "Direct link to Parameters")

See plugin [common configurations](https://docs.api7.ai/apisix/reference/plugin-common-configurations.md) for configuration options available to all plugins.

* request

  array\[object]

  ***

  An array of actions to mask sensitive information in the request.

  * type

    string

    required

    valid value:

    `query`, `header`, or `body`

    ***

    Location where sensitive information should be masked.

  * body\_format

    string

    valid value:

    `json` or `urlencoded`

    ***

    Encoding of the request body. Required when `type` is `body`.

  * name

    string

    required

    ***

    Name of the information field that contains sensitive data. For JSON body, you can use [JSONPath](https://goessner.net/articles/JsonPath) syntax.

  * action

    string

    required

    valid value:

    `regex`, `replace`, or `remove`

    ***

    Action to mask the sensitive data.

  * regex

    string

    ***

    Regular expressions to match the sensitive data. Required when `action` is `regex`.

  * value

    string

    ***

    Value to replace the sensitive data with. Required when `action` is `regex` or `replace`.

* max\_body\_size

  integer

  default: `1048576`

  ***

  Maximum in-memory JSON request body size in bytes that the plugin will mask. If a JSON body exceeds this value, JSON body rules are skipped; query, header, and URL-encoded body rules are unaffected by this setting.

* max\_req\_post\_args

  integer

  default: `100`

  valid value:

  greater than or equal to 0

  ***

  Maximum number of URL-encoded form fields to parse when masking request body data with `body_format` set to `urlencoded`.
