urlrewritefilter icon indicating copy to clipboard operation
urlrewritefilter copied to clipboard

Feature request: IP subnet match condition operator

Open chrismccracken opened this issue 8 years ago • 1 comments

It was be extremely useful to have a condition operator that can match (or not match) an IP address CIDR subnet mask. I would expect to be able to use this with the "header" or "remote-addr" condition types as follows:

  • Condition to only apply the rule when the value of the x-forwarded-for header is in the 10.1.2.0/24 subnet:

    <condition type="header" name="x-forwarded-for" operator="ipmatch">10.1.2.0/24</condition>

or

  • Condition to only apply the rule when the remote addr request attribute is NOT localhost:

    <condition type="remote-addr" operator="notipmatch">127.0.0.1/32</condition>

There may be other condition types that the operator also applies to, but these are the most obvious and useful.

chrismccracken avatar Oct 07 '16 22:10 chrismccracken

You can put up a pull request for the feature. You could potentially use the information in the documentation to extend the API to implement custom rules.

ajaysolleti avatar Feb 15 '17 10:02 ajaysolleti