Tuesday, July 28, 2015

Squid Conf with Web filter

#
# Recommended minimum configuration:
#
acl manager proto cache_object
acl localhost src 127.0.0.1/32 ::1
acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1

# Example rule allowing access from your local networks.
# Adapt to list your (internal) IP networks from where browsing
# should be allowed
#acl localnet src 80.0.0.0/24 # RFC1918 possible internal network
acl localnet src 10.0.0.0/8 # RFC1918 possible internal network
acl localnet src 172.16.0.0/12 # RFC1918 possible internal network
acl localnet src 192.168.0.0/16 # RFC1918 possible internal network
acl localnet src fc00::/7       # RFC 4193 local private network range
acl localnet src fe80::/10      # RFC 4291 link-local (directly plugged) machines

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 CONNECT method CONNECT
acl internet1 arp 30:85:a9:af:6b:42
acl internet2 arp e0:cb:4e:d4:49:7b
acl tinku arp fc:aa:14:ee:15:5e
acl lapaccnt10 arp 00:71:cc:6b:bf:19
#acl ebby arp 00:1b:77:3c:99:c0
acl ebby1 arp d8:5d:e2:42:2c:67
acl jm arp 28:d2:44:aa:c2:32
acl reju  arp 74:de:2b:a9:45:d8
#acl reju  arp 00:21:6b:1b:3f:be
acl despatch arp 00:17:c4:45:c8:d1
acl pv arp d0:df:9a:53:ec:e9
acl manoj_FC arp 24:fd:52:cf:cc:3c
acl malini arp 28:c6:8e:fc:0e:a5
acl bfv arp 00:13:02:c0:ec:d1
acl neethu arp 24:ec:99:22:5d:fd
acl uk arp 14:da:e9:dd:45:b9
acl jk arp b4:74:9f:5a:b9:19
acl fenn arp c8:0a:a9:a9:98:4e
acl divya arp 00:22:5f:6d:8d:1c
acl anju arp 00:21:6b:1b:3f:be
acl kannan arp 30:3a:64:e8:f0:5d
acl letha arp 08:60:6e:6a:29:1a
acl fareed arp A0:2B:B8:24:89:87
acl sujith arp 00:21:70:89:5c:10
#acl shaji arp 00:21:00:d5:0e:d2
#acl rajan arp 00:16:17:1a:dc:e9

acl his_site url_regex midas.co.in
acl his_site1 url_regex comtax.kerala.gov.in
acl his_site2 url_regex esewa.epfoservices.in
acl his_site3 url_regex epfindia.com
acl his_site4 url_regex aces.gov.in
acl his_site5 url_regex esic.in

#
# Recommended minimum Access Permission configuration:
#
# Only allow cachemgr access from localhost
http_access allow manager localhost
http_access deny manager

# Deny requests to certain unsafe ports

http_access allow his_site
http_access allow his_site1
http_access allow his_site2
http_access allow his_site3
http_access allow his_site4
http_access allow his_site5

http_access allow internet1
http_access allow internet2
http_access allow lapaccnt10
http_access allow tinku
#http_access allow ebby
http_access allow ebby1
http_access allow jm
http_access allow reju
http_access allow despatch
http_access allow pv
http_access allow manoj_FC
http_access allow malini
http_access allow bfv
http_access allow neethu
http_access allow uk
http_access allow jk
http_access allow fenn
http_access allow divya
http_access allow anju
http_access allow kannan
http_access allow letha
http_access allow fareed
http_access allow sujith
#http_access allow shaji
#http_access allow rajan

# Deny CONNECT to other than secure SSL ports
http_access deny !Safe_ports

# We strongly recommend the following be uncommented to protect innocent
# web applications running on the proxy server who think the only
# one who can access services on "localhost" is a local user
#http_access deny to_localhost

#
# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
#

# Example rule allowing access from your local networks.
# Adapt localnet in the ACL section to list your (internal) IP networks
# from where browsing should be allowed
http_access deny CONNECT !SSL_ports
#http_access allow localnet
http_access allow localhost

# And finally deny all other access to this proxy
http_access deny all

# Squid normally listens to port 3128
http_port 3128

# Uncomment and adjust the following to add a disk cache directory.
#cache_dir ufs /var/spool/squid 100 16 256

# Leave coredumps in the first cache dir
coredump_dir /var/spool/squid

# Add any of your own refresh_pattern entries above these.
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
cache_effective_user squid
cache_effective_group squid

No comments:

Post a Comment