ã¿ãªããããã«ã¡ã¯ïŒ
å€ãã®å Žåãçµç¹ã§ã¯ããããçš®é¡ã®ãããã·ããããã·ããœãããŠã§ã¢ã²ãŒããŠã§ã€ã®äžéšãšããŠäœ¿çšããããç¬ç«ããã¯ã©ã·ãã¯ããŒãžã§ã³ã®squid +ãã°ã¢ãã©ã€ã¶ãŒãªã©ã䜿çšããŸãã
IdecoãšIKSã®ãœãªã¥ãŒã·ã§ã³ãå®è£ ããããšããŸããããæçµçã«ã¯squidã«èœã¡çããŸããã ã«ããã®äžã§ããã¹ã®æŽå²ãšå€ãè¯ãã€ã«ã®èšå®ã«é¢ããæè¡æ å ±ã
ããããã2018幎ã«habrã§squidãèšå®ããããšã«é¢ããèšäºãèŠãã®ã¯ç¢ºãã«å¥åŠã§ãããšããäºå®ããå§ããŸãããããã§ããçŸåšã§ããææ補åã¯ãçŸããã€ã³ã¿ãŒãã§ãŒã¹ãåããææ補åã®æ ¹åºã«ãããªãŒãã³ãœãŒã¹ãœãããŠã§ã¢ãããå£ãå ŽåããããŸãã
ããã¯ãã¹ãŠã管çè ãã€ã³ã¿ãŒããã課éãè³Œå ¥ããäœè£ãããããšãæ確ã«ãããšããäºå®ããå§ãŸããŸããã
èŠä»¶ã¯ãWindows ADãžã®çµ±åãADããã®å®å šãªãŠãŒã¶ãŒç®¡çãã¹ããŒãã·ã§ãŒããŒãã³ã³ãã³ãã¿ã€ãããµã€ããªã¹ãã«ãããã£ã«ã¿ãªã³ã°ããããã¯ãŒã¯å šäœããããŒã«ã«äŒæ¥ãªãœãŒã¹ãžã®ã¢ã¯ã»ã¹ãèš±å¯ããæ©èœã§ãã
äŒç€Ÿã®ãããã¯ãŒã¯ã«ã¯550å°ãè¶ ããã³ã³ãã¥ãŒã¿ãŒããããŸãã ãããã®ã»ãšãã©ã¯ãå éšãªãœãŒã¹ã«ã¢ã¯ã»ã¹ããå¿ èŠããããŸãã
ä»®æ³ç°å¢ãHyper-vã³ã¢ä»®æ³åãµãŒããŒã§ãã¹ãŠãå±éãããŠããŸãã-ééã£ãéžæã§ããèšäºã®æåŸã§çç±ã説æããŸãã
åºå Žè ã®éžæã«ã€ããŠå°ã説æããŸããUserGateç§ã¯ITã§åãå§ãããšãããèŠããŠããŸããå€ãã¡ã¢ãªã®ããã«ãWindowsã¢ããªã±ãŒã·ã§ã³ã¯ããã©ã«ãã§ã¯é©åã§ã¯ãããŸããã
Internet Control ServerïŒIKSïŒ-ãã¹ãã«ãªããŸããã 10åã®ãã¡2åããæ£ããããŒãã§ããããã®åªããäžå®å®æ§ãããã«é²ãã ããšã«æ³šç®ããŸããã ãšããã§ãç§ã¯éçºè ã®ãŠãŒã¢ã¢ã«æ³šæãããããããŸããããéçºè ã¯ç¥ã£ãŠããã§ãããïŒ è£œåã¯éçºäžã§ããã§ã«åé¡ã¯ãªããããããŸããããåé¡ã¯è§£æ±ºãããŠããŸãã
Ideco-ç§ã¯ãããçŽ æŽããããœãªã¥ãŒã·ã§ã³ã§ãããšèšã£ãŠããŸããããæ©èœã«ã¯ã€ã³ã¿ãŒãããè«æ±ã ãã§ãªãããã¹ãŠã®å©ç¹ãåããæ¬æ Œçãªã²ãŒããŠã§ã€ãå«ãŸããŠããŸãã ããã§ãã圌ã¯å®å šãªãã¹ãã«åæ Œããä¹ãè¶ããããªã2ã€ã®é害ãçããŸããã
1.ãããã¯ãŒã¯å šäœã®ç¹å®ã®ãªãœãŒã¹ãŸãã¯ãã¡ã€ã³ã®ãã¹ãŠã®ãŠãŒã¶ãŒã«ã¢ã¯ã»ã¹ãèš±å¯ããããšã¯ã§ããŸãããããã©ã«ãã§ã¯ãã©ã€ã»ã³ã¹ãå¿ èŠãšãããŠãŒã¶ãŒãã«ãŠã³ãããŸããã
1.1-ãã€ã³ã1ã¯ãããªãã®äŸ¡æ Œãæå³ããŸãã 瀟å ã«ã¯ããªãã®æ°ã®ã³ã³ãã¥ãŒã¿ãŒããããå éšWebãµãŒãã¹ã«æ¥ç¶ããå¿ èŠããããã€ã³ã¿ãŒãããã«ã¢ã¯ã»ã¹ããå¿ èŠã¯ãããŸãããå éšãªãœãŒã¹ã䜿çšããããã®ã©ã€ã»ã³ã¹ãè³Œå ¥ããäºå®ããã€ã³ã¿ãŒããããé ä¿¡ãããµãŒããŒçšã®åç©åãèšå®ããäºå®ããããŸããã
2.ã³ã³ãã¥ãŒã¿ãŒã® IPã¢ãã¬ã¹ã¯ããããã·ã§æåã«èªèšŒããããŠãŒã¶ãŒã®ååã«å³å¯ã«é¢é£ä»ããããŠãããããåŸæ¥å¡ãå€æŽãããšãã¯ç®¡çãå¿ èŠã§ããã æåã¢ãŒãã§ãã€ã³ããåé€ããããã«ããã¡ãããADãä»ããŠãã¹ãŠã管çããèŠä»¶ãæºãããŠããŸããã
ã¡ãªã¿ã«ãidecoã²ãŒããŠã§ã€ã¯ãADã«ãã€ã³ãããã«ãæ倧40ãŠãŒã¶ãŒãŸã§ç¡æããŒãžã§ã³ã§å©çšã§ããŸãã IDECO SELECTAãç»å Žãããããã®ãªãªãŒã¹ã«æ°ä»ããªãã£ããããã¹ãŠã®ãã¹ãåŸã«ãªãªãŒã¹ãããŸããã
ãã¹ãŠã®ã¹ããããçµäºããåŸãç§ãã¡èªèº«ã§squidã§ãã¹ãŠãè¡ãããšã決å®ãããŸããããæè¡çãªèŠä»¶ã«åãããŠèª¿æŽãããŸããã
ãŸãããããã¯ãŒã¯äžã«æ£ããå®å šãªããã¥ã¢ã«ã¯ãªããããã€ãã®éšåããããŸããããã¹ãŠã®æ瀺ã¯æ°ããsquidãªãªãŒã¹ã«ãã£ãŠç¡å¹ã«ãããŸããã
ç§ãã¡ã¯ubuntuãµãŒããŒã䜿çšããŠããããã次ã®æ å ±ã¯ãã®OSã«é¢é£ããŠãããä»ã®OSãšã¯å€§ããç°ãªãå¯èœæ§ããããŸãã
ã³ãã³ãã©ã€ã³ã®ãã¹ãŠãsudoã®äžããå®è¡ããå¿ èŠããããŸãããã®åŸãåã³ãã³ãã«sudoãè¿œå ããŸããã
OS ubuntuãµãŒããŒ16.04ã®æ§æïŒ
apt-get update apt-get upgrade apt-get install mc g++ libecap3-dev libdb-dev libldap2-dev libpam0g-dev libldb-dev libsasl2-dev libkrb5-dev gcc libssl-dev krb5-user libpam-krb5 libkrb5-3 libsasl2-modules-gssapi-mit linux-virtual-lts-xenial linux-tools-virtual-lts-xenial linux-cloud-tools-virtual-lts-xenial linux-image-virtual linux-tools-virtual linux-cloud-tools-virtual squid3
ãªããªã Hyper-vä»®æ³åã䜿çšããŠãããå¿ èŠãªããã±ãŒãžãã€ã³ã¹ããŒã«ããŸããã
ãµã€ãã®ãµã€ãããã€ã«ãããŠã³ããŒãããŸãããã®æçš¿ã§ã¯ããŒãžã§ã³3.5.26ã解æããŸããä»ã®ããŒãžã§ã³ã§ã¯ããããç¡é¢ä¿ã§ãã Dockerã®UPDã¯ã3.5.28ã®éåžžã®ãã©ã€ããæ§æããŸããã
wget http://www.squid-cache.org/Versions/v3/3.5/squid-3.5.26.tar.gz
èªå® ãŸãã¯ãã®ä»ã®ãã£ã¬ã¯ããªã«è§£åããŸãã
tar xzf squid-3.5.26.tar.gz cd /home/squid-3.5.26/
chmod +x configure
å¿ èŠãªããã±ãŒãžã瀺ããŸããäžèŠãªããã±ãŒãžãåé€ããããäœããè¿œå ããŸãã 誰ãã«ãšã£ãŠã¯äœåãªãã®ãããããããããã§ãã ã€ã³ã¹ããŒã«ãããŠããsquidã®ããŒãžã§ã³ãããªã¹ããååŸãããšãè¿œå ã®ããã±ãŒãžãè¿œå ãããŸãã
./configure '--enable-ssl' '--with-openssl=/usr/lib/ssl/' '--disable-ipv6' '--enable-ssl-crtd' '--build=x86_64-linux-gnu' '--prefix=/usr' '--includedir=${prefix}/include' '--mandir=${prefix}/share/man' '--infodir=${prefix}/share/info' '--sysconfdir=/etc' '--localstatedir=/var' '--libexecdir=${prefix}/lib/squid3' '--srcdir=.' '--disable-maintainer-mode' '--disable-dependency-tracking' '--disable-silent-rules' 'BUILDCXXFLAGS=-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security -Wl,-Bsymbolic-functions -fPIE -pie -Wl,-z,relro -Wl,-z,now' '--datadir=/usr/share/squid' '--sysconfdir=/etc/squid' '--libexecdir=/usr/lib/squid' '--mandir=/usr/share/man' '--enable-inline' '--disable-arch-native' '--enable-async-io=8' '--enable-storeio=ufs,aufs,diskd,rock' '--enable-removal-policies=lru,heap' '--enable-delay-pools' '--enable-cache-digests' '--enable-icap-client' '--enable-follow-x-forwarded-for' '--enable-auth-basic=DB,fake,getpwnam,LDAP,NCSA,NIS,PAM,POP3,RADIUS,SASL,SMB' '--enable-auth-digest=file,LDAP' '--enable-auth-negotiate=kerberos,wrapper' '--enable-auth-ntlm=fake,smb_lm' '--enable-external-acl-helpers=file_userip,kerberos_ldap_group,LDAP_group,session,SQL_session,unix_group,wbinfo_group' '--enable-url-rewrite-helpers=fake' '--enable-eui' '--enable-esi' '--enable-icmp' '--enable-zph-qos' '--enable-ecap' '--disable-translation' '--with-swapdir=/var/spool/squid' '--with-logdir=/var/log/squid' '--with-pidfile=/var/run/squid.pid' '--with-filedescriptors=65536' '--with-large-files' '--with-default-user=proxy' '--enable-build-info=Ubuntu linux' '--enable-linux-netfilter' 'build_alias=x86_64-linux-gnu' 'CFLAGS=-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security -Wall' 'LDFLAGS=-Wl,-Bsymbolic-functions -fPIE -pie -Wl,-z,relro -Wl,-z,now' 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2' 'CXXFLAGS=-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security' make make install
--with-openssl = / usr / lib / ssl /-opensslãžã®ãã¹ãæå®ããŸããubuntuãµãŒããŒã®ããã©ã«ããã¹ãæå®ãããŸãã
--disable-ipv6-ipv6ããªãã«ããŸã-以äžã®çç±ããèªã¿ãã ããã
--enable-ssl-crtd-ããã¯ããã³ãçšã®SSL蚌ææžãçæãããã³ãã«çšã§ãã
äŸåé¢ä¿ãããå¯èœæ§ããããããã€ã³ã¹ããŒã«ããå¿ èŠããããŸãã
ããã©ã«ãã§ã¯ããã¹ãŠã/ etc / squid /ã«ã€ã³ã¹ããŒã«ãããŸã
SSL蚌ææžçšã«/ etc / squidå ã«ãã©ã«ããŒãäœæããŸãã
mkdir /etc/squid/ssl/private
蚌ææžãäœæããŸãã
ãã£ã¬ã¯ããªã«ç§»åããŸã
cd mkdir /etc/squid/ssl/private
ããŒãäœæãã
openssl genrsa -aes256 -out private.pem 2048
蚌ææžãäœæãã
openssl req -x509 -sha256 -nodes -days 3650 -newkey rsa:2048 -keyout private.pem -out public.pem
蚌ææžããã©ãŠã¶ãŒã«é©ãã圢åŒã«å€æãã
openssl x509 -outform der -in public.pem -out squid3domainlocal.der
蚌ææžããŒã¿ããŒã¹ãäœæããŸãã
/usr/lib/squid/ssl_crtd -c -s /etc/squid/ssl/ssl_db/
ã¢ã¯ã»ã¹ãå²ãåœãŠãïŒ
chown root:proxy -R /etc/squid/ssl chmod 640 -R /etc/squid/ssl/private chmod 660 -R /etc/squid/ssl/ssl_db
ãããã·ãµãŒããŒã®ååãšèšŒææžã®äœææã«æå®ãããååã¯åãã§ããå¿ èŠãããããšã«æ³šæããŠãã ããã 圢åŒã¯squid3.domain.localã§ãã
ã°ã«ãŒãããªã·ãŒã䜿çšããŠsquid3domainlocal.derãååŸããããä¿¡é Œã§ãã蚌ææ©é¢ã«æåã§å ¥åããŸããã ãã©ãŠã¶ã®ãããã·ãµãŒããŒã¯ãipã§ã¯ãªããã³ã³ãã¥ãŒã¿ãŒã®ãã«ããŒã ïŒsquid3.domain.localãªã©ïŒã瀺ããŸãã
ãã¡ã€ã³ã«æ®éã®ãŠãŒã¶ãŒãäœæããsquid3ã«ããŸãã
Kerberosãä»ããŠèªèšŒãæž¡ãã«ã¯ãããªã³ã·ãã«HTTP/squid3.DOMAIN.LOCAL@DOMAIN.LOCALã®squid3ãŠãŒã¶ãŒã®ããŒã¿ããå¿ èŠã§ãããããåºåãä»ãããã¡ã€ã³ãžã®æšæºãã°ã€ã³ã§ãkeytab /etc/krb5.keytabãäœæãããŸãããhttpãšhostã§ã¯ãªãããªã³ã·ãã«ã瀺ããŸãã Webãã©ãŠã¶ãä»ããŠãŠãŒã¶ãŒãèªèšŒããããšãäžå¯èœã«ãããã®ã keytabã/etc/krb5.keytabã«é 眮ãããã·ã³èªäœããã¡ã€ã³ã«å ¥åãããšãkeytabã«æ°ããããªã³ã·ãã«ãè¿œå ãããã ãã§ãããsambaããã±ãŒãžãã€ã³ã¹ããŒã«ããŠãã·ã³ããã¡ã€ã³ã«å ¥åããå¿ èŠããªãããšã«æ³šæããŠãã ããããŠãŒã¶ãŒã
次ã«ããã¡ã€ã³ã³ã³ãããŒã©ãŒã«ç§»åããŠãç°¡åãªã³ãã³ããå®è¡ããŸãã
ktpass -princ HTTP/squid3.DOMAIN.LOCAL@DOMAIN.LOCAL mapuser squid3@DOMAIN.LOCAL -crypto AES128-SHA1 -pass XXXXXXXXXXXXXX -ptype KRB5_NT_PRINCIPAL -out c:\krb5.keytab
åä¿¡ãããã¡ã€ã«ããããã·ãµãŒããŒã«è»¢éããŠããã䟿å©ãªå Žæã«é 眮ãã/ etc / krb5.keytabãéžæããŸãã
Webãµã€ããçµ±èšããŸãã¯äŒç€Ÿã®å éšããŒã¿ã«ã«å¯ŸããŠãæ¿èªãè¡ãå Žåã¯ãã°ã«ãŒããäœæããããã«ãããã·ããã³www-dataãŠãŒã¶ãŒãå«ããå¿ èŠããããŸãã
ã°ã«ãŒããäœæããŸãã
groupadd allowreadkeytab
ã°ã«ãŒãã«å¿ èŠãªãŠãŒã¶ãŒãè¿œå ããŸãã
adduser proxy allowreadkeytab adduser www-data allowreadkeytab
ææè ãkrb5.keytabã«å²ãåœãŠã
chown root:allowreadkeytab /etc/krb5.keytab
è¿œå ã®ãµãŒãã¹ãžã®ã¢ã¯ã»ã¹æš©ãä»äžããå¿ èŠããªãå Žåãã°ã«ãŒããäœæãããåã«ææè ãšæš©å©ãèšå®ããŸãã
chown root:proxy /etc/krb5.keytab
ã¢ã¯ã»ã¹ãå²ãåœãŠãïŒ
chmod 640 /etc/krb5.keytab
ååŸãããã®ïŒ
-rw-r----- 1 root allowreadkeytab /etc/krb5.keytab
ãŸãã¯
-rw-r----- 1 root proxy /etc/krb5.keytab
ã«ãŒãã®èªã¿åããšæžã蟌ã¿ãallowreadkeytabã®èªã¿åãã®ã¿ãæ®ãã®ã¢ã¯ã»ã¹ã¯çŠæ¢ã
krb5.confãæ§æãã
mcedit /etc/krb5.conf
krb5.conf
[libdefaults] krb4_config = /etc/krb.conf krb4_realms = /etc/krb.realms kdc_timesync = 1 ccache_type = 4 forwardable = true proxiable = true default_tgs_enctypes = aes256-cts-hmac-sha1-96 rc4-hmac des-cbc-crc des-cbc-md5 default_tkt_enctypes = aes256-cts-hmac-sha1-96 rc4-hmac des-cbc-crc des-cbc-md5 permitted_enctypes = aes256-cts-hmac-sha1-96 rc4-hmac des-cbc-crc des-cbc-md5 default_keytab_name = FILE:/etc/krb5.keytab v4_instance_resolve = false v4_name_convert = { host = { rcmd = host ftp = ftp } plain = { something = something-else } } fcc-mit-ticketflags = true [realms] DOMAIN.LOCAL = { kdc = DC1.DOMAIN.LOCAL kdc = DC2.DOMAIN.LOCAL admin_server = DC1.DOMAIN.LOCAL admin_server = DC2.DOMAIN.LOCAL default_domain = DOMAIN.LOCAL } [domain_realm] .domain.local = domain.LOCAL domain.local = domain.LOCAL [login] krb4_convert = true krb4_get_tickets = false
ä¿åããŸãã
squid.confã®äžã«ã¯ãã¹ãŠã®aclãšãã¹ãŠã®ã«ãŒã«ãå«ãŸããããã§ã¯ãªãããšã«æ³šæããŠãã ãããæ§æã®äŸã¯1ã€ã ãã§ãaclã®å®å šãªæ§æãšãµã€ããžã®ã¢ã¯ã»ã¹ãªã¹ããªã©ããããŸãã 倧ããããŸãã 次ã®æ§æã¯ãããŒãºã«åãããŠå€æŽãå¿ èŠãšèŠãªãããšãã§ããŸãã
squidã®æ§æã«é²ã¿ãŸãã
mcedit /etc/squid/squid.conf acl SSL_ports port 443 acl Safe_ports port 80 acl Safe_ports port 21 acl purge method PURGE acl CONNECT method CONNECT http_access allow purge localhost http_access deny purge http_access deny CONNECT !SSL_ports
ããã¯éèŠãªãã€ã³ãã§ããæ¥ç¶ãçŽæ¥ãã³ã³ãã¥ãŒã¿ãŒãã«äžãããµã€ããããããŠãŒã¶ãŒèªèšŒã¯å®è¡ãããŸããã ãã®çµæãæ¥ç¶ããããã¯ãããŸãã ãã®åé¡ãåé¿ããã«ã¯ãç¹å®ã®IPã«ç¹å®ã®ãµã€ããžã®ã¢ã¯ã»ã¹æš©ãä»äžããŸãã
!!! éèŠãªæ³šæ!!! ã«ãŒã«ã¯ãèªèšŒbasicãntlmãkerberosãªã©ã®ã«ãŒã«ã®äžã«é 眮ããå¿ èŠããããŸãã
acl authip src "/etc/squid/pools/ip.txt" acl domainautip dstdomain "/etc/squid/exceptions/domain.txt" http_access allow authip domainautip http_reply_access allow authip domainautip
ACLãå®çŸ©ããŸãã
â ããã¥ã¡ã³ã
ã³ã³ãã³ãã®ã¿ã€ãã決å®ããACLïŒ
acl application_mime rep_mime_type application / octet-stream
acl video_mime rep_mime_type "/etc/squid/ban/mime_type_video.txt"
mime_type_video.txt
ãããª/ mpeg
ãããª/ mp4
ãããª/ ogg
ãããª/ã¯ã€ãã¯ã¿ã€ã
ãããª/ webm
ãããª/ x-ms-wmv
ãããª/ x-flv
ãããª/ 3gpp
ãããª/ 3gpp2
ãããª/ avi
ãããª/ msvideo
ãããª/ x-msvideo
ãããª/ x-dv
ãããª/ dl
ãããª/ x-dl
ãããª/ vnd.rn-realvideo
ãããª/ mp4
ãããª/ ogg
ãããª/ã¯ã€ãã¯ã¿ã€ã
ãããª/ webm
ãããª/ x-ms-wmv
ãããª/ x-flv
ãããª/ 3gpp
ãããª/ 3gpp2
ãããª/ avi
ãããª/ msvideo
ãããª/ x-msvideo
ãããª/ x-dv
ãããª/ dl
ãããª/ x-dl
ãããª/ vnd.rn-realvideo
äžéšã®ã³ã³ãã³ããURLã§ãã£ã«ã¿ãªã³ã°ããããšãã§ããŸãããã®ããã«ãaclãäœæããŸãã
acl blockextention urlpath_regex -i "/etc/squid/ban/blockextention.txt"
blockextention.txt
\ .snapshot $
\ .windows $
\ .mac $
\ .zfs $
\ .action $
\ .apk $
\ .app $
\ .bat $
\ .bin $
\ .cmd $
\ .com $
\ .command $
\ .cpl $
\ .csh $
\ .exe $
\ .gadget $
\ .inf1 $
\ .ins $
\ .inx $
\ .ipa $
\ .isu $
\ .job $
\ .ksh $
\ .msc $
\ .msi $
\ .msp $
\ .mst $
\ .osx $
\ .out $
\ .paf $
\ .reg $
\ .rgs $
\ .run $
\ .sct $
\ .sh $
\ .shb $
\ .shs $
\ .u3p $
\ .vb $
\ .vbe $
\ .vbs $
\ .vbscript $
\ .workflow $
\ .ws $
\ .wsf $
\ .bin $
\ .inf $
\ .com $
\ .cpp $
\ .msu $
\ .pif $
\ .7z $
\ .ace $
\ .arj $
\ .cab $
\ .cbr $
\ .deb $
\ .gz $
\ .gzip $
\ .jar $
\ .one $
\ .pak $
\ .ppt $
\ .rpm $
\ .sib $
\ .sis $
\ .sisx $
\ .sit $
\ .sitx $
\ .spl $
\ .tar $
\ .tar-gz $
\ .tgz $
\ .xar $
\ .zipx $
\ .asf $
\ .asm $
\ .c $
\ .cfm $
\ .cgi $
\ .class $
\ .cpp $
\ .cs $
\ .dot $
\ .dtd $
\ .fla $
\ .ged $
\ .gv $
\ .h $
\ .icl $
\ .java $
\ .jse $
\ .kml $
\ .lua $
\ .m $
\ .mb $
\ .mdf $
\ .mod $
\ .obj $
\ .pkg $
\ .pl $
\ .po $
\ .pot $
\ .ps1 $
\ .pub $
\ .py $
\ .rss $
\ .sln $
\ .so $
\ .sql $
\ .ts $
\ .vc4 $
\ .vcproj $
\ .vc4 $
\ .vcproj $
\ .vcxproj $
\ .wsc $
\ .xcodeproj $
\ .xsd $
\ .torrent $
\ .windows $
\ .mac $
\ .zfs $
\ .action $
\ .apk $
\ .app $
\ .bat $
\ .bin $
\ .cmd $
\ .com $
\ .command $
\ .cpl $
\ .csh $
\ .exe $
\ .gadget $
\ .inf1 $
\ .ins $
\ .inx $
\ .ipa $
\ .isu $
\ .job $
\ .ksh $
\ .msc $
\ .msi $
\ .msp $
\ .mst $
\ .osx $
\ .out $
\ .paf $
\ .reg $
\ .rgs $
\ .run $
\ .sct $
\ .sh $
\ .shb $
\ .shs $
\ .u3p $
\ .vb $
\ .vbe $
\ .vbs $
\ .vbscript $
\ .workflow $
\ .ws $
\ .wsf $
\ .bin $
\ .inf $
\ .com $
\ .cpp $
\ .msu $
\ .pif $
\ .7z $
\ .ace $
\ .arj $
\ .cab $
\ .cbr $
\ .deb $
\ .gz $
\ .gzip $
\ .jar $
\ .one $
\ .pak $
\ .ppt $
\ .rpm $
\ .sib $
\ .sis $
\ .sisx $
\ .sit $
\ .sitx $
\ .spl $
\ .tar $
\ .tar-gz $
\ .tgz $
\ .xar $
\ .zipx $
\ .asf $
\ .asm $
\ .c $
\ .cfm $
\ .cgi $
\ .class $
\ .cpp $
\ .cs $
\ .dot $
\ .dtd $
\ .fla $
\ .ged $
\ .gv $
\ .h $
\ .icl $
\ .java $
\ .jse $
\ .kml $
\ .lua $
\ .m $
\ .mb $
\ .mdf $
\ .mod $
\ .obj $
\ .pkg $
\ .pl $
\ .po $
\ .pot $
\ .ps1 $
\ .pub $
\ .py $
\ .rss $
\ .sln $
\ .so $
\ .sql $
\ .ts $
\ .vc4 $
\ .vcproj $
\ .vc4 $
\ .vcproj $
\ .vcxproj $
\ .wsc $
\ .xcodeproj $
\ .xsd $
\ .torrent $
奜å¥å¿ã匷ãacl allowerrorsertããããŸãã ããã©ã«ãã§ã¯ãæ²ãã£ã蚌ææžãæã€ãµã€ããžã®ã¢ã¯ã»ã¹ãèš±å¯ããŠããŸãããallowerrorsertã䜿çšããŠããæ²ãã£ããSSLãæã€èš±å¯ãµã€ãã®ãªã¹ãã決å®ããŸãã ããã¯ããã»ã©äœãã¯ãããŸããã
acl banksites dstdomain "/etc/squid/allow/bank.txt" acl allofficesites dstdomain "/etc/squid/allow/alloffice.txt" acl manual dstdomain "/etc/squid/ban/manual.txt" acl allowerrorsert dstdomain "/etc/squid/exceptions/allowerrorsert.txt"
SSLã«ãŒã«ã«åºã¥ããŠãµã€ããžã®ã¢ã¯ã»ã¹ãå¶åŸ¡ããããšãå¯èœã§ãããç§ã®æèŠã§ã¯ãhttp_accessã䜿çšããŠç®¡çããæ¹ãå¹ççã§ãã SSLã«ãŒã«ã§äœ¿çšããaclã®äŸã次ã«ç€ºããŸãã
acl sslproxy ssl::server_name "/etc/squid/ban/proxy.txt"
以äžã§ã¯ããã®ã¿ã€ãã®ACLãšãã®ã¢ããªã±ãŒã·ã§ã³ã«æ»ããŸãã
詳现ã¢ãŒãã§POSTããã³MIMEãªã¯ãšã¹ãã衚瀺ã§ããŸãã
strip_query_terms off log_mime_hdrs on
Kerberosãä»ããã¢ã¯ãã£ããªãã£ã¬ã¯ããªã°ã«ãŒãã§ã®èªèšŒãšãŠãŒã¶ãŒæ¿èªïŒ
auth_param negotiate program /usr/lib/squid/negotiate_kerberos_auth -s HTTP/squid3.domain.local@DOMAIN.LOCAL auth_param negotiate children 20 startup=10 idle=10 auth_param negotiate keep_alive on
ããã§ãåæ¢ããŠãã詳现ã«åæããå¿ èŠããããŸããå-éå§ã§ããããã»ã¹ã®æ倧æ°ãåžžã«å®è¡ãããŠããããã»ã¹ã®æ°ãèµ·åããã¢ã·ã¹ã¿ã³ãã®æ倧ãã¥ãŒãã¢ã€ãã«ç¶æ ã«ããæå®ãããæ°ãè¶ ãããšãæ°ããã¢ã·ã¹ã¿ã³ãããã»ã¹ãèµ·åãããŸãã
æ¿èªäœæ¥ã«é¢ããå°ããªäœè«ïŒ
ç¹æ®æ§ããããŸããå®éãäžéšã®ãµã€ãã¯ä»ã®ãµã€ãã®ããŸããŸãªãªãœãŒã¹ãšåçã®è»ãæ¥ç¶ããå€ãã®çµ±èšãåéãããªã©ãåãªã¯ãšã¹ãã¯æ¿èªãæž¡ããŸããããã«ãããæ¿èªã¢ã·ã¹ã¿ã³ãããã»ã¹ã«å€§ããªãã¥ãŒãçºçããå¯èœæ§ããããåäŸãå¢ãããã¢ã€ãã«ãå¢ããããšãã§ããŸã...ããããããã¯äžèŠããã ãã§ã1人ã®ãŠãŒã¶ãŒããæ°äžä»¶ã®ãªã¯ãšã¹ããéä¿¡ããã倧ããªãã¥ãŒãéä¿¡ãããå ŽåããããŸãã 倧ããªãã¥ãŒã衚瀺ããããšãCPUã®è² è·ãããŒã«ãªãŒããŒããŸãã å€æ°ã®PCãšå®å šãªã€ã³ã¿ãŒãããã¢ã¯ã»ã¹ãæã€å°æ°ã®ãŠãŒã¶ãŒã®ç¶æ³ã§ã¯ãPCã«ã€ã³ã¹ããŒã«ãããã¯ãã ã¯é©ãã»ã©å€ãã®æ¥ç¶ãäœæããŸãã-1æ¥ãããclients.google.comãžã®50äžãªã¯ãšã¹ãã ãã®çµæãç·ã®ããŒã¯ããããŸããã
èšäºã®æåŸã«ãããœãªã¥ãŒã·ã§ã³ã®è©³çŽ°ããããã°ããã»ã¹äžã«çºçããåé¡ã解決ããããã®æè¡çãªåŽé¢ã®ããã€ãã«ã€ããŠèª¬æããŸãã
ã°ã«ãŒãå ã®ãŠãŒã¶ãŒãæ€çŽ¢ããŸãã
external_acl_type domainusers ttl=300 negative_ttl=60 ipv4 %LOGIN /usr/lib/squid3/ext_kerberos_ldap_group_acl -a -T d09fd0bed0bbd18cd0b7d0bed0b2d0b0d182d0b5d0bbd0b820d0b4d0bed0bcd0b5d0bdd0b0 -D DOMAIN.LOCAL external_acl_type allow-all ttl=300 negative_ttl=60 ipv4 %LOGIN /usr/lib/squid3/ext_kerberos_ldap_group_acl -a -g internet-allow-all -D DOMAIN.LOCAL
squid3 / ext_kerberos_ldap_group_acl -a -T d09fd0bed0bbd18cd0b7d0bed0b2d0b0d182d0b5d0bbd0b820d0b4d0bed0bcd0b5d0bdd0b0 -D DOMAIN.LOCALexternal_acl_type domainusers ttl=300 negative_ttl=60 ipv4 %LOGIN /usr/lib/squid3/ext_kerberos_ldap_group_acl -a -T d09fd0bed0bbd18cd0b7d0bed0b2d0b0d182d0b5d0bbd0b820d0b4d0bed0bcd0b5d0bdd0b0 -D DOMAIN.LOCAL external_acl_type allow-all ttl=300 negative_ttl=60 ipv4 %LOGIN /usr/lib/squid3/ext_kerberos_ldap_group_acl -a -g internet-allow-all -D DOMAIN.LOCAL
äžèšã®2è¡ã§ã1ã€ã®æ©èœãå®è¡ããã°ã«ãŒãå ã®ãŠãŒã¶ãŒãæ€çŽ¢ããã¢ã·ã¹ã¿ã³ããããŒãããã³ãã³ãã©ã€ã³ã§/ usr / lib / squid3 / ext_kerberos_ldap_group_acl -a -g internet-allow-all -D DOMAIN.LOCALãå®è¡ããEnterãæŒããŠãŠãŒã¶ãŒåãå ¥åããŸããæå®ãããã°ã«ãŒãã§ãŠãŒã¶ãŒãèŠã€ãã£ãå Žåãçãã¯OKã§ãèŠã€ãããªãã£ãå Žåã¯ERRã§ãã æå®ãããã°ã«ãŒãInternet-allow-allãADã§äœæããããšããäºå®ã«æ³šç®ããŸãã
ããªããæ°ã¥ãããªãã2ã€ã®è¡ãç°ãªãã2çªç®ã®1ã€ã®äžå¯è§£ãªæåãšæ°åã®ã»ããã§ãã¹ãŠãæããã§ã...æåã®è¡ã«ã°ã«ãŒãããã¡ã€ã³ãŠãŒã¶ãŒãã瀺ãããŠãããã€ã«ã®èšå®ãšãã«ããŒäœæ¥ã§ããªã«æåãæ±ããããªãã®ã§ããããè¡ãããšã«ããŸããããªã«æåã§èšè¿°ãããååãæã€ãã®ãµãŒãã¹ã«é¢é£ä»ããããŠããADå ã®å¯äžã®ã°ã«ãŒãã æ§æãå€æŽãããgã¯Täžã®ã°ã«ãŒããæå³ããŸãã
圌ã¯ipv6ãåæããçç±ãäŒããããšãçŽæããŸãããããã¯é·ã話ã§ãããç§ã¯è¡ã§external_acl_typeãæå®ããªãã£ãã®ã§ãèš±å¯ã¯ãŠãŒã¶ãŒã«è¡ããŸããã§ãã....... ipv4 ç§ãã¡ã¯ipv6ã䜿çšãããããŒã«ã«ãããã¯ãŒã¯ã§äœ¿çšãã人ã¯ã»ãšãã©ããŸããããã®ãããªåé¡ãåé¿ããããã«ãå®å šã«ç¡å¹ã«ããããšã決å®ãããŸããã ããã¯ãã€ã³ã¿ãŒããããµãŒãã£ã³ã«ãåæ ãããŠããŸããã
é床å¶éã®ã°ã«ãŒãïŒ
external_acl_type disable-speed ttl=300 negative_ttl=60 ipv4 %LOGIN /usr/lib/squid3/ext_kerberos_ldap_group_acl -a -g internet-deny-speed -D DOMAIN.LOCAL external_acl_type allow-speed ttl=300 negative_ttl=60 ipv4 %LOGIN /usr/lib/squid3/ext_kerberos_ldap_group_acl -a -g internet-allow-speed -D DOMAIN.LOCAL
ã€ã³ã¿ãŒãããèš±å¯é床-ADã§äœæãããã°ã«ãŒãã
å€éšãã«ããŒããã°ã«ãŒããšãŠãŒã¶ãŒãååŸãããããhttp_accessãæ©èœããããã«ãsquidæ§æã§aclãå®çŸ©ããå¿ èŠããããŸãã
acl domainusers external domainusers acl allow-all external allow-all acl allow-speed external allow-speed acl disable-speed external disable-speed
以äžã¯ãèš±å¯ã«ãŒã«ãšãããã¯ã«ãŒã«ã§ãã ã«ãŒã«ã¯éåžžéããã§ãŒã³ã§æ©èœããäžèšã®ãã¹ãŠãããéèŠã§ãã
http_access allow localhost http_access deny manual http_reply_access deny application_mime http_access allow allow-all http_reply_access allow allow-all http_access allow domainusers banksites http_access deny domainusers
ããã§ãã³ããå§ãŸããŸããhttp_portè¡ã§ããŒããæå®ããssl-bumpé¢æ°ãæå®ããŠããã蚌ææžã®çæããªã³ã«ããŠãããã£ãã·ã¥ãµã€ãºããªã³ã«ãããã¡ã€ã³ã³ã³ãã¥ãŒã¿ãŒã®ä¿¡é Œã§ããèªèšŒå±ãšããŠè¿œå ãããåèªã«èšŒææžèªäœãæå®ãã次ã«ããŒãæå®ããŸãã
äœæ¥ã®ã¹ããŒã ã¯æ¬¡ã®ãšããã§ããã¯ã©ã€ã¢ã³ãã¯google.comã«ç§»åããã¯ã©ã€ã¢ã³ãã¯ãããã·ãšã®sslæ¥ç¶ã確ç«ãããããã·ã¯ãµã€ããšé çªã«æ¥ç¶ããŸãããããã·ã¯ãµã€ããšã®sslã解é€ããã¯ã©ã€ã¢ã³ãã仲ä»ãšããŠåäœããsslãåå¥ã«è§£é€ããŸãã
æ¥ç¶ã®å®å šãªãã³ããåãããã®ã¹ããŒã ã¯ãå®å šã«å解ããããšã¯ã§ããŸããããäžæ¹ã®åœäºè ã®ã¿ããã®ã¢ããªã±ãŒã·ã§ã³ãèŠã€ããããªãã£ãããã䜿çšããŸããã ããã«ãhttpãªã©ã®ãã¹ãŠã®ãã©ãã£ãã¯ããªãŒãã³ã«è¡šç€ºããã«ã¯ããã®ã¹ããŒã ã®ã¿ãé©ããŠããŸãã
http_port 3128 ssl-bump generate-host-certificates=on dynamic_cert_mem_cache_size=16MB cert=/etc/squid/ssl/private/public.pem key=/etc/squid/ssl/private/private.pem
ãµã€ãã®SSL蚌ææžãçæããèšå®ãã«ããŒïŒ
sslcrtd_program /usr/lib/squid/ssl_crtd -s /etc/squid/ssl/ssl_db -M 16MB sslcrtd_children 20 startup=10 idle=10 visible_hostname = squid3.domain.local
ãã³ãã¹ãããã§aclãäœæããŸãã3ã€ã®ã¹ããããããããŸãããsslbump1ã¯èšŒææžå ã®å ¬éæ å ±ã確èªããŸããããã¯èª°ã§ãå©çšã§ããŸãã
sslbump2ã¯ãµã€ããžã®æ¥ç¶ãäœæããsslbump3ã¯ã¯ã©ã€ã¢ã³ããžã®æ¥ç¶ãäœæããŸãã
acl step1 at_step SslBump1 acl step2 at_step SslBump2 acl step3 at_step SslBump3
sslbumpã䜿çšãããšãã«ã¹ããŒãããaclãæå®ããŸã
acl sslbanksites ssl::server_name "/etc/squid/exceptions/bank.txt" acl allowsplice ssl::server_name "/etc/squid/exceptions/allowsplice.txt"
bank.txtããã³allowplice.txtã«ã¯ããã¡ã€ã³åãå ¥ããŸãã
ãã®ã«ãŒã«ã«ããããšã©ãŒã®ãã蚌ææžãåãå ¥ããããšãã§ããŸãã æå¹æéåããèªå·±çœ²åãå¥ã®ãã¹ããžã®çºè¡ãªã©ã äžèšã®ãã®ã«ãŒã«ã®aclãäœæããŸããã
sslproxy_cert_error allow allowerrorsert
splice-åŸç¶ã®ãã¹ãŠã®ã¢ã¯ã·ã§ã³ãã€ãŸã ãã®ãŸãŸã¹ãããããã³ãããªãã§ãã ããã
ããŒã¯-å®å šãªãã³ããªãã§ã¢ã¯ã»ã¹å¯èœãªæ å ±ãã®ããèŠ
çµäº-æ¥ç¶ãéããŸãã䜿çšããªãã§ãhttp_accessã§ãã£ã«ã¿ãªã³ã°ããŸã
ãã³ã-æ¥ç¶ã«ãäŸµå ¥ãããhttpsãhttpãšããŠè¡šç€ºãã
ssl_bump splice allowsplice ssl_bump splice sslbanksites ssl_bump peek step1 all ssl_bump bump step2 all ssl_bump bump step3 all
ãã¹ãŠã®äººãžã®æ¥è¿ã¢ã¯ã»ã¹ã
http_access deny all icp_access deny all htcp_access deny all
ãã®ä»ã®èšå®
cache deny all error_directory /etc/squid/errors/ forwarded_for off
é床ãèœãšãã䜿çšããé 延ããŒã«ã®æ°ã瀺ããŸãã
delay_pools 3
VIPãŠãŒã¶ãŒãé床å¶éã®ãªãéžæããããµã€ã
delay_class 1 1 delay_access 1 allow allow-speed delay_access 1 allow banksites delay_parameters 1 -1/-1 delay_access 1 deny all
æéå€-ã€ã³ã¿ãŒããããåæãããŠããŸãïŒæ倧100KB /ç§ïŒ
delay_class 2 2 delay_access 2 allow !workhours delay_parameters 2 -1/-1 10000/10000 delay_access 2 deny all
ããŠã³ããŒãå¶é-å¶éãªãã§æ倧10MBã®ãã£ã³ãã«å šäœãããŠã³ããŒãããŸãã100KB / sã®ã¿ã§ã
delay_class 3 2 delay_access 3 allow disable-speed delay_parameters 3 -1/-1 32000/10485760 delay_access 3 deny all
ãã°æ§æã§ã¯ãæåaã¯å€§ããªAã«å€æŽãããŠããŸããããã§ã¯ãïŒ 6trïŒ > Aã§ãã ããã«ãããIPã¢ãã¬ã¹ã®ä»£ããã«ãã°ã§ã³ã³ãã¥ãŒã¿ãŒåã確èªã§ããããã«ãªããŸãããã¡ããããã䟿å©ã§ãã
logformat squid %ts.%03tu %6tr %>A %Ss/%03>Hs %<st %rm %ru %[un %Sh/%<a %mt
åé¡ãçããæ©èœã«ã€ããŠã¯ããŸããããŸããã
ãããã·ãµãŒããŒã¯å¥ã®dmzã«è¡šç€ºããããã¡ã€ã¢ãŠã©ãŒã«ã¯dmzãšã®ã¢ã¯ã»ã¹ãå³ããå¶éããŠããŸãã ãªããªã Squidã¯ãäž»ã«udpã«ãã£ãŠdnsãškerberosãåžžã«ããŒãªã³ã°ãã1 ipããå¥ã®dmzã«ããADãµãŒããŒãžã®æ¥ç¶ã®èš±å®¹æ°ãããã«è¶ ããæ¥ç¶ããªã»ãããããŸããã åé¡ã¯æããã§ã¯ãªããèªèšŒãã«ããŒãã¯ã©ãã·ã¥ããã¯ã©ã€ã¢ã³ãã¯èªèšŒãŠã£ã³ããŠãåãåããŸããã
ãšã©ãŒã¯æ¬¡ã®ããã«ãªããŸãã
support_krb5.ccïŒ64ïŒïŒpid = 36139ïŒ2017/10/24 08ïŒ53ïŒ51 | kerberos_ldap_groupïŒãšã©ãŒïŒkeytabããè³æ Œæ å ±ãåæåäžã«ãšã©ãŒãçºçããŸããïŒã¬ã«ã 'DOMAIN.LOCAL'ã®KDCã«æ¥ç¶ã§ããŸãã
ãããã·ãµãŒããŒã§ãã€ã³ããäžããããšã§åé¡ã解決ãããªã¯ãšã¹ãã®æ°ãå€§å¹ ã«æžå°ããŸããã äžè¬ã«ããã¡ã€ã¢ãŠã©ãŒã«ã®å¶éãç¡å¹ã«ããããšã¯ã§ããŸããããããã¯ããã§ãããããã€ã³ãã¯æ¥ç¶ã®æ°ãå€§å¹ ã«æžããããšãã§ãããŸã è¯ãèãã§ãã
ããã«1ã€ã®ãšã©ãŒããããŸããã
support_sasl.ccïŒ276ïŒïŒpid = 8872ïŒ2017/10/24 06ïŒ26ïŒ31 | kerberos_ldap_groupïŒãšã©ãŒïŒldap_sasl_interactive_bind_sãšã©ãŒïŒããŒã«ã«ãšã©ãŒ
support_ldap.ccïŒ957ïŒïŒpid = 8872ïŒ2017/10/24 06ïŒ26ïŒ31 | kerberos_ldap_groupïŒãšã©ãŒïŒSASL / GSSAPIã䜿çšããŠLDAPãµãŒããŒã«ãã€ã³ãäžã«ãšã©ãŒãçºçããŸããïŒããŒã«ã«ãšã©ãŒ
ãã€ã³ãã§ã¯ãéãŸãŒã³ãã³ããŒããå¿ èŠããããŸãã
UPD-æãèå³æ·±ã
CPUãšIOã®è² è·ãé«ããšããåé¡ããããè² è·çã®å€§éšåã¯negotiate_kerberos ioãext_kerberos_ldap_group_aclãããŒãããŸãããnegotiate_kerberosãext_kerberos_ldap_group_aclãéå§ããããšã¯æããã§ãè² è·ã¯1æ¥ã«2å30åã§ããã
åãšã¢ã€ãã«ã®æ°ã®æ¯çãå€æŽããŠããæãŸããçµæã¯åŸãããŸããã§ããã ãããã°ããã»ã¹äžã«ãããŒã¯æã®èšå®ã§ãæ倧æ°ã®èªèšŒããã»ã¹ãéå§ãããæ確ãªç¶æ³ããããŸããã Access.logãåæãããŸãããåæã®çµæãããŒã¯è² è·æã«å€ãã®sslæ¥ç¶ããã£ãããšã匷調ãããŸãããããã«ãããåé¡ã¯èªèšŒã§ã¯ãªããssl_bumpã§ã¯å®éšã§ssl_bumpãç¡å¹ã«ãªããçµæãšããŠè² è·ãå®å šã«ãªããªã£ãããšãããããŸããäžæ¥äžã äžè¬ã«ãæ¥äžã¯ãã€ã«ãšãã®ã¢ã·ã¹ã¿ã³ãã®ä»äºã¯æºè¶³ã®ãããã®ã§ã¯ãããŸããã§ããããç¹å®ã®æéã«èšå€§ãªæ°ã®æ¥ç¶ãå ¥ããŸããã也ç¥ããæ°ïŒåäœæéïŒ5ã15åïŒããã1å°ã®ã³ã³ãã¥ãŒã¿ãŒããããã³ãã«ãŒã«ã«è©²åœããSSLæ¥ç¶ã«å¯ŸããŠ10,000ã®ãªã¯ãšã¹ããåä¿¡ãããŸããã ç¿æ¥ãå¥ã®ã³ã³ãã¥ãŒã¿ãŒã®åããã®* Whatsapp.netã
æçµçã«ãssl_bumpã¯ãªã³ã«ãªããåé¡ãªãåäœããŸãã ã¿ã€ã ã¢ãŠããŸã§ã«å°éã§ããªããã¹ããžã®ãªã¯ãšã¹ããå€æ°ããå ŽåãããŒã¯ããããŸãã ãã¥ãŒã®æžå°ã¯ãäž»ã«client1.google.comããã³clients2.google.comããããã·ããé€å€ãããããšã«ãã圱é¿ãåããŸããã
clients1.google.comããã³clients2.google.comãžã®ã¢ã¯ã»ã¹ãèš±å¯ããããæŽæ°ã¿ã¹ã¯ãç¡å¹ã«ãããããããã®ãã¹ãããããã·ããé€å€ãããã決å®ããã®ã¯ãŠãŒã¶ãŒæ¬¡ç¬¬ã§ãã
hyper-vã«é¢ããŠã¯ãäžè¬ã«ãã¹ãŠãå®å®ããŠåäœããéåžžã皌åæéã¯2ãæãè¶ ããŸãããä»®æ³ãã·ã³ãå®å šã«ããªãŒãºããæ¥ãæ¥ããããã°ãŸãã¯ãªããŒãã«ãšã©ãŒããªãããã®åŸã®ããŒãã¯ããŸããåäœç¶æ ã®èªã¿èŸŒã¿ã ãªã»ããããå¿ èŠãããããã®åŸã®ããŠã³ããŒãã¯æ£åžžã§ããããŒãããžãŒã«ã€ããŠã¯è¬çœªããŸãã ãã¹ãŠãåãã§ã2å°ã®ubuntuãµãŒããŒ16.04ä»®æ³ãã·ã³ãæå®ããããµãŒããŒäžã§å転ããŠãããäž¡æ¹ãšãodeãšåãåé¡ããããæ°æ¥éã®å·®ããããŸãã ãã®åé¡ã解決ããããã«ãsquidãdockerã«è»¢éããŸããdockerã§ã®squidã®ã»ããã¢ããã«é¢ãã次ã®èšäºãäœæããŸããå šäœçã«ã¯ãäŸåé¢ä¿å šäœãé€ããŠããã»ã©éãã¯ãããŸããã
ãã€ã³ãèšå®ïŒ
nano /etc/bind/named.conf.options
ç·šéããŠè²Œãä»ããŸãïŒ
zone "domain.local" { type slave; masters { 192.168.XX.XX; 192.168.XX.XX;}; file "bak.domain.local"; forwarders {}; zone "XX.168.192.in-addr.arpa" { type slave; masters { 192.168.XX.XX; 192.168.XX.XX;}; file "XX.168.192.in-addr.arpa.zone"; };
ãã°ã¢ãã©ã€ã¶ãŒïŒ
ã¹ã¯ã€ããã¢ãã©ã€ã¶ãŒ
â ãŠã§ããµã€ã
âæé ïŒ 1ã€ãš 2ã€
åäœããã«ã¯ãapache2ãã€ã³ã¹ããŒã«ããå¿ èŠããããŸãã
apt-get install apache2
ç§ãããã䞻匵ããªãæ¹æ³ã«ã€ããŠè©±ããŸãããªã³ã¯ã¯ããªãæ確ã§ã¢ã¯ã»ã¹å¯èœã§ãã æåã®ã¬ããŒããçæããããŸã§ãWebã¢ãã¬ã¹ã«ã¯äœã衚瀺ãããããšã©ãŒãçºçããŸãã
æåã®ã¬ããŒããçæããããšããã«ãåæãããã¬ããŒãã®ããŒãžã衚瀺ãããŸãã
ã¬ããŒãã®ããããŒãžã¯ãããªãã®äŒç€Ÿã®ããã«æ§åŒåãããããŽã眲åãèæ¯ãªã©ãå€æŽã§ããããšã«æ³šæããŠãã ããã ã¡ã€ã³æ§æã§äžéšãå€æŽããå¿ èŠããããŸãã
/etc/squidanalyzer/squidanalyzer.conf
/ usr / bin / squid-analyzerã®ãã³ãã¬ãŒãã§ããã¹ã¯ãªããã§ã¯ïŒ
/usr/local/share/perl/5.22.1/SquidAnalyzer.pm
ãã®èšäºã¯æç¶çã«æžãããå®æçã«æŽæ°ããã³èª¿æŽãããŸãããããã圹ç«ã€ããšãé¡ã£ãŠããŸãã
以äžã¯ã¯ãªãŒã³ã¢ãããããæ§æã®ãªã¹ãã§ããã³ããŒããŒã¹ãã®å¯Ÿè±¡ã§ã¯ãªãããµã³ãã«ãšããŠäœ¿çšããå¿ èŠããããŸããããã¯äœæ¥ã³ããŒãæäŸããŸãããaclã§æå®ããããã¡ã€ã«ãäœæããããããåããå¿ èŠããããŸãã
Awkã¯ãåã衚瀺ããŠã°ã«ãŒãåããã³ãã³ãã§ãããããã°ããã»ã¹ãæ¬åœã«å©ããŸããã
cat /var/log/squid/access.log | awk '{print $}' | cut -d: -f1 | sort | uniq -c | sort -n
grepãè¿œå ã§ããŸãã
squidãã°ã®æ¥ä»ãšæå»ã®åœ¢åŒãå€æããã«ã¯ã次ã䜿çšã§ããŸãã
ïŒ tlïŒ 6trïŒ > AïŒ Ss /ïŒ 03> HsïŒ <stïŒ rmïŒ ruïŒ [unïŒ Sh /ïŒ <aïŒ mt
squid.conf
acl SSL_ports port 443 acl SSL_ports port 80 acl Safe_ports port 88 acl Safe_ports port 443 acl purge method PURGE acl CONNECT method CONNECT acl blockip src "/etc/squid/ban/blockip.txt" http_access deny blockip http_reply_access deny blockip acl allnet src 192.168.XX.0/18 acl allnet src 192.168.0.0/24 acl javaapletclient src "/etc/squid/pools/javaaplet.txt" acl javaapletdomain dstdomain "/etc/squid/exceptions/javaaplet.txt" acl microsoftcrt url_regex -i "/etc/squid/exceptions/microsoftCRT.txt" http_access allow javaapletclient javaapletdomain http_access allow allnet microsoftCRT http_reply_access allow allnet microsoftCRT http_access deny allnet manual http_access allow purge localhost http_access deny purge http_access deny CONNECT !SSL_ports acl application_mime rep_mime_type "/etc/squid/ban/mime_type_application.txt" acl audio_mime rep_mime_type "/etc/squid/ban/mime_type_audio.txt" acl video_mime rep_mime_type "/etc/squid/ban/mime_type_video.txt" acl blockextention urlpath_regex -i "/etc/squid/ban/blockextention.txt" acl blockextention2 urlpath_regex -i "/etc/squid/ban/blockextention2.txt" acl allowextention urlpath_regex -i "/etc/squid/exceptions/allowextention.txt" acl others src 192.168.XX.0/20 192.168.XX.0/18 192.168.XX.0/24 acl localnet dst 192.168.0.0/24 acl workhours time 7:00-18:59 strip_query_terms off log_mime_hdrs on acl manual_reg url_regex -i "/etc/squid/ban/manual_url.txt" acl banner_reg url_regex -i "/etc/squid/ban/adv/urls" acl dating_reg url_regex -i "/etc/squid/ban/dating/urls" acl redirector_reg url_regex -i "/etc/squid/ban/redirector/urls" acl porno_reg url_regex -i "/etc/squid/ban/porn/urls" acl shopping_reg url_regex -i "/etc/squid/ban/shopping/urls" acl socialnet_reg url_regex -i "/etc/squid/ban/socialnet/urls" acl spyware_reg url_regex -i "/etc/squid/ban/spyware/urls" acl allowerrorsert dstdomain "/etc/squid/exceptions/allowerrorsert.txt" auth_param negotiate program /usr/lib/squid/negotiate_kerberos_auth -s HTTP/squid3.DOMAIN.local@DOMAIN.LOCAL auth_param negotiate children 50 startup=15 idle=15 auth_param negotiate keep_alive on external_acl_type domainusers ttl=300 negative_ttl=60 ipv4 %LOGIN /usr/lib/squid3/ext_kerberos_ldap_group_acl -a -T d09fd0bed0bbd18cd0b7d0bed0b2d0b0d182d0b5d0bbd0b820d0b4d0bed0bcd0b5d0bdd0b0 -D DOMAIN.LOCAL external_acl_type allow-all ttl=300 negative_ttl=60 ipv4 %LOGIN /usr/lib/squid3/ext_kerberos_ldap_group_acl -a -g internet-allow-all -D DOMAIN.LOCAL external_acl_type allow-speed ttl=300 negative_ttl=60 ipv4 %LOGIN /usr/lib/squid3/ext_kerberos_ldap_group_acl -a -g internet-allow-speed -D DOMAIN.LOCAL external_acl_type standart ttl=300 negative_ttl=60 ipv4 %LOGIN /usr/lib/squid3/ext_kerberos_ldap_group_acl -a -g internet-standart -D DOMAIN.LOCAL external_acl_type bankusers ttl=300 negative_ttl=60 ipv4 %LOGIN /usr/lib/squid3/ext_kerberos_ldap_group_acl -a -g internet-bank -D DOMAIN.LOCAL external_acl_type disable-speed ttl=300 negative_ttl=60 ipv4 %LOGIN /usr/lib/squid3/ext_kerberos_ldap_group_acl -a -g internet-deny-speed -D DOMAIN.LOCAL external_acl_type allowformat ttl=300 negative_ttl=60 ipv4 %LOGIN /usr/lib/squid3/ext_kerberos_ldap_group_acl -a -g internet-allowFormat -D DOMAIN.LOCAL external_acl_type denyformat ttl=300 negative_ttl=60 ipv4 %LOGIN /usr/lib/squid3/ext_kerberos_ldap_group_acl -a -g internet-denyFormat -D DOMAIN.LOCAL acl domainusers external domainusers acl allow-all external allow-all acl allow-speed external allow-speed acl standart external standart acl bankusers external bankusers acl disable-speed external disable-speed acl allowformat external allowformat acl denyformat external denyformat http_access deny blockextention denyformat http_access deny blockextention2 allowformat http_access deny localnet others http_access deny spyware http_access deny spyware_reg http_access deny porno http_access deny porno_reg http_access deny ra http_access deny proxy http_access deny other http_access deny banner http_access deny banner_reg http_access deny dating http_access deny dating_reg http_access deny redirector http_access deny redirector_reg http_access deny standart audiovideo http_access deny standart shopping http_access deny standart shopping_reg http_access deny standart socialnet http_reply_access deny denyformat application_mime http_reply_access allow allowformat application_mime http_access deny manual http_reply_access allow all http_access allow localhost http_access allow allow-all http_access allow standart http_access allow bankusers banksites http_access allow domainusers allofficesites http_access deny domainusers !allofficesites http_port 3128 ssl-bump generate-host-certificates=on dynamic_cert_mem_cache_size=100MB cert=/etc/squid/ssl/private/public.pem key=/etc/squid/ssl/private/private.pem sslcrtd_program /usr/lib/squid/ssl_crtd -s /etc/squid/ssl/ssl_db -M 100MB visible_hostname = squid3.DOMAIN.local sslcrtd_children 70 startup=5 idle=10 acl step1 at_step SslBump1 acl step2 at_step SslBump2 acl step3 at_step SslBump3 acl sslbanksites ssl::server_name "/etc/squid/exceptions/bank.txt" acl allowsplice ssl::server_name "/etc/squid/exceptions/allowsplice.txt" sslproxy_cert_error allow allowerrorsert ssl_bump splice allowsplice ssl_bump splice sslbanksites ssl_bump peek step1 all ssl_bump bump step2 all ssl_bump bump step3 all http_access deny all icp_access deny all htcp_access deny all cache deny all cache_mgr support@DOMAIN.COM dns_v4_first on negative_ttl 10 seconds hosts_file /etc/hosts error_directory /etc/squid/errors/ forwarded_for off delay_pools 3 delay_class 1 1 delay_access 1 allow allow-speed delay_access 1 allow allofficesites delay_access 1 allow allowspeeddomain delay_parameters 1 -1/-1 delay_access 1 deny all delay_class 2 2 delay_access 2 allow !allow-speed delay_access 2 allow !allowspeeddomain delay_access 2 allow !workhours delay_parameters 2 -1/-1 625000/625000 delay_access 2 deny all delay_class 3 2 delay_access 3 allow disable-speed delay_parameters 3 -1/-1 320000/10485760 delay_access 3 deny all deny_info ERR_ACCESS_DENIED_BANNERS banner banner_reg deny_info ERR_ACCESS_DENIED_DATING dating dating_reg deny_info ERR_ACCESS_DENIED_REDIRECTOR redirector redirector_reg deny_info ERR_ACCESS_DENIED_PORNO porno porno_reg deny_info ERR_ACCESS_DENIED_SOCIALNET socialnet socialnet_reg deny_info ERR_ACCESS_DENIED_SPYWARE spyware spyware_reg deny_info ERR_ACCESS_DENIED_MANUAL manual manual_reg deny_info ERR_ACCESS_DENIED_AUDIOVIDEO audiovideo deny_info ERR_ACCESS_DENIED_BLOKEXTENTION blockextention deny_info ERR_ACCESS_DENIED_BLOKEXTENTION2 blockextention2 logformat squid %ts.%03tu %6tr %>A %Ss/%03>Hs %<st %rm %ru %[un %Sh/%<a %mt