{"id":179,"date":"2020-06-20T15:36:09","date_gmt":"2020-06-20T14:36:09","guid":{"rendered":"http:\/\/www.labtinker.net\/?p=179"},"modified":"2020-06-20T15:36:09","modified_gmt":"2020-06-20T14:36:09","slug":"checkpoint-and-non-std-ssh","status":"publish","type":"post","link":"http:\/\/18.135.13.153\/?p=179","title":{"rendered":"Checkpoint and non-std SSH"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Herein is the last in the series of how firewalls can be configured to block applications running on non-standard ports, specifically ssh. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Today&#8217;s firewall vendor is the venerable Checkpoint and once more for the purposes of the lab I will reluctantly direct more moolah to Jeff Bezos&#8217; bulging coffers by selecting the appropriate device from the AWS marketplace.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Initially, I chose this&#8230;<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"602\" height=\"103\" src=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/06\/image-15.png\" alt=\"\" class=\"wp-image-180\" srcset=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/06\/image-15.png 602w, http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/06\/image-15-300x51.png 300w\" sizes=\"auto, (max-width: 602px) 100vw, 602px\" \/><figcaption>Figure 1: Checkpoint firewall- sounds good.<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">&#8230;and it took me a while to remember that Checkpoint use a manager and a gateway and you need the former to control the latter. These are usually two separate devices in the enterprise but for my purposes I&#8217;d like something that  does the job of both&#8230; and  &#8216;All-in-One&#8217; something or other below fits the bill  &#8211; why take two modules into the virtual datcentre?<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"602\" height=\"118\" src=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/06\/image-16.png\" alt=\"\" class=\"wp-image-181\" srcset=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/06\/image-16.png 602w, http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/06\/image-16-300x59.png 300w\" sizes=\"auto, (max-width: 602px) 100vw, 602px\" \/><figcaption>Figure 2: Checkpoint manager and firewall.<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Once more I used my standard topology:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"311\" height=\"415\" src=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/06\/Checkpoint-AWS-Lab.png\" alt=\"\" class=\"wp-image-182\" srcset=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/06\/Checkpoint-AWS-Lab.png 311w, http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/06\/Checkpoint-AWS-Lab-225x300.png 225w\" sizes=\"auto, (max-width: 311px) 100vw, 311px\" \/><figcaption>Figure 3: Reduce, Reuse, Recycle<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Using a browser, I connected to the gateway\/manager and installed the software taking care to specify that I wanted the unit to be both a manager and a gateway (firewall)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/06\/image-17.png\" alt=\"\" class=\"wp-image-184\" width=\"509\" height=\"217\" srcset=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/06\/image-17.png 509w, http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/06\/image-17-300x128.png 300w\" sizes=\"auto, (max-width: 509px) 100vw, 509px\" \/><figcaption>Figure 3: Gateway and Manager<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Checkpoint doesn&#8217;t use a Java client but instead a proprietary fat one which it was necessary to download from the firewall\/manager. This is used to connect to the firewall on tcp\/19009 to control policies. (The web-based GUI is for module\/gateway  specific stuff like routes and interfaces)<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"602\" height=\"91\" src=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/06\/image-18.png\" alt=\"\" class=\"wp-image-185\" srcset=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/06\/image-18.png 602w, http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/06\/image-18-300x45.png 300w\" sizes=\"auto, (max-width: 602px) 100vw, 602px\" \/><figcaption>Figure 4: That client is fat.<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">So from Gaia (the web GUI), the interaces were set up thusly:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"595\" height=\"138\" src=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/06\/image-19.png\" alt=\"\" class=\"wp-image-186\" srcset=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/06\/image-19.png 595w, http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/06\/image-19-300x70.png 300w\" sizes=\"auto, (max-width: 595px) 100vw, 595px\" \/><figcaption>Figure 5: Interfaces<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">To ease routing concerns you may recall I generally manage the firewall on its external interface (otherwise mgmt and external interfaces both route to the Internet). This is not something I&#8217;d necessarily recommend in real life and I had issues connecting with my fat client  which I couldn&#8217;t really pin down so I set up management on the internal interface from my AWS Windows box and it worked OK.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I set up the rule to allow the Windows client out to the Internet thusly:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"998\" height=\"97\" src=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/06\/image-20.png\" alt=\"\" class=\"wp-image-187\" srcset=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/06\/image-20.png 998w, http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/06\/image-20-300x29.png 300w, http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/06\/image-20-768x75.png 768w\" sizes=\"auto, (max-width: 998px) 100vw, 998px\" \/><figcaption>Figure 6: Outbound rule<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">&#8230;and the NAT as follows&#8230;<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"78\" src=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/06\/CP-Hide-NAT-1-1024x78.png\" alt=\"\" class=\"wp-image-204\" srcset=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/06\/CP-Hide-NAT-1-1024x78.png 1024w, http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/06\/CP-Hide-NAT-1-300x23.png 300w, http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/06\/CP-Hide-NAT-1-768x58.png 768w, http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/06\/CP-Hide-NAT-1.png 1026w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption>Figure 7: Hide NAT<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Now, I did a bit of messing around with this firewall (getting RDP set-up through it etc) and I don\u2019t actually remember adding this particular  NAT rule and the fact it comes under \u2018Automatic Generated Rules\u2019 is interesting&#8230; did it work it out from the access policy it needed this NAT rule (I don&#8217;t remember a talking paperclip saying &#8211; &#8216;it looks like you&#8217;re trying to get to the Internet shall I put in a hide NAT rule?&#8217;). I would go back and check my notes if I had some.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I wouldn\u2019t dwell on this as it\u2019s not the focus of the lab.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">So I browsed to this excellent website: <a href=\"http:\/\/18.135.13.153\/\">18.135.13.153\/<\/a> on (3.8.129.9) from my AWS Windows box through the firewall which confirmed everything was configured hunky-dory-ily.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"341\" height=\"113\" src=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/06\/image-22.png\" alt=\"\" class=\"wp-image-189\" srcset=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/06\/image-22.png 341w, http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/06\/image-22-300x99.png 300w\" sizes=\"auto, (max-width: 341px) 100vw, 341px\" \/><figcaption>FIgure 7: Resolving labtinker.net<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"602\" height=\"82\" src=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/06\/image-23.png\" alt=\"\" class=\"wp-image-190\" srcset=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/06\/image-23.png 602w, http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/06\/image-23-300x41.png 300w\" sizes=\"auto, (max-width: 602px) 100vw, 602px\" \/><figcaption>Figure 8: Normal browsing.<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Now,  I stood up my linux server and assigned a dns name to its ip address  of <em>linux.labtinker.ne<\/em>t and tried to ssh out to it on port 80 (as per the previous labs) and I was in like Flynn&#8230;(I&#8217;ve foregone pictorial proof save the logs below)<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"602\" height=\"65\" src=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/06\/image-24.png\" alt=\"\" class=\"wp-image-191\" srcset=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/06\/image-24.png 602w, http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/06\/image-24-300x32.png 300w\" sizes=\"auto, (max-width: 602px) 100vw, 602px\" \/><figcaption>Figure 9: SSH-ing out on port 80 with no problem.<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Whereas I&#8217;ve generally shown the process in arriving at how I blocked this behaviour, I think I&#8217;ll cut to the chase on this lab. I went down a couple of rabbit holes but essentially it came down to the following:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Checkpoint separate their &#8216;Access control&#8217; policy which deals with standard source ip address, destination ip address and service type policies and their &#8216;Threat prevention&#8217; policies .<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"203\" height=\"272\" src=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/06\/image-25.png\" alt=\"\" class=\"wp-image-192\"\/><figcaption>Figure 10: Policy options<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The Threat Prevention policy includes many types of Threat and what the security gateway&#8217;s response to said threat should be &#8211; the main ones being &#8216;detect&#8217; or &#8216;prevent&#8217; <\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/06\/Threat-prevention-1024x310.png\" alt=\"\" class=\"wp-image-195\" width=\"839\" height=\"253\" srcset=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/06\/Threat-prevention-1024x310.png 1024w, http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/06\/Threat-prevention-300x91.png 300w, http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/06\/Threat-prevention-768x233.png 768w, http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/06\/Threat-prevention.png 1181w\" sizes=\"auto, (max-width: 839px) 100vw, 839px\" \/><figcaption>Figure 11: Threat prevention policy<br><br><\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Popping &#8216;ssh&#8217; into the search bar I got these two &#8216;protections&#8217;:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/06\/image-28.png\" alt=\"\" class=\"wp-image-196\" width=\"816\" height=\"367\" srcset=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/06\/image-28.png 602w, http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/06\/image-28-300x135.png 300w\" sizes=\"auto, (max-width: 816px) 100vw, 816px\" \/><figcaption>Figure 12: SSH protections.<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">I changed the action of &#8216;SSH over Non-Standard Ports&#8217; from &#8216;Detect&#8217; to &#8216;Prevent&#8217; and&#8230; it made no difference. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I had to enable &#8216;IPS&#8217; on the &#8216;Threat Prevention&#8217; tab of the firewall object itself.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"753\" height=\"475\" src=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/06\/image-29.png\" alt=\"\" class=\"wp-image-197\" srcset=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/06\/image-29.png 753w, http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/06\/image-29-300x189.png 300w\" sizes=\"auto, (max-width: 753px) 100vw, 753px\" \/><figcaption>Figure 13: Enabling IPS On Threat Prevention tab.<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Below shows the policy accepting the ssh traffic over tcp\/80 and then rejecting it when the stars are aligned or the above actions are taken:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/06\/checkpoint-yes-no-1-1024x76.png\" alt=\"\" class=\"wp-image-200\" width=\"873\" height=\"64\" srcset=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/06\/checkpoint-yes-no-1-1024x76.png 1024w, http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/06\/checkpoint-yes-no-1-300x22.png 300w, http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/06\/checkpoint-yes-no-1-768x57.png 768w, http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/06\/checkpoint-yes-no-1.png 1207w\" sizes=\"auto, (max-width: 873px) 100vw, 873px\" \/><figcaption>Figure 14: Allow\/Disallow logs<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"585\" height=\"84\" src=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/06\/image-31.png\" alt=\"\" class=\"wp-image-201\" srcset=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/06\/image-31.png 585w, http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/06\/image-31-300x43.png 300w\" sizes=\"auto, (max-width: 585px) 100vw, 585px\" \/><figcaption>Figure 15: Linux.labtinker.net as seen in logs above.<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">As this concludes my tinkering with various firewall vendors&#8217; approach to this issue, this is my league table based on ease of implementation:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">1st Palo, 2nd Fortigate, 3rd Checkpoint, Cisco ASA dnf*<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I appreciate this doesn&#8217;t cover a lot of vendors but I thought the different approach shown by them was interesting.  In subsequent posts covering other topics I will try and take some other vendors for a spin.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">*dnf  &#8211; did not finish.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Herein is the last in the series of how firewalls can be configured to block applications running on non-standard ports, specifically ssh. Today&#8217;s firewall vendor is the venerable Checkpoint and once more for the purposes of the lab I will reluctantly direct more moolah to Jeff Bezos&#8217; bulging coffers by selecting the appropriate device from [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-179","post","type-post","status-publish","format-standard","hentry","category-firewalls"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"http:\/\/18.135.13.153\/index.php?rest_route=\/wp\/v2\/posts\/179","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/18.135.13.153\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/18.135.13.153\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/18.135.13.153\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/18.135.13.153\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=179"}],"version-history":[{"count":0,"href":"http:\/\/18.135.13.153\/index.php?rest_route=\/wp\/v2\/posts\/179\/revisions"}],"wp:attachment":[{"href":"http:\/\/18.135.13.153\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=179"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/18.135.13.153\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=179"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/18.135.13.153\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=179"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}