After having a bit of a re-think about the requirements, I decided another approach might be easier and allow a bit more flexibility.
The requirements changed slightly and are roughly as follows:
* Permanently ban a number of sites (blacklist.acl) ie adult sites
* Restrict certain sites during working hours (Monday to Friday) (nonwork.acl), but allow access to them during non-working hours (before work, after work, lunch, weekends etc) ie Facebook etc
* Require AD authentication
* Allow unrestricted Internet access if you belong to the InetUnrestricted AD Group
The squid.conf is below (with a few things changed for security purposes)
=======================
#Default Squid Settings
http_port 3128
cache_dir ufs /var/spool/squid 100 16 256
cache_mgr support@our_email_address.com
access_log /var/log/squid/access.log
cache_effective_group proxy
ftp_user root@proxy_name
visible_hostname proxy_name
hierarchy_stoplist cgi-bin ?
acl QUERY urlpath_regex cgi-bin \?
cache deny QUERY
acl apache rep_header Server ^Apache
broken_vary_encoding allow apache
hosts_file /etc/hosts
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern . 0 20% 4320
# NTLM
auth_param ntlm program /usr/bin/ntlm_auth --helper-protocol=squid-2.5-ntlmssp
auth_param ntlm children 10
auth_param basic program /usr/bin/ntlm_auth --helper-protocol=squid-2.5-basic
auth_param basic children 5
auth_param basic realm Domain Proxy Server
auth_param basic credentialsttl 2 hours
auth_param basic casesensitive off
authenticate_cache_garbage_interval 10 seconds
authenticate_ttl 0 seconds
acl all src 192.168.1.0/255.255.255.0
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl to_localhost dst 127.0.0.0/8
external_acl_type nt_global_group %LOGIN /usr/lib/squid/wbinfo_group.pl
acl AuthorizedUsers proxy_auth REQUIRED
acl inet_norestrictions external nt_global_group InetUnrestricted
acl blacklist dstdomain "/etc/squid/blacklist.acl"
acl nonwork dstdomain "/etc/squid/nonwork.acl"
acl SSL_ports port 443 # https
acl Safe_ports port 80 # http
acl Safe_ports port 90 # required for a particular user
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 # https
acl Safe_ports port 1025-65535 # unregistered ports
acl purge method PURGE
acl CONNECT method CONNECT
acl am_work time MTWHF 08:00-12:00
acl pm_work time MTWHF 15:00-17:00
http_access allow manager localhost
http_access deny manager
http_access allow purge localhost
http_access deny purge
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localhost
http_access allow inet_norestrictions
http_access deny blacklist
http_access deny am_work nonwork
http_access deny pm_work nonwork
http_access allow nonwork
http_access allow AuthorizedUsers
http_access deny all
http_reply_access allow all
icp_access allow all
=======================
Late night testing last night showed that it worked (of course, I had to change the times to suit the hours I was testing in), but the authentication etc worked well.
Hopefully this helps someone else.
Oh, if I've made any mistakes, feel free to let me know.
I'll be implementing this over the weekend, so I'm sure I'll be made aware if something doesn't work. ;-)
Cheers,
Dazz