Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: IP subnet match condition operator #209

Open
chrismccracken opened this issue Oct 7, 2016 · 1 comment
Open

Feature request: IP subnet match condition operator #209

chrismccracken opened this issue Oct 7, 2016 · 1 comment

Comments

@chrismccracken
Copy link

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.

@ajaysolleti
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants