Yes, the default listening port for the Squid service is 3128. You can change it to something else to improve security.
Squid Listen on Uncommon Port
Open squid.conf file, enter:# vi squid.conf
Use an arbitrary port such as 10000:
http port 10000
Save and close the file. Restart squid:
# service squid restart
Verify port is open:
# netstat -tulpn | grep ':10000'
You also need to update SELinux configuration. Type the following command to add a new SELinux port mapping for the Squid service:
# semanage port -a -t http_cache_port_t -p tcp 10000
semanage is used to configure certain elements of SELinux policy without requiring modification to or recompilation from policy sources. Above command will allow Squid to listen on port 10000.
Configure Squid Authentication
You can improve squid security by configuring authentication.Squid Iptables
Edit your /etc/sysconfig/iptables file and only allow Squid access from 10.0.0.0/8 for port # 10000:-A RH-Firewall-1-INPUT -s 10.0.0.0/8 -m state --state NEW -p tcp --dport 10000 -j ACCEPTFinally, restart iptables:
# service iptables restart
No comments:
Post a Comment