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

does not work with IPv6? #1

Open
mmitch opened this issue Jan 16, 2016 · 7 comments
Open

does not work with IPv6? #1

mmitch opened this issue Jan 16, 2016 · 7 comments

Comments

@mmitch
Copy link

mmitch commented Jan 16, 2016

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?

@mpdude
Copy link
Member

mpdude commented Jan 16, 2016

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
Copy link
Member

mpdude commented Jan 16, 2016

ping @fvankoten

@mmitch
Copy link
Author

mmitch commented Jan 17, 2016

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
Copy link
Author

mmitch commented Jan 18, 2016

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

@rseffner
Copy link

rseffner commented Jan 9, 2017

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

@mpdude
Copy link
Member

mpdude commented Jun 21, 2018

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

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

@rseffner
Copy link

@mpdude my first github steps
#6

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

3 participants