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

Selector: add a function nslookup. #12

Closed
dalf opened this issue Jul 9, 2020 · 0 comments · Fixed by #13
Closed

Selector: add a function nslookup. #12

dalf opened this issue Jul 9, 2020 · 0 comments · Fixed by #13

Comments

@dalf
Copy link
Contributor

dalf commented Jul 9, 2020

The current selectors about the source IP and Host are

  • IP
  • Host

Behind a reverse proxy they are useless.

The HTTP header X-Forwarded-For allows to filter the real user IP:
"filters": ["Header:X-Forwarded-For=<ip>

In the searx-docker project, there is this rule:

    {
        "name": "searx.space",
        "filters": ["Header:X-Forwarded-For=(2001:41d0:8:de3::1|176.31.252.227)"],
        "stop": true,
        "actions": [{ "name": "log"}]
    },

It would useful to have something like this:

    {
        "name": "searx.space",
        "filters": ["Header:X-Forwarded-For=nslookup(check.searx.space)"],
        "stop": true,
        "actions": [{ "name": "log"}]
    },

So even if at one point in time, check.searx.space resolves to different IPs, the rule would still work as expected.
The nslookup function can resolve the IPs addresses when filtron starts. The result of that function would be a regex similar to the first snippet.

Extend version: filtron resolves every day the IPs addresses without restart.

dalf added a commit to searx/searx-docker that referenced this issue Jul 10, 2020
start.sh create rules.json from rules.json.template. It replaces $CHECK_SEARX_SPACE_IPS by the IPs of check.searx.space.

Related to asciimoo/filtron#12
dalf added a commit to dalf/filtron that referenced this issue Jul 18, 2020
dalf added a commit to dalf/filtron that referenced this issue Jul 18, 2020
dalf added a commit to dalf/filtron that referenced this issue Jul 18, 2020
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

Successfully merging a pull request may close this issue.

1 participant