Implement Regex expression on multiple headers

I have a requirement to implement bot detection in apigee proxy using user-agent headers . I am using set of rules for bot detection in below URL 

https://github.com/Kong/kong/blob/master/kong/plugins/bot-detection/rules.lua

I am planning to use these regex expression in shared flow for other headers and other parameter as well and I want each proxy owner to choose from list (list of headers , body , query params) in which regex can be enforced . Is there any way this can be achieved ?

@dchiesa1 

 

Solved Solved
0 1 303
1 ACCEPTED SOLUTION

You could implement a series of RegularExpressionProtection policies ( https://docs.apigee.com/api-platform/reference/policies/regular-expression-protection?hl=en ), one for each header/body/query param option that the proxy may potentially want to enforce. Then you could enable/disable them with flow variables (set in the calling proxy) and matching Conditions on the policies ( https://docs.apigee.com/api-platform/fundamentals/flow-variables-and-conditions?hl=en#sampleconditio... )

View solution in original post

1 REPLY 1

You could implement a series of RegularExpressionProtection policies ( https://docs.apigee.com/api-platform/reference/policies/regular-expression-protection?hl=en ), one for each header/body/query param option that the proxy may potentially want to enforce. Then you could enable/disable them with flow variables (set in the calling proxy) and matching Conditions on the policies ( https://docs.apigee.com/api-platform/fundamentals/flow-variables-and-conditions?hl=en#sampleconditio... )