将多个活动目录组与Squid访问列表集成

时间:2013-11-05 20:29:24

标签: proxy active-directory ldap squid whitelist

所以我有多个活动目录组,我正在尝试集成到squid中。我已对

中的网址列表进行了分类
  

“的/ etc /鱿鱼/黑名单/”

当我将用户添加到特定组时,我希望squid允许该用户浏览该列表中的任何网站。每个用户都将成为多个组的成员,具体取决于角色。目前我所拥有的将允许用户浏览网站,只要只有一个组的成员,但如果我将用户添加到两个组,那么他们看不到任何东西!总共我有大约50个我想要实现的类别。以下是我目前在squid.conf文件中列出的内容。

#
# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
#
# AD communication #
auth_param basic program /usr/lib64/squid/squid_ldap_auth -R -b "DC=domain,DC=local" -D "CN=SQUID,OU=domain Service Accounts,DC=domain,DC=local" -w "*********" -f sAMAccountName=%s -h 10.0.0.***,10.0.0.***,10.0.0.***
auth_param basic children 5
auth_param basic realm Please enter your domain credentials to continue
auth_param basic credentialsttl 1 hour

# AD group membership commands
external_acl_type ldap_group %LOGIN /usr/lib64/squid/squid_ldap_group -R -b "DC=domain,DC=local" -D "CN=SQUID,OU=domain Service Accounts,DC=domain,DC=local" -w "*********" -f "(&(objectclass=person) (sAMAccountname=%v)(memberof=CN=%a,OU=PROXY,ou=ALL domain Groups,DC=domain,DC=local))" -h 10.0.0.***,10.0.0.***,10.0.0.***

acl NEWS external ldap_group NEWS
acl SHOPPING external ldap_group SHOPPING


acl rule1 url_regex -i "/etc/squid/blacklists/news/domains"
acl rule2 url_regex -i "/etc/squid/blacklists/shopping/domains"

http_access deny NEWS !rule1
http_access deny SHOPPING !rule2
http_access allow all

1 个答案:

答案 0 :(得分:0)

Squid在第一场比赛中停止处理规则。如果您向两个群组添加一个帐户,那么它始终会与“拒绝”群组中的某个群组相匹配。用户尝试从其中一个类别访问网站时的ACL。

相反,您可以使用'允许'规则:

http_access allow NEWS rule1
http_access allow SHOPPING rule2
http_access deny all

在这种情况下,所有匹配的都被允许,所有不匹配的都被拒绝。

为了使其更具可读性,您可以重命名acls:

http_access allow group-NEWS url_regex-news
http_access allow group-SHOPPING url_regex-shopping
http_access deny all