คำอธิบาย Authorization ประกอบด้วย 3 ส่วน ใช้ วรรคในการแบ่ง
เช่น
acl web_bypass dstdomain "/etc/squid/web_bypass.txt"
ประกอบด้วย
acl เริ่มต้นด้วยคำสั่ง
web_bypass ตัวแปรที่จะนำไปใช้ในการ allow หรือ denied
"/etc/squid/web_bypass.txt" ค่าที่ต้องการ allow หรือ denied เก็บเป็นไฟล์ หรือใช้ค่า เลยก็ได้
ใช้ค่าเลยเช่น
acl sci_servers dstdomain .sci.com .scivalve.com .alfresco.com
คำสั่ง allow หรือ denied ประกอบด้วย 3 ส่วน ใช้วรรคเป็นตัวแบ่ง เช่น
http_access allow sci_macs
จะขึ้นต้นด้วย http_access เริ่มต้นคำสั่ง
allow จะ allow หรือ denied
sci_macs ตัวแปรที่เก็บค่าไว้ หรือ Fix ค่าไปเลยก็ได้
dstdomain คือ domain ต้องตรงกันกับค่าที่ต้องการ allow หรือ denied
url_regex -i คือ มีคำหรือข้อความนั้นใน ค่าที่ต้องการ allow หรือ denied
rep_mime_type -i mime-type คือชนิดที่ต้องการ เช่น application/x-bittorrent
ส่วนที่ 1 Authorization
- forwarded_for on
- request_header_access Allow allow all
- request_header_access Authorization allow all
- request_header_access WWW-Authenticate allow all
- request_header_access Proxy-Authorization allow all
- request_header_access Proxy-Authenticate allow all
- request_header_access Cache-Control allow all
- request_header_access Content-Encoding allow all
- request_header_access Content-Length allow all
- request_header_access Content-Type allow all
- request_header_access Date allow all
- request_header_access Expires allow all
- request_header_access Host allow all
- request_header_access If-Modified-Since allow all
- request_header_access Last-Modified allow all
- request_header_access Location allow all
- request_header_access Pragma allow all
- request_header_access Accept allow all
- request_header_access Accept-Charset allow all
- request_header_access Accept-Encoding allow all
- request_header_access Accept-Language allow all
- request_header_access Content-Language allow all
- request_header_access Mime-Version allow all
- request_header_access Retry-After allow all
- request_header_access Title allow all
- request_header_access Connection allow all
- request_header_access Proxy-Connection allow all
- request_header_access User-Agent allow all
- request_header_access Cookie allow all
- request_header_access All deny all
- ################## Start SCI ################################
- #acl sci-mac arp 90:21:55:02:6c:e2
- acl sci_macs arp "/etc/squid/MAC.lst"
- http_access allow sci_macs
- acl sci_servers dstdomain .sci.com .scivalve.com .alfresco.com
- always_direct allow sci_servers
- http_access allow sci_servers
- acl googles dstdomain .google.com
- #always_direct allow googles
- http_access allow googles
- #hotmail
- acl HM_SERVER dstdomain .msn.com .hotmail.com .passport.com .live.com .outlook.live.com .outlook.office.net .scivalve.com
- http_access allow HM_SERVER
- acl web_bypass dstdomain "/etc/squid/web_bypass.txt"
- http_access allow web_bypass
- acl GoodSites dstdomain "/etc/squid/goodsites.txt"
- #acl GoodSites url_regex -i "/etc/squid/goodsites.txt"
- http_access allow GoodSites
- acl webblocked url_regex -i '/etc/squid/webblocked.txt'
- #acl webblocked dstdomain '/etc/squid/webblocked.txt'
- http_access deny webblocked
- #deny_info denied.html webblocked
- acl TorrentFiles rep_mime_type -i mime-type application/x-bittorrent
- http_reply_access deny TorrentFiles
- deny_info TCP_RESET TorrentFiles
- auth_param basic program /usr/lib/squid/basic_ldap_auth -v 3 -b "cn=Users,dc=sci,dc=com" -D CN=ldap-user,CN=Users,DC=SCI,DC=COM -w PASSWORD -f "(&(sAMAccountName=%s)(objectClass=person)(memberof=CN=InetAllow,OU=SCI,DC=SCI,DC=COM))" -h dc04.sci.com
- acl ldap-auth proxy_auth REQUIRED
- #external_acl_type InetGroup %LOGIN /usr/lib/squid3/ext_wbinfo_group_acl
- #acl InetAccessFree external InetGroup FreeNet
- #http_access allow InetAccessFree
- acl webblocked_tmp dstdomain '/etc/squid/webblocked_tmp.txt'
- acl day_am time 08:00-11:59
- acl day_pm time 13:00-17:39
- acl day_ot time 18:00-20:59
- acl day_after time 21:00-23:59
- acl day_before time 00:00-05:59
- http_access deny webblocked_tmp day_am
- http_access deny webblocked_tmp day_pm
- http_access deny webblocked_tmp day_ot
- http_access deny webblocked_tmp day_after
- http_access deny webblocked_tmp day_before
- acl domain_blocked dstdomain '/etc/squid/webblocked_https.txt'
- http_reply_access deny domain_blocked day_am
- http_reply_access deny domain_blocked day_pm
- http_reply_access deny domain_blocked day_ot
- http_reply_access deny domain_blocked day_after
- http_reply_access deny domain_blocked day_before
- http_access deny CONNECT domain_blocked day_am
- http_access deny CONNECT domain_blocked day_pm
- http_access deny CONNECT domain_blocked day_ot
- http_access deny CONNECT domain_blocked day_after
- http_access deny CONNECT domain_blocked day_before
- http_access allow ldap-auth
- #SCI End
ส่วนที่ 2 localnet และ ports
- #Start SCI
- acl localnet src 192.168.0.0/24 192.168.100.0/24 192.168.2.0/24
- acl SSL_ports port 995 #mail.scivalve.com new
- acl SSL_ports port 8443 #scivalve.com new
- acl SSL_ports port 443
- acl SSL_ports port 993
- acl SSL_ports port 2222 # SCI: for hosting
- acl SSL_ports port 6301 # gpsiam
- acl Safe_ports port 80 # http
- acl Safe_ports port 110 # SCI: POP3
- acl Safe_ports port 587 # SCI: smtp
- acl Safe_ports port 25 # SCI: smtp
- #End SCI
ส่วนที่ 3 Log Server
- #SCI Start Sent Log Squid To Log Server
- #Sent To access.log file.
- access_log /var/log/squid/access.log squid
- #Sent To Log Server.
- logformat squid %tl %6tr %>a %Ss/%03Hs %<st %rm %ru %un %Sh/%<A %mt
- access_log tcp:192.168.2.108:514 squid
- #SCI End





