<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Aziz Q.</title>
    <description>The latest articles on DEV Community by Aziz Q. (@2lba).</description>
    <link>https://dev.to/2lba</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3939069%2F969b8f49-96fb-44e7-b291-d50b7cd3d3ca.jpeg</url>
      <title>DEV Community: Aziz Q.</title>
      <link>https://dev.to/2lba</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/2lba"/>
    <language>en</language>
    <item>
      <title>I built an open-source SIEM that detects attacks in real time</title>
      <dc:creator>Aziz Q.</dc:creator>
      <pubDate>Mon, 18 May 2026 23:49:57 +0000</pubDate>
      <link>https://dev.to/2lba/i-built-an-open-source-siem-that-detects-attacks-in-real-time-5dp2</link>
      <guid>https://dev.to/2lba/i-built-an-open-source-siem-that-detects-attacks-in-real-time-5dp2</guid>
      <description>&lt;p&gt;I'm a Mechanical Engineering student but I spend most of my free time on cybersecurity. After a while of just doing CTFs and reading write-ups I wanted to actually build something real.&lt;/p&gt;

&lt;p&gt;Most open-source SIEM tools are either too basic (a script that greps auth.log) or too heavy to set up without a dedicated team. I wanted something in the middle — something that looks like a real product and deploys with one command.&lt;/p&gt;

&lt;p&gt;So I built LogHunter.&lt;/p&gt;

&lt;h2&gt;
  
  
  what it does
&lt;/h2&gt;

&lt;p&gt;The platform has three parts:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Go collector&lt;/strong&gt; — sits on your servers, tails SSH and Nginx log files, parses them, and ships events in batches to the engine. The binary is about 15MB.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Python detection engine&lt;/strong&gt; (FastAPI) — runs every event through three detectors:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Brute force&lt;/strong&gt; — tracks failed logins per IP using Redis sliding windows. 5 failures in 5 minutes = alert. (MITRE T1110)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Web attacks&lt;/strong&gt; — regex matching for SQL injection, XSS, and path traversal. (MITRE T1190)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Impossible travel&lt;/strong&gt; — flags when the same user logs in from two countries within an hour. (MITRE T1078)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;React dashboard&lt;/strong&gt; — dark theme, live WebSocket feed, SVG world map with animated threat dots, host monitoring, and notification management. You add Slack/Discord/Telegram channels from the UI.&lt;/p&gt;

&lt;h2&gt;
  
  
  screenshots
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flxvpl2w0kj6grsogsaki.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flxvpl2w0kj6grsogsaki.png" alt="overview" width="800" height="448"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9xyjaj4qdnj512zgdqkr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9xyjaj4qdnj512zgdqkr.png" alt="threat map" width="800" height="448"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fropws2br5o9esfdznuv7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fropws2br5o9esfdznuv7.png" alt="notifications" width="800" height="448"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  architecture
&lt;/h2&gt;

&lt;p&gt;Collector (Go) → Engine (FastAPI) → Dashboard (React) → Postgres + Redis → Slack / Discord / Telegram&lt;/p&gt;

&lt;h2&gt;
  
  
  security
&lt;/h2&gt;

&lt;p&gt;Since it's a security tool I tried to actually do this part right:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;API key auth on event ingestion&lt;/li&gt;
&lt;li&gt;JWT + bcrypt for dashboard access&lt;/li&gt;
&lt;li&gt;rate limited login (5/min per IP)&lt;/li&gt;
&lt;li&gt;WebSocket requires valid token&lt;/li&gt;
&lt;li&gt;CORS restricted to dashboard origin&lt;/li&gt;
&lt;li&gt;engine refuses to start if secret key is still default&lt;/li&gt;
&lt;li&gt;databases not exposed outside docker network&lt;/li&gt;
&lt;li&gt;webhook secrets masked in API responses&lt;/li&gt;
&lt;li&gt;non-root containers&lt;/li&gt;
&lt;li&gt;all queries through SQLAlchemy ORM&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  try it
&lt;/h2&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git clone https://github.com/2lba/loghunter.git
cd loghunter
cp .env.example .env
# generate secrets with: openssl rand -hex 32
docker-compose up --build -d
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;There's a demo script that fills the dashboard with realistic attack data:&lt;/p&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;chmod +x demo-data.sh&lt;br&gt;
./demo-data.sh&lt;br&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
&lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
  bugs that wasted my time&lt;br&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;passlib doesn't work with bcrypt 5.x. had to switch to raw bcrypt.&lt;/li&gt;
&lt;li&gt;react-simple-maps doesn't support React 19. rewrote the map with d3-geo.&lt;/li&gt;
&lt;li&gt;FastAPI CORS middleware doesn't cover error responses. wrote custom middleware.&lt;/li&gt;
&lt;li&gt;Postgres INET columns return IPv4Address objects that Pydantic can't serialize.&lt;/li&gt;
&lt;li&gt;special characters in .env passwords break shell scripts.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  what's next
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;ML anomaly detection&lt;/li&gt;
&lt;li&gt;eBPF collector&lt;/li&gt;
&lt;li&gt;Kubernetes operator&lt;/li&gt;
&lt;li&gt;mobile alerts app&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;repo: &lt;a href="https://github.com/2lba/loghunter" rel="noopener noreferrer"&gt;github.com/2lba/loghunter&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;feedback welcome.&lt;/p&gt;

</description>
      <category>security</category>
      <category>opensource</category>
      <category>python</category>
      <category>go</category>
    </item>
  </channel>
</rss>
