mod_log_ipmask icon indicating copy to clipboard operation
mod_log_ipmask copied to clipboard

does not work with IPv6?

Open mmitch opened this issue 9 years ago • 7 comments

I don't see many IPv6 requests in my logs, but those don't seem to be anonymized. Is there a way to anonymize IPv6 addresses as well?

mmitch avatar Jan 16 '16 14:01 mmitch

It seems IPv6 handling is currently missing in the code.

I doubt that we will be able to support that anytime soon, mostly because my C is a bit rusty and I am not very familiar with the Apache API.

Of course I'd be happy to review a patch. Or maybe Saoxnia's data protection officer or the original author, Florian van Koten at systematics NETWORK SERVICES GmbH, might help with funding and/or coding?

mpdude avatar Jan 16 '16 20:01 mpdude

ping @fvankoten

mpdude avatar Jan 16 '16 20:01 mpdude

I was looking around for solutions and found http://bug.st/mod_anonstats That's a module that anonymizes logs by either hashing the IP addresses with MD5 or by setting all IPs to 127.0.0.1. But that module looks like it runs with IPv4 only, too. I'm not even sure it works with Apache 2.4.

Digging through the Apache docs, I found "piped logs": https://httpd.apache.org/docs/2.4/logs.html#piped I'm currently experimenting with a simple perl script that runs as a pipe and hashes the IP addreses - it reads the first field of a log line regardless of type (IPv4, IPv6, hostname or just any other string) and generates an artificial IPv4 address. As I don't have a real busy server, this should work for me.

(nb: Setting all IPs to "127.0.0.1" can be done without any module: Just add a LogFormat that uses no %a or %h but the string 127.0.0.1 as first argument :-))

mmitch avatar Jan 17 '16 13:01 mmitch

my piped log solution seems to work, I just set up a repo at https://github.com/mmitch/httpd-log-anon-filter

mmitch avatar Jan 18 '16 22:01 mmitch

The IPv6 patch by Peter Conrad working for mod_log_ipmask under apache2.2 is here still working: apache2.4-ipv6.patch.txt

rseffner avatar Jan 09 '17 19:01 rseffner

@rseffner Does this work with IPv4 and IPv6 in parallel?

If so, would you mind creating a Pull Request for it?

mpdude avatar Jun 21 '18 16:06 mpdude

@mpdude my first github steps #6

rseffner avatar Jun 21 '18 18:06 rseffner