Project

General

Profile

Actions

Feature #3032

closed

Add a privacy option to allow IP Anonymization when creating logfiles.

Added by dinoex over 3 years ago. Updated 4 months ago.

Status:
Wontfix
Priority:
Low
Category:
core
Target version:
-
ASK QUESTIONS IN Forums:
No

Description

With IPv4:
IP Anonymization clears the last 8 Bit of an IP Address

With IPv6:
IP Anonymization clears the last 64 Bit of an IP Address

Activated by adding to the config file:
server.privacy = "enable"

tested on FreeBSD amd64
I release this patch as Public Domain.

Feel free to rename / optimize this feature.


Files

lighttpd-private.diff (3.57 KB) lighttpd-private.diff dinoex, 2020-11-10 21:18
Actions #1

Updated by gstrauss over 3 years ago

  • Status changed from New to Need Feedback
  • Priority changed from Normal to Low
  • Target version deleted (1.4.56)

Why?

See mod_accesslog docs. You can already
1. define a log format which omits the IP or uses some other identifier (e.g. a cookie value)
or
2. send all logs through a piped logger and in the piped logger you can rewrite the field, truncate the field, encrypt the field, or do whatever you want.

Why would you name it something non-descript and generic like server.privacy when it is very, very specific to IP addresses?
Why should the very limited and very specific feature of your patch be a config option in lighttpd?
What problem are you trying to solve? And how well does your patch solve said problem?
Why did you not include answers to the above with your patch?

Since you can send both access logs and error logs through a piped logger, and the piped logger can scrub IP and other information as appropriate, the patch you have proposed is unnecessary.

Actions #2

Updated by dinoex over 3 years ago

I am aware of Option 1, but I do not want to omit the IP in full.

I did not yet found a piped logger that rewrites the IPs,
cronolog does not mention how to truncate fields.
Pointers welcome.

As a not native english speaker, my names might not be optimal.
I did not came up with a better name yet.

The goal is to have a easy way to comply with the law in Europe.
Logging of full IP addresses is in may cases a violation to the DGPR
https://en.wikipedia.org/wiki/General_Data_Protection_Regulation

With IP Anonymization it is believed to comply with the DGPR.

https://support.google.com/analytics/answer/2763052?hl=en
https://tools.ietf.org/html/draft-andersdotter-intarea-update-to-rfc6302-00

Examples:
https://github.com/FibreFoX/apache2-anonymizer-module

Actions #3

Updated by gstrauss over 3 years ago

  • Status changed from Need Feedback to Wontfix

FYI: You got the response you got because you failed to include basic information about requirements (GDPR) with your patch dump and you failed to include links to specifications that your patch implemented to comply with such specifications. (Hint: do not dump patches without communicating the problem you are trying to solve and how the patch solves the problem)

2 1/2 year ago, someone asked the same question. You spent time writing a patch before using that little search box in the upper-right of this page to search for "GDPR"
https://redmine.lighttpd.net/boards/2/topics/8097

I did not yet found a piped logger that rewrites the IPs,
cronolog does not mention how to truncate fields.
Pointers welcome.

If you need to anonymize IPs, you parse each line to identify and anonymize IPs. How should IP addresses be anonymized? What about port numbers? What about ... ? If you need to comply with GDPR, then you need to comply with GDPR.

Your partial patch does something very specific, and there is no specification to which you linked for which your patch meets the requirements. Of note, https://tools.ietf.org/html/draft-andersdotter-intarea-update-to-rfc6302-00 (which is a draft) suggests:

SHOULD keep only the first two octets (of an IPv4 address) or the
first three octets (of an IPv6 address) with remaining octets set
to zero, when logging.

Your patch does something different. The draft makes other suggestions as well, also not implemented by your patch.

If you need to comply with GDPR, then there is more than IP anonymization that must be handled.

Options to comply with GDPR specifically regarding web server logging:
  • disable logging
    • send lighttpd stderr to /dev/null
    • disable access log
  • modify logging (insufficient)
    • modify access log to not include IP (insufficient if query string contains IP)
    • error log must still be handled separately, or directed to /dev/null
  • piped loggers
    • use piped loggers with your own custom logic to comply as best you can with GDPR.

lighttpd can make no guarantees of compliance with GDPR since GDPR may include many different operational requirements for log handling and log rotation, some of which are likely outside the scope of lighttpd.

I did not yet found a piped logger that rewrites the IPs,

Please try again with search terms: "piped logger anonymize IP"

Actions #4

Updated by gstrauss 4 months ago

lighttpd 1.4.70 includes a mechanism to mask IPs in mod_accesslog with %{mask}a in the accesslog format
Note: the error log must still be post-processed for GDPR compliance.

[mod_accesslog] %{mask}a to mask/anonymize IP
commit 0ccf30c01eac6560591c536d8eaa31589a935def

Enable partial masking of IP addresses in access logs
https://github.com/lighttpd/lighttpd1.4/pull/124

IP masking in Universal Analytics
https://support.google.com/analytics/answer/2763052

Actions

Also available in: Atom