squid3 + pam + centos7

yum install squid

/etc/squid/squid.conf

auth_param basic program /usr/lib64/squid/basic_pam_auth
auth_param basic children 5
auth_param basic realm proxy
auth_param basic credentialsttl 2 hours
acl password proxy_auth REQUIRED
acl localhost src 127.0.0.1/32 ::1
acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1
acl pam proxy_auth REQUIRED
acl SSL_ports port 443
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 # https

 

#acl Safe_ports port 70 # gopher
#acl Safe_ports port 210 # wais
#acl Safe_ports port 1025-65535 # unregistered ports
#acl Safe_ports port 280 # http-mgmt
#acl Safe_ports port 488 # gss-http
#acl Safe_ports port 591 # filemaker
#acl Safe_ports port 777 # multiling http

cache deny all
acl CONNECT method CONNECT
http_access allow pam
http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access deny all
http_port 10.100.200.1:3128
http_port 192.168.3.6:3128

acl migrated_hs_0_0 url_regex cgi\-bin \?
always_direct allow migrated_hs_0_0
coredump_dir /var/spool/squid3
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
refresh_pattern . 0 20% 4320
visible_hostname GTFO

Configuration of the squid PAM authentication helper>pam_auth is quite simple.It just needs a PAM service to be configured /etc/pam.d/

/etc/pam.d/squid

auth            include         password-auth
account         include         password-auth

chmod u+s /usr/lib64/squid/basic_pam_auth