
因此,我在 Ubuntu 伺服器上設定了一個魷魚代理,現在想要設定我的網域的使用者定位。
用戶還需要使用代理進行身份驗證,因為它目前是開放的,我已經使用群組原則設定了代理。我希望代理程式連結到 AD,以便使用者登入並獲取特定的 acl。我見過的所有教學都是彈出訊息,要求輸入使用者名稱和密碼。我希望這種情況自動發生,以便當使用者登入時他們會自動進行身份驗證。我將如何實現這個目標?我認為 NTLM 會參與其中?然後用戶所屬的安全群組將擁有一組由魷魚強制執行的封鎖網站
先致謝
答案1
這是一個可以完成您想要的操作的範例配置:
## Active Directory Authentication
auth_param basic program /usr/lib/squid/basic_ldap_auth -R -b "dc=example,dc=com" -D [email protected] -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 [email protected] -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
這不僅僅是 Active Directory,但一般概念是這樣的:
- 為使用者定義與 Active Directory 的連線。
- 定義如何從 AD 查找組。
- 定義一個包含 AD 群組成員的 ACL(在此範例中,AD 群組稱為
InternetGeneralUsers
,Squid ACL 稱為users-general
。 users-general
定義允許 Squid ACL通過代理人的允許規則。