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

Support IPv6 #228

Open
dragoangel opened this issue May 27, 2024 · 5 comments
Open

Support IPv6 #228

dragoangel opened this issue May 27, 2024 · 5 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@dragoangel
Copy link

dragoangel commented May 27, 2024

Currently IPv6 isn't supported by this module.

For example IP 2003:e8:7f1d:f600:: is listed on zen.spamhaus.org and to check if it is the case we can resolve next record: 0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.6.f.d.1.f.7.8.e.0.0.3.0.0.2.zen.spamhaus.org IN A which is expanded version of IPv6 requested in backward direction as any other IP RBL. as result we will get 127.0.0.11, but /prober?target=2003:e8:7f1d:f600:: will return luzilla_rbls_errors{rbl="zen.spamhaus.org"} 1, manually expanding IPv6 and querying exporter also doesn't works /prober?target=2003:00e8:7f1d:f600:0000:0000:0000:0000.

To support IPv6 we need:

  1. check user provided value if it is a valid IPv6
  2. if this is valid IPv6 we need expand IPv6 to it's full version
  3. if this is not valid IPv6 we need check if this is valid IPv4, and if this also not the case set an error for this target
  4. if this IPv6: remove all : as we don't need them, split IP to array by 1 char, invert order of array and join it back to string by .
  5. if this IPv4: split IP by . to array, invert over of array and join it back to string by .
  6. append . and rbl domain to the end of record and resolve it, profit.
@till
Copy link
Contributor

till commented May 27, 2024

Can you add an example for a RBL that supports IPv6? Might come in handy to test.

@dragoangel
Copy link
Author

dragoangel commented May 27, 2024

Hi @till - it is, in the first part of issue 😊, with real IP, real blacklist, real response...

image

@till
Copy link
Contributor

till commented May 27, 2024

I thought spamhaus didn't support ipv6?

@dragoangel
Copy link
Author

I thought spamhaus didn't support ipv6?

https://check.spamhaus.org/faqs/?id=how_does_xbl_handle_ipv6_addresses_

@dragoangel
Copy link
Author

More over you just can paste random ipv6 to https://multirbl.valli.org/ and see most of public rbls that supports ipv6

@till till added enhancement New feature or request help wanted Extra attention is needed labels Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants