互联网服务供应商
anonymiseip的Python项目详细描述
Copyright (c) 2011, Canonical Ltd
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
匿名IP使用MaxMind GeoIP数据库匿名IPv4地址。来源 地址映射到国家级别,然后从 在游泳池里。为了避免已知的地址回映射,源地址是 哈希,哈希取mod pool size来选择新地址。作为IPv4 地址空间很小,这仍然很容易受到野蛮的强迫- 可以生成每个映射,如果找到单个映射 也可以满足咸杂碎的需求。因此,这不是 适用于防止恶意攻击,但也适用于 当确保员工不能随意访问IP地址时使用 weblogs,可以算作个人识别信息,同时 允许员工访问相同的日志,以便他们可以查看使用模式 并排除慢请求等故障。
要匿名IPv4地址,请执行get to/ipv4/x.y.z.a,响应 将是200 OK+新IP地址,或是5xx错误。
依赖关系
- Python2.6+
- maxmind geoip python库和国家级数据库。
安装
在具有所有依赖项的环境中运行python-m anonymiseip.main 可用。或者运行./bootstrap.py创建bin/buildout,然后 bin/buildout创建bin/py,最后创建bin/py-m gpverify.main。
注意,geoip python库和数据库可能必须由 手。在ubuntu系统上,它们在python geoip和 geoip数据库包。匿名IP在中查找数据库 '/usr/share/geoip/geoip.dat'。
测试
匿名IP是无状态的,而且速度很快,所以直接使用它进行测试就可以了。
pass–主机0.0.0.0–端口0将导致动态分配端口,并且 打印出来,然后您的测试驱动程序可以使用。