解析squid安全策略

豆豆网   技术应用频道   2007年09月22日  【字号: 收藏本文

内容摘要:介绍Linux下常用的Squid代理服务器的安全策略,期望抛砖引玉,对您的工作有所帮助。

  acl Safe_ports port 21 # ftp

  acl Safe_ports port 443 563 # https, snews

  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

  接着对通过CONNECT的非安全端口予以拒绝,使用如下命令:

  http_access deny CONNECT !SSL_ports

  最后对Squid进行重新编辑:

  #/squid/bin/squid -k reconfigure

  通过“tail/squid/logs/access.log -f |grep CONNECT”命令将看到使用CONNECT上网的非安全端口计算机都被拒绝。

  管理代理服务器端口

  没人愿意把自己的服务器作为义务代理服务器;同时,代理服务器很容易被用作对别人进行攻击的跳板。所以,代理服务器软件Squid也不可以随便提供服务,只需要在对应的squid.conf中加上“http_port 192.168.0.254:3128”,就能实现这一目标。这样由其它接口进入的用户就没办法使用代理服务了。

  关注Squid日志

  Linux网络管理员应当尽量记录所有日志,这些日志会记录所有异常访问的线索。最简单的方式便是通过浏览器来观察。squid本身提供一个cgi程序,文件名为cachemgr.cgi,squid安装完后将它复制到Apache服务器下的cgi-bin这个目录下即可使用。

  mv /usr/lib/squid/cachemgr.cgi /home/httpd/cgi-bin

  通过apache进行监控squid,修改配置文件/etc/http/conf/http.conf,添加以下内容:

责编:豆豆技术应用

正在加载评论...