{"id":142,"date":"2015-09-06T23:26:36","date_gmt":"2015-09-06T20:26:36","guid":{"rendered":"http:\/\/www1.ngtech.co.il\/wpe\/?p=142"},"modified":"2015-12-21T11:02:30","modified_gmt":"2015-12-21T09:02:30","slug":"squid-3-5-8-rpms-release","status":"publish","type":"post","link":"https:\/\/www1.ngtech.co.il\/wpe\/2015\/09\/06\/squid-3-5-8-rpms-release\/","title":{"rendered":"Squid 3.5.8 RPMs release"},"content":{"rendered":"<p>I am happy to release the new RPMs of squid 3.5.8 for Centos 6 64bit, 32bit and CentOS 7 64bit.<\/p>\n<p>The new release includes couple bug fixes and improvements.<br \/>\nThe details about the the RPMs repository are at <a href=\"http:\/\/wiki.squid-cache.org\/KnowledgeBase\/CentOS\" target=\"_blank\">squid-wiki<\/a>.<br \/>\n* couple important notes about this release in the end of the article<\/p>\n<p style=\"text-align: center;\">Do we need to protect squid?<\/p>\n<p style=\"text-align: justify;\">Squid comes also to protect other applications but the past lessons teach us that squid like any other software is vulnerable. It can act as an internal management service inside a company or an external service connecting an external network to some internal systems.<br \/>\nPlaces that use squid do not always say they do but universities is one of the users of squid around the internet. Most of them give access to some internal system using a user credentials, a single sign-on pass or other authentication methods. In all of these places there is a chance that some hacker will try to hack the proxy and use it to access these internal systems or to access the internet through it. The basics to defend a proxy service is to block clients which are using wrong authentication credentials.<br \/>\nIn most cases the basic act would be to just DROP the IP traffic in the firewall. I do not think it&#8217;s a bad way but I do think that using some iptables DNAT\\REDIRECT rule instead of DROPPING the connection\u00a0 is kind of nicer. especially if it&#8217;s a system that gives users access to work or office applications and systems.<br \/>\nFail2ban is one of the great tools to allow the proxy to defend itself(using squid access.log) from basic attacks. And of-course depends on the sensitivity of the system a DROP rule can be the right solution to mitigate the effect of some attackers.<br \/>\nIf you would choose to give the blocked user some information about his situation and who to contact about it please use a very lightweight http service that can take load and use 100% static pages for that purpose.(IE don&#8217;t use apache with PHP in it).<br \/>\nFor this action you would require a special action from fail2ban in the mangle table of iptables.<\/p>\n<p>An example fail2ban action file: &#8220;action.d\/iptables-redirect.conf&#8221;<\/p>\n<pre class=\"lang:default decode:true  \" title=\"action.d\/iptables-redirect.conf\"># Fail2Ban configuration file\r\n#\r\n# Author: Cyril Jaquier\r\n# Modified by Yaroslav Halchenko for multiport banning\r\n# Modified by Eliezer Croitoru for DNAT into a ban page\\service\r\n\r\n[INCLUDES]\r\nbefore = iptables-common.conf\r\n\r\n[Definition]\r\nactionstart = &lt;iptables&gt; -t nat -N f2b-&lt;name&gt;\r\n              &lt;iptables&gt; -t nat -A f2b-&lt;name&gt; -j &lt;returntype&gt;\r\n              &lt;iptables&gt; -t nat -I &lt;chain&gt; -p &lt;protocol&gt; -m multiport --dports &lt;port&gt; -j f2b-&lt;name&gt;\r\n\r\nactionstop = &lt;iptables&gt; -t nat -D &lt;chain&gt; -p &lt;protocol&gt; -m multiport --dports &lt;port&gt; -j f2b-&lt;name&gt;\r\n             &lt;iptables&gt; -t nat -F f2b-&lt;name&gt;\r\n             &lt;iptables&gt; -t nat -X f2b-&lt;name&gt;\r\n\r\nactioncheck = &lt;iptables&gt; -n -L &lt;chain&gt; | grep -q 'f2b-&lt;name&gt;[ \\t]'\r\n\r\nactionban = &lt;iptables&gt; -t nat -I f2b-&lt;name&gt; 1 -p &lt;protocol&gt; -s &lt;ip&gt; -j REDIRECT --to-ports 8080\r\n\r\nactionunban = &lt;iptables&gt; -t nat -D f2b-&lt;name&gt; -p &lt;protocol&gt; -s &lt;ip&gt; -j REDIRECT --to-ports 8080\r\n\r\n[Init]<\/pre>\n<p>I hope it will help others to improve their service.<\/p>\n<p>In this release I will recommend about a nice tutorial video about DDOS from Krassimir Tzvetanov, A10 Networks, Inc.<br \/>\nThis talk covers the principles and particular implementations of DDoS. It goes in detail as to what are the bottlenecks that are generally exploited\/overloaded, the attack types and the solutions to those.<\/p>\n<p>https:\/\/www.youtube.com\/watch?v=POFEMlQw6Rc<\/p>\n<p>Or a local mirror at:<br \/>\n<a href=\"http:\/\/ngtech.co.il\/squid\/videos\/POFEMlQw6Rc.mp4\" target=\"_blank\">Tutorial: Denial of Service 101<\/a><\/p>\n<p>A note: From this RPM release for the CentOS 7 RPM I have replaced the sysV init script with a systemd scripts that can monitor squid but requires a special script to make sure that systemd will not halt the system before squid was able to shutdown properly.<br \/>\nAlso the default number of open file descriptors per process is set to 16384 and if you want to change it use one of the two options that are mentioned in the systemd mailing list :<br \/>\n<a href=\"http:\/\/lists.freedesktop.org\/archives\/systemd-devel\/2015-September\/034094.html\" target=\"_blank\">solution 1, override the unit file<\/a><br \/>\n<a href=\"http:\/\/lists.freedesktop.org\/archives\/systemd-devel\/2015-September\/034095.html\" target=\"_blank\">solution 2, override the service relevant variable<\/a><br \/>\nThe upgrade into the systemd unit file will be reflected when stopping, restarting, upgrading or any other stop related usage of the unit.<\/p>\n<p>More details about the repository at <a href=\"http:\/\/wiki.squid-cache.org\/KnowledgeBase\/CentOS\" target=\"_blank\">squid-wiki<\/a>.<\/p>\n<p>All The Bests,<br \/>\nEliezer Croitoru<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I am happy to release the new RPMs of squid 3.5.8 for Centos 6 64bit, 32bit and CentOS 7 64bit. The new release includes couple bug fixes and improvements. The details about the the RPMs repository are at squid-wiki. * couple important notes about this release in the end of the article Do we need &hellip; <a href=\"https:\/\/www1.ngtech.co.il\/wpe\/2015\/09\/06\/squid-3-5-8-rpms-release\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Squid 3.5.8 RPMs release<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-142","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www1.ngtech.co.il\/wpe\/wp-json\/wp\/v2\/posts\/142","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www1.ngtech.co.il\/wpe\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www1.ngtech.co.il\/wpe\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www1.ngtech.co.il\/wpe\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www1.ngtech.co.il\/wpe\/wp-json\/wp\/v2\/comments?post=142"}],"version-history":[{"count":8,"href":"https:\/\/www1.ngtech.co.il\/wpe\/wp-json\/wp\/v2\/posts\/142\/revisions"}],"predecessor-version":[{"id":168,"href":"https:\/\/www1.ngtech.co.il\/wpe\/wp-json\/wp\/v2\/posts\/142\/revisions\/168"}],"wp:attachment":[{"href":"https:\/\/www1.ngtech.co.il\/wpe\/wp-json\/wp\/v2\/media?parent=142"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www1.ngtech.co.il\/wpe\/wp-json\/wp\/v2\/categories?post=142"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www1.ngtech.co.il\/wpe\/wp-json\/wp\/v2\/tags?post=142"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}