アクセス制御を備えた透明なSquid





イカを調理する方法は、Squidをセットアップして会社の従業員へのアクセスを制限するという課題に直面したのは私だけではなかったが、同時に「透明」であるべきだと思います。 つまり、以下に示す構成は3つの条件を満たします。







ゲートウェイは「透過的」であるため、ドメインユーザー認証を使用できないため、最後のポイントで明確にしたいと思います。そのため、IPアドレスによって区別が正確に選択されます。



基本的な構成として、 証明書のなりすまし(x86)なしでHTTPSリソースをフィルタリングする記事「Transparent」Squidの資料を使用しました。 この記事のコンポーネントのインストールと構成は十分に詳細に説明されているため、この情報はスキップします。



構成のテストに使用したソフトウェア:





したがって、ファイル/etc/squid/squid.conf:



acl localnet src 192.168.0.0/16 # RFC1918 possible internal network 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 Safe_ports port 901 # SWAT acl CONNECT method CONNECT #  acl  : ,      acl denied_urls url_regex "/etc/squid/denied_urls" acl allowed_urls url_regex "/etc/squid/allowed_urls" acl extended_access_group src "/etc/squid/extended_access_group" http_access deny !Safe_ports http_access deny CONNECT !SSL_ports http_access allow localhost manager http_access deny manager #  -    ,         #  https  . #    ,  https http_access allow localnet CONNECT #      http_access deny denied_urls #             #  http_access deny !extended_access_group !allowed_urls http_access allow localnet http_access allow localhost http_access deny all #            http_port 3130 http_port 3128 intercept https_port 3129 intercept ssl-bump options=ALL:NO_SSLv3:NO_SSLv2 connection-auth=off cert=/etc/squid/squidCA.pem always_direct allow all sslproxy_cert_error allow all sslproxy_flags DONT_VERIFY_PEER #   ssl acl allowed_urls_ssl ssl::server_name_regex "/etc/squid/allowed_urls" acl denied_urls_ssl ssl::server_name_regex "/etc/squid/denied_urls" acl step1 at_step SslBump1 ssl_bump peek step1 ssl_bump terminate denied_urls_ssl ssl_bump splice extended_access_group ssl_bump terminate !allowed_urls_ssl ssl_bump splice all sslcrtd_program /usr/lib/squid/ssl_crtd -s /var/lib/ssl_db -M 4MB #cache_dir ufs /var/cache/squid 100 16 256 coredump_dir /var/cache/squid 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
      
      





Squidを起動する前に、 / etc / squid /に 3つのファイルを作成することを忘れないでください。 形式のdenied_urlsおよびallowed_urls



 geektimes.ru habrahabr.ru toster.ru windowsupdate.microsoft.com
      
      





そしてフォームのextended_access_group



 192.168.1.5 # .. 192.168.1.87 # .. 192.168.1.108 # ..
      
      





http経由で禁止サイトにアクセスすると、標準のSquidスタブ、およびhttps-「ERR_SSL_PROTOCOL_ERROR」経由で発行されます。



記事を読んでくれてありがとう。



All Articles