<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>F2B on Blips and Blinks</title>
    <link>https://notes.vyrtsev.com/</link>
    <description>Notes by Misha Vyrtsev, tagged F2B</description>
    <language>en-us</language>
    <lastBuildDate>Tue, 01 Dec 2026 04:30:00 +0400</lastBuildDate>
    <atom:link href="https://notes.vyrtsev.com/rss.xml?tags=f2b" rel="self" type="application/rss+xml" />
    <item>
      <title>f2b, fail2ban with a web interface and an API</title>
      <link>https://notes.vyrtsev.com/posts/f2b/</link>
      <guid>https://notes.vyrtsev.com/posts/f2b/</guid>
      <pubDate>Sun, 29 Nov 2026 05:00:00 +0400</pubDate>
      <category>F2B</category>
      <category>Development</category>
      <category>Self-Hosted</category>
      <description>fail2ban in Docker with a web interface and an API. Jails and filters are edited in the browser, a filter is tried on a log before it&amp;rsquo;s saved, and the bans show who, where and why.</description>
      <content:encoded>&lt;p&gt;&lt;a href=&#34;https://apps.vyrtsev.com/f2b&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;f2b&lt;/a&gt; is fail2ban with a web interface and an API. Until now fail2ban on my servers was a folder of jail and filter files for each of them, with a docker-compose file and a script to deploy it. In f2b the jails, filters and actions are still files, but they&amp;rsquo;re edited in the browser, in an editor that knows fail2ban&amp;rsquo;s syntax. A save fail2ban would refuse is refused, in fail2ban&amp;rsquo;s own words, and nothing is written. One it accepts is written, and fail2ban reloads, keeping its bans.&lt;/p&gt;&#xA;&lt;p&gt;A filter can be tried on a log before it&amp;rsquo;s saved. fail2ban-regex runs over the end of a log a jail reads, any other log on the server, rotated &lt;code&gt;.gz&lt;/code&gt; ones too, or lines pasted in, and marks each line matched, missed or ignored, again with every change to the filter. A line from the log can start a failregex: its date and address are taken out, and the rest is escaped.&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Who is banned now, where, since when and until when, and the log lines that did it. A ban can be lifted, and an address or a range banned by hand&lt;/li&gt;&#xA;&lt;li&gt;The history: bans per day by jail, the most banned addresses, and every ban fail2ban&amp;rsquo;s database holds&lt;/li&gt;&#xA;&lt;li&gt;fail2ban&amp;rsquo;s own filters and actions, to read and to override in one press&lt;/li&gt;&#xA;&lt;li&gt;fail2ban&amp;rsquo;s log, following along&lt;/li&gt;&#xA;&lt;li&gt;One password, from the environment, and every wrong one is a line for fail2ban to read&lt;/li&gt;&#xA;&lt;li&gt;API tokens for scripts and agents, read-only or read and write, for a JSON:API described by an OpenAPI document. A link to paste into an agent opens a brief on the API, with a token that works for thirty minutes&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Like &lt;a href=&#34;https://apps.vyrtsev.com/mailio&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;mailio&lt;/a&gt;, &lt;a href=&#34;https://apps.vyrtsev.com/emguio&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;emguio&lt;/a&gt; and &lt;a href=&#34;https://apps.vyrtsev.com/taskio&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;taskio&lt;/a&gt;, it runs in Docker, as two containers sharing a volume. The engine, fail2ban with the API, runs in the host&amp;rsquo;s network, because fail2ban writes the host&amp;rsquo;s firewall. The interface runs behind your reverse proxy and talks to the engine over a socket on the volume.&lt;/p&gt;&#xA;&lt;p&gt;The code and docs are on &lt;a href=&#34;https://github.com/reeywhaar/f2b&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;GitHub&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;div class=&#34;gallery&#34;&gt;&#xA;    &lt;img src=&#34;https://notes.vyrtsev.com/posts/f2b/screens/1-overview_hu_f2a4b7f057f4a5d7.webp?v=b4dda310&#34; alt=&#34;The overview: fail2ban&amp;#39;s state, the bans per day by jail, and each jail with what it reads&#34; width=&#34;1252&#34; height=&#34;880&#34; loading=&#34;lazy&#34;&gt;&#xA;    &lt;span class=&#34;gallery-end&#34; aria-hidden=&#34;true&#34;&gt;&lt;/span&gt;&#xA;    &lt;img src=&#34;https://notes.vyrtsev.com/posts/f2b/screens/2-bans_hu_e179795f5cc3e55a.webp?v=456ada11&#34; alt=&#34;The bans in force, with how often each address has been banned before and the lines that did it&#34; width=&#34;1252&#34; height=&#34;880&#34; loading=&#34;lazy&#34;&gt;&#xA;    &lt;span class=&#34;gallery-end&#34; aria-hidden=&#34;true&#34;&gt;&lt;/span&gt;&#xA;    &lt;img src=&#34;https://notes.vyrtsev.com/posts/f2b/screens/3-filter_hu_5736c54325f5947e.webp?v=1a8631d3&#34; alt=&#34;A filter in the editor, tried on its jail&amp;#39;s log as it is typed, every line marked with what fail2ban-regex made of it&#34; width=&#34;828&#34; height=&#34;880&#34; loading=&#34;lazy&#34;&gt;&#xA;    &lt;span class=&#34;gallery-end&#34; aria-hidden=&#34;true&#34;&gt;&lt;/span&gt;&#xA;    &lt;img src=&#34;https://notes.vyrtsev.com/posts/f2b/screens/4-lines_hu_8423624e74cd2781.webp?v=3978dc22&#34; alt=&#34;Picking the lines to try: a log a jail reads, any other in the log directories, or lines pasted&#34; width=&#34;1136&#34; height=&#34;880&#34; loading=&#34;lazy&#34;&gt;&#xA;    &lt;span class=&#34;gallery-end&#34; aria-hidden=&#34;true&#34;&gt;&lt;/span&gt;&#xA;    &lt;img src=&#34;https://notes.vyrtsev.com/posts/f2b/screens/5-history_hu_3bb5024d798f1954.webp?v=2c698122&#34; alt=&#34;The history: every ban fail2ban&amp;#39;s database holds&#34; width=&#34;1252&#34; height=&#34;880&#34; loading=&#34;lazy&#34;&gt;&#xA;    &lt;span class=&#34;gallery-end&#34; aria-hidden=&#34;true&#34;&gt;&lt;/span&gt;&#xA;    &lt;img src=&#34;https://notes.vyrtsev.com/posts/f2b/screens/6-config_hu_19cd0ad91dc874d5.webp?v=f618e6c9&#34; alt=&#34;Config: the jails, filters and actions, each a file laid over fail2ban&amp;#39;s own configuration&#34; width=&#34;1252&#34; height=&#34;880&#34; loading=&#34;lazy&#34;&gt;&#xA;    &lt;span class=&#34;gallery-end&#34; aria-hidden=&#34;true&#34;&gt;&lt;/span&gt;&#xA;    &lt;img src=&#34;https://notes.vyrtsev.com/posts/f2b/screens/7-log_hu_36bf13809a975e4b.webp?v=3cdfad9e&#34; alt=&#34;fail2ban&amp;#39;s log, following along&#34; width=&#34;1408&#34; height=&#34;880&#34; loading=&#34;lazy&#34;&gt;&#xA;    &lt;span class=&#34;gallery-end&#34; aria-hidden=&#34;true&#34;&gt;&lt;/span&gt;&#xA;    &lt;img src=&#34;https://notes.vyrtsev.com/posts/f2b/screens/8-phone_hu_ee880c3fedfa4653.webp?v=96d05525&#34; alt=&#34;The overview on a phone&#34; width=&#34;407&#34; height=&#34;880&#34; loading=&#34;lazy&#34;&gt;&#xA;    &lt;span class=&#34;gallery-end&#34; aria-hidden=&#34;true&#34;&gt;&lt;/span&gt;&#xA;&lt;/div&gt;&#xA;&#xA;</content:encoded>
    </item>
  </channel>
</rss>
