Here is an example configuration that does what you want:
## Active Directory Authentication
auth_param basic program /usr/lib/squid/basic_ldap_auth -R -b "dc=example,dc=com" -D squiduser@example.com -W /etc/squid/conf.d/ldap.pass -f sAMAccountName=%s -h example.com
auth_param basic children 100 startup=5 idle=5
auth_param basic realm Windows Logon
auth_param basic credentialsttl 2 hours
## Group Membership Lookup
external_acl_type ldap_group children-max=1000 children-startup=100 children-idle=50 %LOGIN /usr/lib/squid/ext_ldap_group_acl -d -R -b "dc=example,dc=com" -D squiduser@example.com -W /etc/squid/conf.d/ldap.pass -K -f "(&(objectclass=person)(sAMAccountName=%u)(memberof=CN=%g,OU=Squid_Users,DC=example,DC=com))" -h example.com
# Defines the networks which are allowed to use the proxy
acl allowed-networks src 192.168.1.0/24
# Defines the Active Directory Groups as Squid ACLs (i.e. `InternetGeneralUsers` is a group in AD)
acl users-general external ldap_group InternetGeneralUsers
# Defines the filter ACLs
acl domains-allowed dstdomain "/etc/squid/conf.d/domains/domains-allowed"
# Actual Allow/Deny rules
http_access allow allowed-networks users-general domains-allowed
# And finally deny all other access to this proxy
http_access deny all
This is a bit more than just Active Directory but the general concept is this:
- Define connection to Active Directory for the Users.
- Define how to lookup Groups from AD.
- Define an ACL that includes members of an AD Group (in this example, the AD group is called
InternetGeneralUsers
and the Squid ACL is called users-general
.
- Define an allow rule that allow the Squid ACL
users-general
to go through the proxy.