该项目的目的是强制在主要搜索引擎上进行安全搜索。
我设法安装了 Squid(3.3 版)和 SquidGuard,将 Squid 配置为具有 SSL 拦截功能的透明代理......
我设法在 Google、Yahoo 和 Bing 上强制执行安全搜索,但我无法使用 Duckduckgo 并且我找不到任何合理的解释(无论是在我自己还是在网络上)。
我的 Squid.conf 是:
acl localnet src 192.168.1.0/24 # RFC1918 possible internal network
acl localnet src fc00::/7 # RFC 4193 local private network range
acl localnet src fe80::/10 # RFC 4291 link-local (directly plugged) machin$
acl SSL_ports port 443
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 # https
acl Safe_ports port 70 # gopher
acl Safe_ports port 210 # wais
acl Safe_ports port 1025-65535 # unregistered ports
acl Safe_ports port 280 # http-mgmt
acl Safe_ports port 488 # gss-http
acl Safe_ports port 591 # filemaker
acl Safe_ports port 777 # multiling http
acl CONNECT method CONNECT
acl engines dstdomain .yahoo.com
acl engines dstdomain .duckduckgo.com
acl engines dstdomain .google.com
acl engines dstdomain .bing.com
cache deny all
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localhost manager
http_access deny manager
log_access allow all
url_rewrite_program /usr/bin/squidGuard -c /etc/squid/squidGuard.conf
url_rewrite_children 500
http_access allow localnet
http_access allow localhost
http_access deny all
http_port 3129
http_port 3128 intercept
https_port 3130 intercept ssl-bump connection-auth=off generate-host-certificates=on cert=/etc/squid/control.com.au.pem key=/etc/squid/control.com.au.pem cipher=ECDHE-RSA-RC4-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES128-SHA:DHE-RSA-CAMELLIA128-SHA:RC4-SHA:HIGH:!aNull:!MD5:!ADH
ssl_bump none localhost
ssl_bump server-first engines
#ssl_bump server-first all
ssl_bump none all
always_direct allow all
sslproxy_cert_error deny all
sslproxy_flags DONT_VERIFY_PEER
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
refresh_pattern . 0 20% 4320
SquidGuard 中的重写规则是:
rewrite engines {
s@.*bing.com/search.*@&\&adlt=strict@i
s@.*bing.com/images.*@&\&adlt=strict@i
s@.*bing.com/videos.*@&\&adlt=strict@i
s@.*au.search.yahoo.com.*@&\&vm=r@i
s@.*duckduckgo.com.*@&\&kp=1@i
s@.*google.com.au.*@1&safe=strict@i
s@.*google.com.*@1&safe=strict@i
s@.*bing.com.*@&\&adlt=strict@i
}
我很确定 squidGuard 重写规则没问题,因为如果我更改 Squid 配置以拦截所有SSL 通信,那么duckduckgo.com 就会被强制执行。问题是我应该输入什么而不是:
acl engines dstdomain .duckduckgo.com
??????
提前致谢