• ACL访问控制


    /etc/squid/squid.conf

    定义语法:

    acl aclname  acltype   string

    acl  aclname  acltype   "file"

    src 定义来源地址  (即用户的客户机IP地址);

    acl  aclname src ip-address/netmask

    acl   aclname src  addr1-addr2/netmask

    dst定义目标地址 (即用户请求的网站IP地址):

    acl aclname  dst  ip-address/netmask

    port用于指定访问端口

    acl  aclname port   80  1024

    acl  aclname  port  0-1024

    url-regex 用于限制网址中的关键词:

    acl  aclname  url_regex  [-i]  pattern

    proto 用于定义要代理的协议:

    acl aclname  proto  HTTP  FTP

    method 用于制定请求的方法:

    acl  aclname  method   GET  POST

    访问控制列表有多个规则条目组成,根据指定的条件来允许或限制访问请求,匹配顺序会由上至下,一旦匹配则立即结束,通常会在控制列表的最下面写上 " deny  all "  或者 "  allow all  "  来避免安全隐患。

    实战操作:

    仅允许192.168.0.10的主机使用本笃 Squid 服务 ,拒绝其余主机

    acl  client  src 192.168.0.10

    http_access  allow  client 

    http_access   deny  all

    拒绝客户机使用代理服务器访问带有关键词 " linux " 的网站

    acl  deny_keyword url_regex  -i  linux

    http_access  deny  deny_keyword

    拒绝客户机使用代理服务器访问 "  京东  "  网站

    acl   deny_url  url_regex   https://www.jd.com

    http_access  deny  deny_url

    禁止客户机代理服务器下载  MP3 与  rar  为后缀的文件

    acl  badfile  urlpath_regex  -i  .mp3$  .rar$

    http_access   deny  badfile

  • 相关阅读:
    Bat脚本处理ftp超强案例解说
    struts2中的输入校验
    struts国际化
    Spring2.5+Hibernate3.3的集成
    SQL Server如果视图存在就删除
    struts2自定义拦截器
    struts2标签
    spring2.5的第一个简单应用的学习
    基于XML配置方式实现对action的所有方法进行校验
    DataGridViewCell 类
  • 原文地址:https://www.cnblogs.com/liu1026/p/9844300.html
Copyright © 2020-2023  润新知