Squid プロキシ自動認証

Squid プロキシ自動認証

Ubuntu サーバーに Squid プロキシをセットアップし、自分のドメインでユーザー ターゲティングをセットアップしたいと考えています。AD 内のセキュリティ グループに ACL を設定できるようにしたいのですが、これは可能ですか? また、どのように設定すればよいですか?

ユーザーは、現在広く開かれているプロキシで認証する必要もあります。グループ ポリシーを使用してプロキシを設定しました。プロキシを AD にリンクして、ユーザーがログインして特定の ACL を取得できるようにしたいと考えています。私が見たチュートリアルはすべて、ユーザー名とパスワードを求めるポップアップ メッセージでした。ユーザーがログインすると自動的に認証されるように、これを自動的に実行したいと思います。どうすればこれを実現できますか? NTLM がこれに関与すると考えていました。そして、ユーザーが属するセキュリティ グループには、Squid が強制するブロックされた Web サイトのセットがあります。

前もって感謝します

答え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 以上のものですが、一般的な概念は次のとおりです。

  1. ユーザーの Active Directory への接続を定義します。
  2. AD からグループを検索する方法を定義します。
  3. AD グループのメンバーを含む ACL を定義します (この例では、AD グループは と呼ばれInternetGeneralUsers、Squid ACL は と呼ばれますusers-general)。
  4. Squid ACL がusers-generalプロキシを通過できるようにする許可ルールを定義します。

関連情報