zoukankan      html  css  js  c++  java
  • 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

  • 相关阅读:
    [YTU]_2436( C++ 习题 输出日期时间--友元类)
    [YTU]_2435 ( C++ 习题 输出日期时间--友元函数)
    病毒侵袭
    石子合并(区间DP经典例题)
    AC自动机模板2
    【模板】最近公共祖先(LCA)
    华华给月月出题
    线性筛素数
    华华开始学信息学
    华华和月月种树
  • 原文地址:https://www.cnblogs.com/liu1026/p/9844300.html
Copyright © 2011-2022 走看看