设为首页 收藏本站
查看: 701|回复: 0

[经验分享] Squid 3.5/WindowsAD Group

[复制链接]

尚未签到

发表于 2018-12-26 08:34:35 | 显示全部楼层 |阅读模式
  Version:
  OS: SUSE Linux Enterprise Server 12 SP2  (x86_64)
  Samba: Version 4.4.2-29.4-3709-SUSE-SLE_12-x86_64
  Winbind: Version 4.4.2-29.4-3709-SUSE-SLE_12-x86_64
  Squid:
  Squid Cache: Version 3.5.21
  Service Name: squid
  configure options:  '--host=x86_64-suse-linux-gnu' '--build=x86_64-suse-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib64' '--libexecdir=/usr/lib' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--disable-dependency-tracking' '--disable-strict-error-checking' '--sysconfdir=/etc/squid' '--libexecdir=/usr/sbin' '--datadir=/usr/share/squid' '--sharedstatedir=/var/squid' '--with-logdir=/var/log/squid' '--with-pidfile=/run/squid.pid' '--with-dl' '--enable-disk-io' '--enable-storeio' '--enable-removal-policies=heap,lru' '--enable-icmp' '--enable-delay-pools' '--enable-esi' '--enable-icap-client' '--enable-useragent-log' '--enable-referer-log' '--enable-kill-parent-hack' '--enable-arp-acl' '--enable-ssl-crtd' '--with-openssl' '--enable-forw-via-db' '--enable-cache-digests' '--enable-linux-netfilter' '--with-large-files' '--enable-underscores' '--enable-auth' '--enable-auth-basic' '--enable-auth-ntlm' '--enable-auth-negotiate' '--enable-auth-digest' '--enable-external-acl-helpers=LDAP_group,eDirectory_userip,file_userip,kerberos_ldap_group,session,unix_group,wbinfo_group' '--enable-stacktraces' '--enable-x-accelerator-vary' '--with-default-user=squid' '--disable-ident-lookups' '--enable-follow-x-forwarded-for' '--disable-arch-native' 'build_alias=x86_64-suse-linux-gnu' 'host_alias=x86_64-suse-linux-gnu' 'CFLAGS=-fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -fPIE -fPIC -DOPENSSL_LOAD_CONF' 'LDFLAGS=-Wl,--as-needed -Wl,--no-undefined -Wl,-z,relro,-z,now -pie' 'CXXFLAGS=-fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -fPIE -fPIC -DOPENSSL_LOAD_CONF' 'PKG_CONFIG_PATH=:/usr/lib64/pkgconfig:/usr/share/pkgconfig'
  

  configuration:

  •   Samba:
  [global]
  workgroup = XXXX
  passdb backend = tdbsam
  printing = cups
  printcap name = cups
  printcap cache time = 750
  cups options = raw
  map to guest = Bad User
  include = /etc/samba/dhcp.conf
  logon path = \\%L\profiles\.msprofile
  logon home = \\%L\%U\.9xprofile
  logon drive = P:
  usershare allow guests = No
  add machine script = /usr/sbin/useradd  -c Machine -d /var/lib/nobody -s /bin/false %m$
  domain logons = No
  domain master = No
  netbios name = Proxy-xxx
  security = ADS
  wins support = No
  realm = XXX.com
  template homedir = /home/%D/%U
  winbind refresh tickets = yes
  idmap config * : backend = tdb
  idmap config * : range = 1000000-1999999
  idmap config ASIA : backend = rid
  idmap config ASIA : range = 500-10000000
  winbind enum users = yes
  winbind enum groups = yes
  winbind use default domain = yes
  

  2. /etc/kr5.conf
  [libdefaults]
  default_realm = XXX.com
  clockskew = 300
  [realms]

  ASIA.MURATA.COM = {
  kdc = x1.XXX.COM
  default_domain = xxx.com
  admin_server = x1.XXX.COM
  }
  

  [logging]
  kdc = FILE:/var/log/krb5/krb5kdc.log
  admin_server = FILE:/var/log/krb5/kadmind.log
  default = SYSLOG:NOTICE:DAEMON
  [domain_realm]
  .asia.murata.com = ASIA.MURATA.COM
  [appdefaults]
  pam = {
  ticket_lifetime = 1d
  renew_lifetime = 1d
  forwardable = true
  proxiable = false
  minimum_uid = 1
  clockskew = 300
  external = sshd
  use_shmem = sshd
  }
  

  3. Squid
  #---------START OF PAN CHINA PROXY CONFIG---------
  cache_mgr xxx(mgr@xxx.com
  #---AUTHENTICATION---

  auth_param ntlm program /usr/bin/ntlm_auth --helper-protocol=squid-2.5-ntlmssp
  auth_param ntlm children 300
  #auth_param ntlm keep_alive on
  auth_param ntlm max_challenge_reuses 0
  auth_param basic program /usr/bin/ntlm_auth --helper-protocol=squid-2.5-basic
  auth_param basic children 300
  auth_param basic realm Squid proxy-caching web server
  auth_param basic credentialsttl 2 hours
  auth_param basic casesensitive off
  #authenticate_ttl 1 hour
  external_acl_type wbinfo_check %LOGIN /usr/sbin/ext_wbinfo_group_acl

  acl allowed_group external wbinfo_check XXX-InternetUsers
  http_access allow allowed_group allowedsites
  

  #---SETTING & OPTIMIZATION---
  http_port 8888
  icp_port 3130
  hosts_file /etc/hosts
  #dns_nameservers 114.114.115.115 114.114.114.114 8.8.4.4 8.8.8.8
  half_closed_clients off
  maximum_object_size 4 MB
  ipcache_size 10240
  ignore_expect_100 on
  #never_direct allow all
  #forwarded_for delete
  #via off
  cache_swap_low 90
  cache_swap_high 95
  memory_pools off
  

  4. TEST Result
  kinit user
  klist
net ads join -U admin(join domain)  wbinfo -t (confirm the result of joining domain)
  wbinfo --group-info  XXX\\domin\ users(if error , please enable ipv6, smb.conf idmap)
wbinfo -a XXX\\testuser%'password'  (test the domain user and password)  5. /usr/sbin/exe_wbinfo_group_acl
  authen windows AD group members.
  

  Squid parameter explain:
  1.max_user_ip(one user with 2 IP address will be deny in bellow settings)
  2.proxy_auth REQUIRED (AD uers no need password, others need username and password.)
  3.authenticate_ip_ttl (squid remember the user with IP address time)
  acl FOO max_user_ip 2
acl BAR proxy_auth REQUIRED
http_access deny FOO
http_access allow BAR
  2.




运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-655901-1-1.html 上篇帖子: CentOS Squid-Thinking 下篇帖子: squid logformat
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表