Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

RegularExpressionProtection Policy Payload Example

Hi,

Can someone please give me the exact payload examples which will satisfied the pattern define in the RegularExpressionProtection policy here

https://docs.apigee.com/api-platform/reference/policies/regular-expression-protection#samples


Please pass only valid working example payload, no assumption please

Required header

Content-Type:application/json

<RegularExpressionProtection name="JsonPathRegExProtection">
  <DisplayName>Regular Expression Protection 1</DisplayName>
  <Source>request</Source>
  <JSONPayload escapeSlashCharacter="true">
    <JSONPath>
      <Expression>$.</Expression>
      <Pattern><\s*script\b[^>]*>[^<]+<\s*\/\s*script\s*></Pattern>
      <Pattern>n\s*\\\\\s*slash</Pattern>
      <Pattern>n\s*\/\s*slash</Pattern>
      <Pattern>n\s*\\"\s*quotes</Pattern>
      <Pattern>n\s*\\b\s*space</Pattern>
      <Pattern>n\s*\\f\s*forwardfeed</Pattern>
      <Pattern>n\s*\\n\s*newline</Pattern>
      <Pattern>n\s*\\r\s*carria</Pattern>
      <Pattern>n\s*\\t\s*tab</Pattern>
      <Pattern>n\s*\\uFFFF\s*hex</Pattern>
    </JSONPath>
  </JSONPayload>
</RegularExpressionProtection>

0 2 274
2 REPLIES 2