Fault Rule for Regular Expression Protection to customize error message

Hi,

I want to customize the error response that gets generated when my Regular Expression Protection Policy detects a pattern, but it seems I have to check the "Error Code" rather than fault.name or {prefix}.{policyname}.failed = true. I have a hard time finding out which flow variable exactly to check for "ThreatDetected".

0 1 185
1 REPLY 1

sidd-harth
Participant V

Did you try this?

    <FaultRules>
        <FaultRule name="threat">
            <Step>
                <Name>threat-error-message</Name>
            </Step>
            <Condition>(fault.name = "ThreatDetected")</Condition>
        </FaultRule>
    </FaultRules>

https://docs.apigee.com/api-platform/fundamentals/fault-handling