Skip to main content
Version: Next

Field Policies

An extra layer of security for ensuring no unwanted values are passed through a request.

Field Policies allow for blocking or specifically allowing certain fields with set values from being used in the requests body or headers.

Configure them by using access.fieldPolicies like so:

settings:
access:
fieldPolicies:
"@number":
- value: "+123400002"
action: block
- value: "+12340000[1-9]"
matchType: regex
action: allow

Set the wanted action on encounter, available options are block and allow.

note

Supported request keys:

. Variables@ Body# Headers

Match Types

Available options for matchType are:

Value TypeMatch TypeNotes
stringequalspattern ~= stringcase-incensitive
stringcontainspattern.Contains(string)case-incensitive
stringprefixstring.StartsWith(pattern)case-incensitive
stringsuffixstring.EndsWith(pattern)case-incensitive
stringregexexample: [^\S] only non-whitespaceregex
stringglobexample: [abc] only a|b|cglob-style pattern
warning

Remember that some symbols have special meanings in regex, a good rule of thumb is:

  • If it is a special character, it probably needs to be escaped (/)
  • Otherwise test your pattern on a regex testing site

Behavior

AllowBlockResult
number=+123400003number may only be +123400003
number=+123400002number may not be +123400002
message=hellonumber=+123400002number may not be +123400002
message may only be hello
number=+123400003number=+12340000[1-9] (regex)number may not be +123400001 through 9 except 123400003

Rules

  • Field-scoped (policies for a don't affect policies for b)
  • Default: allow all
  • Allow rules exist: default block
  • Only block rules exist: default allow
  • Explicit allow overrides block