匿名 IPv6 地址
根据多个国家/地区的法律要求,我们在日志文件中对用户的 IP 地址进行匿名化处理。使用 IPv4,我们通常只是匿名最后两个字节,例如。我们记录的是 255.255.\*.\*
,而不是 255.255.255.255
您建议使用什么算法来匿名化 IPv6 地址?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
至少你想剥离 EUI-64 off,即地址的最后 64 位。更现实的是,您希望剥离更多内容以真正实现私有,因为剩余部分仍将仅标识一个子网(即可能是一栋房子)
IPv6 全局寻址是非常分层的,来自 RFC2374:
问题是如何私密才足够私密?剥离 64 位后,您就识别出了 LAN 子网,而不是用户。再除去 16 个,您就确定了一个小型组织,即 ISP 的客户,例如具有多个子网的公司/分支机构。去掉接下来的 24 个,您基本上就只能识别出 ISP 或真正的大型组织。
您可以使用与 IPv4 地址完全相同的位掩码来实现这一点,但问题变成了一个法律问题,即“我需要剥离多少内容才能符合特定立法”,而不是技术问题。
At the very least you want to strip the EUI-64 off, i.e the last 64 bits of the address. more realistically you want to strip quite a lot more to really be private, since the remaining part will still identify only one subnet (i.e. one house possibly)
IPv6 global addressing is very hierarchical, from RFC2374:
The question becomes how private is private enough? Strip 64 bits and you've identified a LAN subnet, not a user. Strip another 16 on top of that and you've identified a small organisation, i.e. a customer of an ISP, e.g. company/branch office with several subnets. Strip the next 24 off an you've basically identified an ISP or really big organisation only.
You can implement this with a bitmask exactly like you would for an IPv4 address, the question becomes a legal one though of "how much do I need to strip to comply with the specific legislation", not a technical one at that point though.
要匿名化公共 IPv6 地址,您可以采用前 2 组(32 位)并用 CRC-16 替换剩余部分(96 位)。一些示例(其中 abc1 和 abc2 - 是 CRC-16 值):
这种缩短可以轻松地将前 2 组(当然有一定概率)与保留时间较短的完整日志中的非匿名 IPv6 进行匹配。这有利于问题或安全事件调查。
如有必要,可以将 CRC-16 更改为 CRC-12 以提高匿名级别。
To anonymize public IPv6 addresses you could take the first 2 groups (32 bits) and replace the remaining part (96 bits) with CRC-16. Some examples (where abc1 and abc2 - are CRC-16 values):
Such shortening allows easy matching of the first 2 groups (of course with some probability) with non-anonymized IPv6 in full logs having shorter retention time. Which is good for problem or security incident investigation.
If necessary the CRC-16 could be changed to CRC-12 to increase anonymization level.