{"id":231,"date":"2025-03-06T19:05:52","date_gmt":"2025-03-06T18:05:52","guid":{"rendered":"https:\/\/sensimedia.org\/?p=231"},"modified":"2025-03-07T08:44:20","modified_gmt":"2025-03-07T07:44:20","slug":"fail2ban-with-dell-enterprise-sonic","status":"publish","type":"post","link":"https:\/\/sensimedia.org\/?p=231","title":{"rendered":"Fail2BAN with Dell Enterprise SONiC"},"content":{"rendered":"<p><a id=\"post-231-_Hlk134107819\"><\/a> \u00a0<\/p>\n<h1>SONiC with Fail2Ban Container<\/h1>\n<p>Fail2Ban offer a security enforcement to protect against malicious attack based on port\/services identification and brute force authentication.<\/p>\n<h2>Disclaimer<\/h2>\n<p>The Fail2ban is a free software, developed and maintained by the open-source community. It falls under the terms of the GNU General Public License as published by the Free Software Foundation. DELL do not provide any support related to the Fail2ban software.<\/p>\n<h2><a id=\"post-231-_Toc136618927\"><\/a>The Goal<\/h2>\n<p>To reduce the risk of brute force attack over SSH (Secure Shell) or a REST <a id=\"post-231-_Int_iiyRw6nj\"><\/a>API, Fail2Ban can be used to protect against multiples fail authentication based on bad login\/password. Fail2ban uses iptables and a specific table to manage a dynamic filtering.<\/p>\n<h2><a id=\"post-231-_Toc136618928\"><\/a>About Fail2Ban and SONiC<\/h2>\n<p>Enterprise SONiC provides an audit file (located in <em>\/var\/log\/audit.log<\/em>) that logs all the changes and all the events with an associated flag (Warning, Failed, Success)<\/p>\n<p>Fail2ban parses log files and bans <a id=\"post-231-_Int_iVtcX89Q\"><\/a>IPs that show signs of the malicious behavior &#8212; too many password failures, seeking for exploits, etc. <a id=\"post-231-_Int_QKrriRQq\"><\/a>Generally, Fail2Ban is used to update iptables rules to reject the malicious IP addresses for a specified amount of time, although any other arbitrary action (like sending an email) could also be configured. Out of the box Fail2Ban comes with filters for various services (Apache, courier, ssh, etc).<\/p>\n<p>Fail2Ban can reduce the rate of incorrect authentications attempts, however it cannot eliminate the risk associated with weak authentication.<\/p>\n<h2><a id=\"post-231-_Toc136618929\"><\/a>About this whitepaper<\/h2>\n<p>This document describes an example of a typical and basic configuration of the fail2ban container from the Docker Hub but a lot of variation in term of rule and usage are possible. We will see how to add local rules to parse the audit log to identifying SSH login failures and ban the IP source from where the failures come. Fail2ban allows to define some variables as max failures, time to ban, delay before unban, identify recursive request and some other capabilities. If you need further configuration information, the fail2ban wiki is accessible on GitHub at <a href=\"https:\/\/github.com\/fail2ban\/fail2ban\/wiki\">https:\/\/github.com\/fail2ban\/fail2ban\/wiki<\/a>.<\/p>\n<p>The process installation was successfully test with:<\/p>\n<table>\n<tbody>\n<tr>\n<td>\n<p>Dell Enterprise SONiC<\/p>\n<\/td>\n<td>\n<p>3.5.0<\/p>\n<p>4.0.5<\/p>\n<p>4.1<\/p>\n<p>4.4.x<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2><a id=\"post-231-_Toc136618930\"><\/a>Iptables, Nftables and Enterprise SONiC<\/h2>\n<p>Entreprise SONiC 4.0.5 and later is compiled with nf_table support whereas SONiC 3.5 doesn\u2019t not have this option enabled so some differences exist between those two versions in term of filtering behavior.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1155\" height=\"107\" class=\"wp-image-432\" src=\"http:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-3-5.png\" srcset=\"https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-3-5.png 1155w, https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-3-5-300x28.png 300w, https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-3-5-1024x95.png 1024w, https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-3-5-768x71.png 768w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/p>\n<p>Nftables is a recent implementation of Linux Kernel packet classification providing more flexibility and native NAT (Network Address Translation) support as well as a Netlink API for third-party applications. For further detail on nftables check the Wikipage of the project (<a href=\"https:\/\/wiki.nftables.org\/wiki-nftables\/index.php\/What_is_nftables%3F\">What is nftables? &#8211; nftables wiki<\/a>)<\/p>\n<p><em>By default, Fail2Ban uses the legacy mode of iptables but does support nftables so depending on the SONiC Release Fail2ban rules visibility would be different :<\/em><\/p>\n<ul>\n<li>With SONiC 3.5, Fail2Ban can keep using legacy mode. Rules generated by FAil2Ban would be visible from the SONiC Linux shell by using the iptables command<\/li>\n<li>With SONiC 4.0.5 and later,\n<ul>\n<li>if Fail2Ban is left with default settings (legacy mode), rules generated won\u2019t be visible by the iptables command but by the iptables-legacy command. This would add extra complexity as all rules cannot be seen in one shell command.<\/li>\n<li>If Fail2Ban is configured with nf-table support, all rules (including the ones generated by Fail2Ban) would be visible by using nft command from the SONiC Linux shell<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>So as a best practice, with SONiC 4.0.5 and later, nftable support should be enabled within the Fail2Ban container (please refer to section 3.1 for detail process)<\/p>\n<p><em>Note:By default, SONiC CLI is unidirectional in term of synchronization with iptables\/nftable. For instance, if you create a ACL from the SONiC CLI, it would be visible from the Linux shell iptable nevertheless iptables\/nftable rules created from the Linux shell won\u2019t be visible from the SONiC CLI. So the rule generated by Fail2Ban won\u2019t be visible from the SONiC CLI. Therefore, best practice would be to use Linux shell iptables\/nftable to check and diagnose rules insertion. .<\/em><\/p>\n<h2><a id=\"post-231-_Toc136618931\"><\/a>Scenario and goal<\/h2>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1390\" height=\"731\" class=\"wp-image-434\" src=\"http:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-4-5.png\" srcset=\"https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-4-5.png 1390w, https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-4-5-300x158.png 300w, https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-4-5-1024x539.png 1024w, https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-4-5-768x404.png 768w, https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-4-5-1200x631.png 1200w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/p>\n<p>To reduce the risk of brute force attack over SSH or a REST API, Fail2Ban can be used to protect against multiples fail authentication based on bad login\/password. Fail2ban use different specific sub-tables (from the iptables\/nftable tool) to manage dynamic filtering. The container manipulates the same kernel packet\u2019s filtering tables than the SONiC host.<\/p>\n<h2><a id=\"post-231-_Toc136618932\"><\/a>Deploying the Container<\/h2>\n<p>We assume that SONiC 4.1 is already configured with an internet access over the management interface (IP + default route) and a public nameserver (DNS)<\/p>\n<p>From the sonic-cli, we use the SONiC image installation manager, called \u201cTPCM\u201d, it allows to install and manage third-party container images into the Enterprise SONiC. Please note that TPCM is available starting with SONiC 4.1 on onward. We will cover Fail2Ban installation without TPCM (for SONiC release below 4.1) in the annexe 1.<\/p>\n<p>In this document, we use the official Fail2ban container available on docker hub portal (<a href=\"https:\/\/hub.docker.com\/r\/linuxserver\/fail2ban\">https:\/\/hub.docker.com\/r\/linuxserver\/fail2ban<\/a>)<\/p>\n<h2><a id=\"post-231-_Toc136618933\"><\/a>Connection to the Enterprise SONiC switch<a id=\"post-231-_Toc134264411\"><\/a><a id=\"post-231-_Toc134264530\"><\/a><a id=\"post-231-_Toc134264788\"><\/a><\/h2>\n<p>After login at the prompt type sonic-cli to launch the CLI (Command Line)<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"672\" height=\"318\" class=\"wp-image-436\" src=\"http:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-5-5.png\" srcset=\"https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-5-5.png 672w, https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-5-5-300x142.png 300w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"667\" height=\"46\" class=\"wp-image-437\" src=\"http:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-6-5.png\" srcset=\"https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-6-5.png 667w, https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-6-5-300x21.png 300w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/p>\n<h2><a id=\"post-231-_Toc136618934\"><\/a>Installing the Fail2ban container by using TPCM commands<a id=\"post-231-_Toc134264412\"><\/a><a id=\"post-231-_Toc134264531\"><\/a><a id=\"post-231-_Toc134264789\"><\/a><\/h2>\n<p>Use the tpcm command to launch installation of the container. To get more information see the cli guide <a href=\"https:\/\/www.dell.com\/support\/manuals\/en-us\/enterprise-sonic-distribution\/mgmt-framework-cli-ref-4.1\/tpcm-install?guid=guid-7b9e0745-4581-4a7a-93fa-df683685f8de&amp;lang=en-us\">Enterprise SONiC Distribution by Dell Technologies Management Framework CLI Reference Guide Release 4.1.0 | Dell <\/a>US<\/p>\n<p>TPCM args options are the same as the docker one: they must be between quotation marks<\/p>\n<table>\n<tbody>\n<tr>\n<td>\n<p>tpcm install name fail2ban pull linuxserver\/fail2ban args \u201c-v \/var\/log:\/var\/log:ro \\ <br \/>&#8211;net=host \\ <br \/>&#8211;cap-add=NET_ADMIN \\ <br \/>&#8211;cap-add=NET_RAW \\ <br \/>-e PUID=1000\u201d<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"809\" height=\"168\" class=\"wp-image-438\" src=\"http:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-7-5.png\" srcset=\"https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-7-5.png 809w, https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-7-5-300x62.png 300w, https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-7-5-768x159.png 768w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/p>\n<p>Type \u201cexit\u201d after the container installation<\/p>\n<p>Let\u2019s check the container and the host iptables status. Note that no ACL (Access Control List) has been configured on the SONiC host<\/p>\n<p>Docker Fail2ban Status<\/p>\n<p>From the linux shell, run the following command :<\/p>\n<table>\n<tbody>\n<tr>\n<td>\n<p>sudo tpcm list<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"794\" height=\"47\" class=\"wp-image-441\" src=\"http:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-8-5.png\" srcset=\"https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-8-5.png 794w, https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-8-5-300x18.png 300w, https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-8-5-768x45.png 768w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/p>\n<p>SONiC packet filter rules<\/p>\n<table>\n<tbody>\n<tr>\n<td>\n<p>sudo iptables -S<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Result for the <strong><em>Enterprise SONiC 4.1<\/em><\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"543\" height=\"93\" class=\"wp-image-443\" src=\"http:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-9-5.png\" srcset=\"https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-9-5.png 543w, https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-9-5-300x51.png 300w\" sizes=\"auto, (max-width: 543px) 85vw, 543px\" \/><\/p>\n<p>Because Enterprise SONiC 4.1 use Nftables, we can show nftables rules with the command<\/p>\n<table>\n<tbody>\n<tr>\n<td>\n<p>sudo nft list ruleset<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1142\" height=\"483\" class=\"wp-image-444\" src=\"http:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-10-5.png\" srcset=\"https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-10-5.png 1142w, https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-10-5-300x127.png 300w, https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-10-5-1024x433.png 1024w, https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-10-5-768x325.png 768w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/p>\n<h2><a id=\"post-231-_Toc136618935\"><\/a>Configure Fail2ban<\/h2>\n<p>let\u2019s connect to the container in interactive mode to add additional filter and jail rules.<\/p>\n<table>\n<tbody>\n<tr>\n<td>\n<p>sudo tpcm exec name fail2ban<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1142\" height=\"47\" class=\"wp-image-447\" src=\"http:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-11-4.png\" srcset=\"https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-11-4.png 1142w, https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-11-4-300x12.png 300w, https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-11-4-1024x42.png 1024w, https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-11-4-768x32.png 768w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/p>\n<p>Packet filtering<\/p>\n<p>Let\u2019s first compare the kernel packet filtering tables content from the container and from the host<\/p>\n<p>Result with <strong><em>Enterprise SONiC 4.1<\/em><\/strong>, of <em>iptables -S<\/em> command <strong>from the container<\/strong>:<\/p>\n<table>\n<tbody>\n<tr>\n<td>\n<p>Iptables -S<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1140\" height=\"92\" class=\"wp-image-448\" src=\"http:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-12-5.png\" srcset=\"https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-12-5.png 1140w, https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-12-5-300x24.png 300w, https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-12-5-1024x83.png 1024w, https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-12-5-768x62.png 768w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"736\" height=\"63\" class=\"wp-image-450\" src=\"http:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-13-5.png\" srcset=\"https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-13-5.png 736w, https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-13-5-300x26.png 300w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/p>\n<p>Result with <strong><em>Enterprise SONiC 4.1<\/em><\/strong>, of <em>iptables -S<\/em> command <strong>from the host<\/strong>:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"756\" height=\"139\" class=\"wp-image-451\" src=\"http:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-14-5.png\" srcset=\"https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-14-5.png 756w, https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-14-5-300x55.png 300w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/p>\n<p>The container does not \u201csee\u201d the kernel\u2019s packet filtering table.<\/p>\n<p>Let\u2019s clarify this behavior:<\/p>\n<p>Since the Enterprise SONiC 4.0.5, iptables is compiled with the nftables support but, by default, Fail2ban container is built without nftables support. Thus, to view all the kernel packet filtering rules, nft command (from the container) must be used instead of the iptables one.<\/p>\n<p>Result with <strong><em>Enterprise SONiC 4.1<\/em><\/strong>, of <em>nft list ruleset<\/em> command from the container:<\/p>\n<table>\n<tbody>\n<tr>\n<td>\n<p>nft list ruleset<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"816\" height=\"484\" class=\"wp-image-453\" src=\"http:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-15-5.png\" srcset=\"https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-15-5.png 816w, https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-15-5-300x178.png 300w, https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-15-5-768x456.png 768w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/p>\n<p>Result with <strong><em>Enterprise SONiC 4.1<\/em><\/strong>, of <em>nft list ruleset<\/em> command from the host:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1142\" height=\"483\" class=\"wp-image-455\" src=\"http:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-16-5.png\" srcset=\"https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-16-5.png 1142w, https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-16-5-300x127.png 300w, https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-16-5-1024x433.png 1024w, https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-16-5-768x325.png 768w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/p>\n<p>The rules displayed with the nft tool (using the command nft list ruleset) are the same from both, the container and the host<\/p>\n<p>Please, note the kernel\u2019s packet filter is shared between the host and the container.<\/p>\n<h2><a id=\"post-231-_Toc136618936\"><\/a>Add support for nft in the Fail2Ban container (for Enterprise SONiC 4.0.5 and above)<\/h2>\n<p>To make Fail2Ban uses nftable, we need to add the command \u201cbanaction = nftables-multiport\u201d in jail.local config file located in the \/etc\/fail2ban directory.<\/p>\n<table>\n<tbody>\n<tr>\n<td>\n<p>vi \/etc\/fail2ban\/jail.local<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>[DEFAULT]<\/p>\n<p>banaction = nftables-multiport<\/p>\n<p>chain = input<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"941\" height=\"91\" class=\"wp-image-457\" src=\"http:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-17-5.png\" srcset=\"https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-17-5.png 941w, https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-17-5-300x29.png 300w, https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-17-5-768x74.png 768w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/p>\n<p>This change allows Fail2ban to add subset of rules in the kernel packet filter table by using the nftables tools, and allow the visibility of the rules from the host by using the nft command<\/p>\n<h2><a id=\"post-231-_Toc136618937\"><\/a>Add Fail2ban filters rule<\/h2>\n<p>In the Fail2ban container, the filter rule are located in the \/etc\/fail2ban\/filter.d\/ directory and must be named as &lt;myfiltername&gt;.local. In this example, we use the name audit-auth.local<\/p>\n<p>In this white paper, we define a <strong>\u201cfailregex\u201d<\/strong> allowing to identify source IP with multiples failed SSH attends.<\/p>\n<table>\n<tbody>\n<tr>\n<td>\n<p>vi \/etc\/fail2ban\/filter.d\/audit-auth.local<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>[INCLUDES]<\/p>\n<p>before = common.conf<\/p>\n<p>[Definition]<\/p>\n<p>failregex = ^.*Failed password for (.*)from &lt;HOST&gt;<\/p>\n<p>ignoreregex =<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1139\" height=\"197\" class=\"wp-image-459\" src=\"http:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-18-5.png\" srcset=\"https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-18-5.png 1139w, https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-18-5-300x52.png 300w, https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-18-5-1024x177.png 1024w, https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-18-5-768x133.png 768w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/p>\n<p>This regex defines the match expression that should be looked for in the \/var\/log\/audit.log file<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1141\" height=\"351\" class=\"wp-image-461\" src=\"http:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-19-5.png\" srcset=\"https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-19-5.png 1141w, https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-19-5-300x92.png 300w, https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-19-5-1024x315.png 1024w, https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-19-5-768x236.png 768w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/p>\n<h2><a id=\"post-231-_Toc136618938\"><\/a>Add Fail2ban jails rule<\/h2>\n<p>After creating the filter, we define the jail \u00b2in the \/etc\/fail2ban\/jail.d\/ directory. The jail must be named &lt;myjailname&gt;.local. In this example we use the name audit-auth.local<\/p>\n<table>\n<tbody>\n<tr>\n<td>\n<p>vi \/etc\/fail2ban\/jail.d\/audit-auth.local<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>[audit-auth]<\/p>\n<p>enabled = true<\/p>\n<p>logpath = \/var\/log\/audit.log<\/p>\n<p>maxretry = 3<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1140\" height=\"139\" class=\"wp-image-463\" src=\"http:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-20-5.png\" srcset=\"https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-20-5.png 1140w, https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-20-5-300x37.png 300w, https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-20-5-1024x125.png 1024w, https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-20-5-768x94.png 768w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/p>\n<p>The jail config file allows to parse the \/var\/log\/audit.log and block the IP after 3 connection failures<\/p>\n<h2><a id=\"post-231-_Toc136618939\"><\/a>Reload the Fail2ban:<\/h2>\n<p>From the container, we reload the jail and the filter. After the reload, fail2ban creates filter tables dynamically<\/p>\n<table>\n<tbody>\n<tr>\n<td>\n<p>fail2ban-client reload<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1141\" height=\"65\" class=\"wp-image-465\" src=\"http:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-21-5.png\" srcset=\"https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-21-5.png 1141w, https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-21-5-300x17.png 300w, https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-21-5-1024x58.png 1024w, https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-21-5-768x44.png 768w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/p>\n<p>From the \/config\/log\/fail2ban.log, we see the creation of the new jail<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1143\" height=\"228\" class=\"wp-image-467\" src=\"http:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-22-5.png\" srcset=\"https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-22-5.png 1143w, https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-22-5-300x60.png 300w, https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-22-5-1024x204.png 1024w, https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-22-5-768x153.png 768w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/p>\n<p>It is also possible to restart the fail2ban server by using the command<\/p>\n<table>\n<tbody>\n<tr>\n<td>\n<p>fail2ban-server restart<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2><a id=\"post-231-_Toc136618940\"><\/a>Test and validation<\/h2>\n<p>From the container, we display the logs located in <em>\/config\/log\/fail2ban\/fail2ban.log<\/em> and in <em>\/var\/log\/audit.log<\/em><\/p>\n<table>\n<tbody>\n<tr>\n<td>\n<p>tail -f \/var\/log\/audit\/log \/config\/log\/fail2ban\/fail2ban.log<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>From a remote host, we initiate several connections with a wrong login\/password.<\/p>\n<p>Connection test with wrong login or password<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"654\" height=\"346\" class=\"wp-image-470\" src=\"http:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-23-5.png\" srcset=\"https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-23-5.png 654w, https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-23-5-300x159.png 300w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/p>\n<p>The IP of the host, with failed authentication is identified and blacklisted. A rule is added dynamically by the container. Fail2Ban create dynamically a table named <strong>\u201cf2b-audit-auth\u201d<\/strong>, with the list of the IP banned. Fail2Ban also adds a rule in the default INPUT table to block all connection of any IP from the \u201c<strong>f2b-audit-auth\u201d<\/strong> table.<\/p>\n<p>Log from Fail2ban and audit.log<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1141\" height=\"351\" class=\"wp-image-472\" src=\"http:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-24-5.png\" srcset=\"https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-24-5.png 1141w, https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-24-5-300x92.png 300w, https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-24-5-1024x315.png 1024w, https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-24-5-768x236.png 768w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/p>\n<p>Fail2ban matches the 3 failed connections with the wrong password and retrieve the source IP to ban those IP.<\/p>\n<p>Show the added rules from the container<\/p>\n<table>\n<tbody>\n<tr>\n<td>\n<p>Iptables -S<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"678\" height=\"125\" class=\"wp-image-474\" src=\"http:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-25-5.png\" srcset=\"https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-25-5.png 678w, https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-25-5-300x55.png 300w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/p>\n<p>Or, by using the nftables tools<\/p>\n<table>\n<tbody>\n<tr>\n<td>\n<p>nft list table inet f2b-table<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"938\" height=\"197\" class=\"wp-image-476\" src=\"http:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-26-5.png\" srcset=\"https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-26-5.png 938w, https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-26-5-300x63.png 300w, https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-26-5-768x161.png 768w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/p>\n<p>If we try to connect again from the server, the connection is now rejected.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"608\" height=\"44\" class=\"wp-image-478\" src=\"http:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-27-5.png\" srcset=\"https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-27-5.png 608w, https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-27-5-300x22.png 300w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/p>\n<p>Show packet filter table from the host<\/p>\n<p>If we check the iptables from the SONiC Enterprise, the result is different between versions<\/p>\n<p>Iptables result with the <strong><em>Enterprise SONiC 4.1<\/em><\/strong> (from the host)<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"756\" height=\"139\" class=\"wp-image-479\" src=\"http:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-28-5.png\" srcset=\"https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-28-5.png 756w, https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-28-5-300x55.png 300w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/p>\n<p>When the Fail2Ban rules are added since the <strong><em>Enterprise SONiC 4.1<\/em><\/strong> we use the iptables-legacy command to see all tables and rules.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"764\" height=\"124\" class=\"wp-image-481\" src=\"http:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-29-5.png\" srcset=\"https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-29-5.png 764w, https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-29-5-300x49.png 300w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/p>\n<p>Or by using the nftables command<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"715\" height=\"197\" class=\"wp-image-482\" src=\"http:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-30-5.png\" srcset=\"https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-30-5.png 715w, https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-30-5-300x83.png 300w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/p>\n<h2><a id=\"post-231-_Toc136618176\"><\/a><a id=\"post-231-_Toc136618177\"><\/a><a id=\"post-231-_Toc136618178\"><\/a><a id=\"post-231-_Toc136618179\"><\/a><a id=\"post-231-_Toc136618180\"><\/a><a id=\"post-231-_Toc136618181\"><\/a><a id=\"post-231-_Toc136618182\"><\/a><a id=\"post-231-_Toc136618183\"><\/a><a id=\"post-231-_Toc136618184\"><\/a><a id=\"post-231-_Toc136618941\"><\/a>Conclusion<\/h2>\n<p>Fail2Ban can identify login, password, certificate failure attempts. The user can adapt the fail regex rules strategy to capture and support others authentication issues.<\/p>\n<p>Using Fail2ban as container in SONiC is a powerful and flexible tool that would improve the security of any inbound connection to the SONiC device like ssh, https, snmp, gRPC or any other TCP\/UDP based connection assuming a log file exists.<\/p>\n<h2><a id=\"post-231-_Toc136618942\"><\/a>Annexes<\/h2>\n<h2><a id=\"post-231-_Toc136618943\"><\/a>Dell Enterprise SONiC 3.5.0 and 4.0.5 install notes<\/h2>\n<p>Docker status<\/p>\n<p>To show the docker status with <strong><em>Enterprise SONiC 3.0.5<\/em><\/strong> or <strong><em>Enterprise SONiC 4.0.5<\/em><\/strong><\/p>\n<table>\n<tbody>\n<tr>\n<td>\n<p>docker ps -f name=fail2ban<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1101\" height=\"49\" class=\"wp-image-484\" src=\"http:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-31-5.png\" srcset=\"https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-31-5.png 1101w, https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-31-5-300x13.png 300w, https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-31-5-1024x46.png 1024w, https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-31-5-768x34.png 768w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/p>\n<p>Connecting to the Fail2Ban container in interactive mode<\/p>\n<p>Connection to the container with <strong><em>Enterprise SONiC 3.0.5<\/em><\/strong> or <strong><em>Enterprise SONiC 4.0.5<\/em><\/strong><\/p>\n<table>\n<tbody>\n<tr>\n<td>\n<p>sudo docker exec -it fail2ban \/bin\/bash<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"520\" height=\"47\" class=\"wp-image-487\" src=\"http:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-32-5.png\" srcset=\"https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-32-5.png 520w, https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-32-5-300x27.png 300w\" sizes=\"auto, (max-width: 520px) 85vw, 520px\" \/><\/p>\n<p>Iptables status with Enterprise SONiC 3.5.0<\/p>\n<p>Iptables status before Fail2Ban installation <img loading=\"lazy\" decoding=\"async\" width=\"718\" height=\"107\" class=\"wp-image-489\" src=\"http:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-33-5.png\" srcset=\"https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-33-5.png 718w, https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-33-5-300x45.png 300w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/p>\n<p>Iptables status <em>in the container before IP Ban<\/em><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"727\" height=\"109\" class=\"wp-image-490\" src=\"http:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-34-5.png\" srcset=\"https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-34-5.png 727w, https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-34-5-300x45.png 300w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/p>\n<p>Iptables status <em>in the container after Fail2Ban ban an IP<\/em><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"764\" height=\"171\" class=\"wp-image-493\" src=\"http:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-35-5.png\" srcset=\"https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-35-5.png 764w, https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-35-5-300x67.png 300w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/p>\n<p>Iptables status <em>from the host.<\/em> <img loading=\"lazy\" decoding=\"async\" width=\"774\" height=\"166\" class=\"wp-image-495\" src=\"http:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-36-5.png\" srcset=\"https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-36-5.png 774w, https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-36-5-300x64.png 300w, https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-36-5-768x165.png 768w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/p>\n<p>With the <strong><em>Enterprise SONiC 3.5<\/em><\/strong>, iptables result is the same from the host or the container<\/p>\n<h2><a id=\"post-231-_Toc136618944\"><\/a>Upgrade fail2ban<\/h2>\n<p>Use the tpcm command to launch installation of the container. To get more information see the cli guide <a href=\"https:\/\/www.dell.com\/support\/manuals\/en-us\/enterprise-sonic-distribution\/mgmt-framework-cli-ref-4.1\/tpcm-install?guid=guid-7b9e0745-4581-4a7a-93fa-df683685f8de&amp;lang=en-us\">Enterprise SONiC Distribution by Dell Technologies Management Framework CLI Reference Guide Release 4.1.0 | Dell <\/a>US<\/p>\n<table>\n<tbody>\n<tr>\n<td>\n<p>sudo tpcm upgrade name fail2ban pull linuxserver\/fail2ban -y<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"838\" height=\"123\" class=\"wp-image-497\" src=\"http:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-37-5.png\" srcset=\"https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-37-5.png 838w, https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-37-5-300x44.png 300w, https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-37-5-768x113.png 768w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/p>\n<h2>Install Fail2ban by using RestAPI<\/h2>\n<p>Here the request body to deploy the TPCM via REST API Command<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"534\" height=\"33\" class=\"wp-image-499\" src=\"http:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-38-5.png\" srcset=\"https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-38-5.png 534w, https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-38-5-300x19.png 300w\" sizes=\"auto, (max-width: 534px) 85vw, 534px\" \/> <img loading=\"lazy\" decoding=\"async\" width=\"679\" height=\"126\" class=\"wp-image-502\" src=\"http:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-39-5.png\" srcset=\"https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-39-5.png 679w, https:\/\/sensimedia.org\/wp-content\/uploads\/2023\/10\/word-image-231-39-5-300x56.png 300w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/p>\n<h2>Install Fail2ban by using remote_tpcm<\/h2>\n<p>For a prof of concept i develop a small python tool allowing to deploy the container remotely by using rest-api. This tools is available on <a href=\"https:\/\/github.com\/gpaquis\/SONiC_TPCM\">SONiC_TPCM (github.com)<\/a><\/p>\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u00a0 SONiC with Fail2Ban Container Fail2Ban offer a security enforcement to protect against malicious attack based on port\/services identification and brute force authentication. Disclaimer The Fail2ban is a free software, developed and maintained by the open-source community. It falls under the terms of the GNU General Public License as published by the Free Software Foundation. &hellip; <a href=\"https:\/\/sensimedia.org\/?p=231\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Fail2BAN with Dell Enterprise SONiC&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7,11],"tags":[15,21,31],"class_list":["post-231","post","type-post","status-publish","format-standard","hentry","category-open-networking","category-sonic","tag-dell","tag-networking","tag-sonic"],"_links":{"self":[{"href":"https:\/\/sensimedia.org\/index.php?rest_route=\/wp\/v2\/posts\/231","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sensimedia.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sensimedia.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sensimedia.org\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/sensimedia.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=231"}],"version-history":[{"count":3,"href":"https:\/\/sensimedia.org\/index.php?rest_route=\/wp\/v2\/posts\/231\/revisions"}],"predecessor-version":[{"id":509,"href":"https:\/\/sensimedia.org\/index.php?rest_route=\/wp\/v2\/posts\/231\/revisions\/509"}],"wp:attachment":[{"href":"https:\/\/sensimedia.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=231"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sensimedia.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=231"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sensimedia.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=231"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}