<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Mudassir on Medium]]></title>
        <description><![CDATA[Stories by Mudassir on Medium]]></description>
        <link>https://medium.com/@mudassirrana140?source=rss-28a64f83cb6d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ScteHe-9vQl1zGEWtMAYOQ.jpeg</url>
            <title>Stories by Mudassir on Medium</title>
            <link>https://medium.com/@mudassirrana140?source=rss-28a64f83cb6d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 13:09:43 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mudassirrana140/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[I Built a SOC From Scratch - Here’s Exactly How I Did It]]></title>
            <link>https://medium.com/@mudassirrana140/i-built-a-soc-from-scratch-heres-exactly-how-i-did-it-4b09eceb2910?source=rss-28a64f83cb6d------2</link>
            <guid isPermaLink="false">https://medium.com/p/4b09eceb2910</guid>
            <category><![CDATA[siem]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[splunk]]></category>
            <category><![CDATA[blue-team]]></category>
            <category><![CDATA[gcp-security-operations]]></category>
            <dc:creator><![CDATA[Mudassir]]></dc:creator>
            <pubDate>Thu, 22 Oct 2026 10:52:39 GMT</pubDate>
            <atom:updated>2026-10-22T10:52:39.953Z</atom:updated>
            <content:encoded><![CDATA[<h3>From raw log ingestion to threat intel automation, correlation rules, and a live security dashboard - a complete walkthrough of my Splunk home lab</h3><p>When most people say they’re “learning cybersecurity,” they mean they’re doing CTF challenges or watching YouTube videos. I respect that. But I wanted something different - I wanted to know what a Security Operations Center actually feels like from the inside.</p><p>So I built one. On my home network. From scratch.</p><p>This post is a complete walkthrough of how I went from zero to a working SOC pipeline: threat simulation, log engineering, custom SPL detection rules, automated threat intelligence, and a live monitoring dashboard - all on Splunk Enterprise’s free tier.</p><p>If you’re a blue team hopeful, a SOC analyst sharpening your skills, or just someone who wants to understand how detection engineering actually works, this is for you.</p><h3>The Setup</h3><p>Before we talk about what I built, here’s the environment:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/628/1*VFShcix5yJMlERa10sCJEQ.png" /></figure><p>The core constraint I imposed on myself: <strong>build it the way enterprise SOC teams actually build it.</strong> That means:</p><ul><li>Simulate the attack first</li><li>Search the raw logs</li><li>Perfect the SPL query</li><li>Save it as an alert with proper suppression</li><li>Map it to MITRE ATT&amp;CK</li></ul><p>I called this the <strong>“Detection Engineering Lifecycle”</strong> — simulate, search, perfect, alert.</p><h3>Phase 1: Infrastructure - Getting Logs Into Splunk</h3><p>The first real engineering challenge wasn’t writing detections. It was getting clean, organized data into Splunk.</p><p>I made a critical early decision: <strong>dedicated indexes for each log type.</strong> Instead of dumping everything into main, I created:</p><ul><li>linux-auth for SSH logs and authentication events</li><li>linux-syslog for general system events</li><li>linux-kernel for kernel-level logs</li><li>linux-package for package installation events</li></ul><p>This seems small, but it changed everything. Searching index=linux_auth instead of index=main sourcetype=linux_secure is faster, cleaner, and prevents cross-contamination between log sources. It&#39;s also exactly how production Splunk deployments are structured.</p><p>On Kali Linux, I configured the Universal Forwarder (inputs.conf) to tail the right log files and ship them to my Windows Splunk instance on port 9997. I also enabled auditd and configured custom audit rules to capture privilege escalation attempts and system calls - things that don&#39;t show up in standard syslog.</p><h3>Phase 2: The Detections - Eight Alerts, Real Attacks</h3><p>This is where it gets interesting. I didn’t download a detection pack. I simulated each attack myself, watched the raw logs land in Splunk, and wrote the SPL by hand.</p><p>Here’s every detection I built, how I simulated it, and the core SPL logic.</p><h3>1. SSH Brute Force Detection</h3><p><strong>MITRE Technique:</strong> T1110.001 - Brute Force: Password Guessing</p><p>SPl</p><pre>index=linux_auth sourcetype=linux_secure &quot;Failed password&quot;<br>| rex field=_raw &quot;Failed password for (?:invalid user )?(?P&lt;username&gt;\S+) from (?P&lt;src_ip&gt;\d+\.\d+\.\d+\.\d+)&quot;<br>| stats count by src_ip, username<br>| where count &gt; 10<br>| sort -count</pre><p><strong>Key lesson:</strong> My alert initially failed to trigger because I had it searching index=main instead of index=linux_auth. This is the most common mistake beginners make - always verify your index before saving an alert.</p><p>I configured the alert with a 60-minute suppression window. Without throttling, you get a new alert every 5 minutes during an active brute force and alert fatigue sets in fast.</p><h3>2. Privilege Escalation Detection</h3><p><strong>MITRE Technique:</strong> T1548.003 - Abuse Elevation Control Mechanism: Sudo</p><p><strong>SPL:</strong></p><pre>index=linux_audit type=USER_AUTH OR type=USER_ROLE_CHANGE<br>| rex field=_raw &quot;uid=(?P&lt;uid&gt;\d+).*exe=\&quot;(?P&lt;command&gt;[^\&quot;]+)\&quot;&quot;<br>| search command=&quot;/usr/bin/sudo&quot; OR command=&quot;/bin/su&quot;<br>| stats count by uid, command, _time<br>| where count &gt; 2</pre><p><strong>What made this tricky:</strong> Standard auth.log doesn&#39;t capture sudo attempts the way auditd does. I had to add a custom audit rule: auditctl -w /usr/bin/sudo -p x -k privilege_escalation to get rich event data including the calling UID and the binary invoked.</p><h3>3. New User Account Creation</h3><p><strong>MITRE Technique:</strong> T1136.001 - Create Account: Local Account</p><p><strong>SPL:</strong></p><pre>index=linux_audit type=ADD_USER<br>| rex field=_raw &quot;acct=\&quot;(?P&lt;new_user&gt;[^\&quot;]+)\&quot;&quot;<br>| table _time, new_user, host<br>| sort -_time</pre><p>This is a high-fidelity detection — new user creation on a Linux system is almost always worth investigating. The alert fires once per event with no suppression needed.</p><h3>4. Reverse Shell Detection</h3><p><strong>MITRE Technique:</strong> T1059.004 — Command and Scripting Interpreter: Unix Shell</p><p>SPl</p><pre>index=linux_audit<br>| rex field=_raw &quot;exe=\&quot;(?P&lt;exe&gt;[^\&quot;]+)\&quot;.*a0=\&quot;(?P&lt;a0&gt;[^\&quot;]+)\&quot;.*a1=\&quot;(?P&lt;a1&gt;[^\&quot;]+)\&quot;&quot;<br>| search (exe=&quot;/bin/bash&quot; AND a1=&quot;/dev/tcp*&quot;) OR (exe=&quot;/usr/bin/nc&quot;) OR (exe=&quot;/usr/bin/ncat&quot;)<br>| table _time, exe, a0, a1, host</pre><p><strong>Why this matters:</strong> Reverse shells are the attacker’s foothold. Detecting outbound bash connections to /dev/tcp is a high-confidence indicator of compromise. This alert has near-zero false positive rate in a controlled environment.</p><h3>5. Port Scan + Brute Force Correlation Rule</h3><p>This was the most technically interesting detection I built — a <strong>correlation rule</strong> that only fires when the same IP does <em>both</em> a port scan <em>and</em> an SSH brute force within a 30-minute window.</p><p><strong>MITRE Techniques:</strong> T1046 (Network Service Discovery) + T1110.001 (Brute Force)</p><p><strong>SPL:</strong></p><p>index=linux_auth OR index=linux_syslog<br>| eval attack_type=case(<br> match(_raw, &quot;Failed password&quot;), &quot;brute_force&quot;,<br> match(_raw, &quot;nmap&quot;) OR match(_raw, &quot;Nmap&quot;), &quot;port_scan&quot;<br> )<br>| where isnotnull(attack_type)<br>| rex field=_raw &quot;from (?P&lt;src_ip&gt;\d+\.\d+\.\d+\.\d+)&quot;<br>| bucket _time span=30m<br>| stats dc(attack_type) as distinct_attacks, values(attack_type) as attack_types by src_ip, _time<br>| where distinct_attacks &gt;= 2<br>| sort -_time</p><p><strong>What this detects:</strong> Not just isolated events, but a coordinated multi-stage attack pattern. An attacker who scans first and then brute forces is exhibiting <em>reconnaissance followed by exploitation</em> — a meaningful threat signal that neither detection alone would capture.</p><h3>6. Threat Intelligence IP Enrichment</h3><p>This one took the most infrastructure work. I wanted to automatically pull threat intel feeds, cross-reference them against my logs, and enrich attacker IPs with their known threat status.</p><p><strong>The pipeline:</strong></p><ol><li>A PowerShell script (C:\splunk_threat_intel.ps1) fetches the CINS Army bad IP list daily</li><li>It formats the output into a CSV (known_bad_ips.csv) stored in Splunk&#39;s lookups directory</li><li>A Windows scheduled task runs the script at 02:00 AM with SYSTEM privileges</li><li>An SPL lookup enriches attacker IPs in real time</li></ol><p><strong>PowerShell snippet:</strong></p><p>powershell</p><pre>$url = &quot;http://cinsscore.com/list/ci-badguys.txt&quot;<br>$ips = Invoke-WebRequest -Uri $url | Select-Object -ExpandProperty Content<br>$lines = $ips -split &quot;`n&quot; | Where-Object { $_ -match &quot;^\d&quot; }<br>$output = &quot;ip,threat_status`n&quot; + ($lines | ForEach-Object { &quot;$_,malicious&quot; } | Join-String -Separator &quot;`n&quot;)<br>$output | Out-File &quot;C:\Program Files\Splunk\etc\apps\search\lookups\known_bad_ips.csv&quot;</pre><p><strong>SPL Enrichment Query:</strong></p><p>spl</p><pre>index=linux_auth &quot;Failed password&quot;<br>| rex field=_raw &quot;from (?P&lt;src_ip&gt;\d+\.\d+\.\d+\.\d+)&quot;<br>| lookup known_bad_ips.csv ip AS src_ip OUTPUT threat_status<br>| eval threat_label=case(<br>    threat_status=&quot;malicious&quot;, &quot;KNOWN THREAT&quot;,<br>    src_ip=&quot;192.168.56.101&quot;, &quot;Lab Attacker (Kali)&quot;,<br>    isnotnull(src_ip), &quot;Unknown&quot;<br>  )<br>| stats count by src_ip, threat_label<br>| sort -count</pre><p>This transformed the dashboard from showing raw IPs to showing context -which IPs are known bad actors, which is my lab Kali box, and which are unknown.</p><h3>Phase 3: The Dashboard - 8 Panels, Live Data</h3><p>I standardized on <strong>Classic Dashboards</strong> in Splunk for better layout control. The final dashboard has 8 panels:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/593/1*zoIB7mrA653ZBWDKa1ERwA.png" /></figure><p>Every panel pulls from live Splunk searches with auto-refresh. No static data.</p><h3>Phase 4: Splunk Security Essentials - Standing on the Shoulders of Giants</h3><p>One thing I didn’t do alone: I installed the <strong>Splunk Security Essentials (SSE)</strong> app, which provides 200+ pre-built detection rules mapped to MITRE ATT&amp;CK.</p><p>I used SSE as a <strong>detection reference library - </strong>not as a crutch. I’d look at how SSE modeled a detection (their SPL logic, their field extractions, their thresholds), then adapt it to my specific indexes and log structure.</p><p>This is exactly how experienced detection engineers work. They don’t reinvent the wheel - they understand the wheel well enough to modify it for their environment.</p><h3>What I Actually Learned</h3><p>After running this for weeks and generating real attack data, here are my honest takeaways:</p><p><strong>1. Index design is the most important decision you make.</strong> Everything downstream - search speed, alert accuracy, dashboard performance -depends on how you organized your data. Don’t dump everything into main.</p><p><strong>2. Alert suppression is not optional.</strong> A brute force attack generates hundreds of events. Without a 60-minute throttle window, your alert fires 50 times per minute and becomes meaningless noise within the hour. Suppression is what separates a real detection from a log spammer.</p><p><strong>3. The detection engineering mindset changes how you think about attacks.</strong> When you’ve personally written SPL to detect a brute force, you instinctively think about the log artifacts whenever you read about a real-world incident. The attacker’s perspective and the defender’s perspective start to merge.</p><p><strong>4. Correlation rules are where real detection value lives.</strong> Single-event alerts catch simple attacks. Correlation rules catch sophisticated ones. The multi-stage rule that fires only when an IP does <em>both</em> a port scan and a brute force is far more meaningful than either trigger alone.</p><p><strong>5. Threat intelligence is only as good as your integration.</strong> Pulling a feed into a CSV is step one. Making it enrich every search in real time, automatically refreshed, with proper case logic — that’s the actual work.</p><h3>Resources &amp; Tools Used</h3><ul><li><a href="https://www.splunk.com/en_us/download/splunk-enterprise.html">Splunk Enterprise (Free Tier)</a></li><li><a href="https://splunkbase.splunk.com/app/3435">Splunk Security Essentials</a></li><li><a href="http://cinsscore.com/">CINS Army Threat Intel Feed</a></li><li><a href="https://attack.mitre.org/">MITRE ATT&amp;CK Framework</a></li><li>Kali Linux, nmap, hydra, netcat, auditd</li></ul><p>If you’re building something similar or have questions about any of the SPL, drop a comment. I respond to everything.*</p><p>Follow me for more blue team content — the next post will cover web attack detection and incident response simulation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/551/1*6THlJhBB6xRXKdAwzuntbg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pz4m-stw2ZCtkcX9yUmnTQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0HDOnv2WDY9csDee1l1Mcw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CsQY-KxzsZDIvb0uQbepHQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sPQ5dKFP6veyusDL8hhg8A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lU9LfZ32apVURpaw8GhO5w.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4b09eceb2910" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From Detection to Response: Taking My Elastic SOC Lab to the Next Level]]></title>
            <link>https://medium.com/@mudassirrana140/from-detection-to-response-taking-my-elastic-soc-lab-to-the-next-level-d3b7184a594a?source=rss-28a64f83cb6d------2</link>
            <guid isPermaLink="false">https://medium.com/p/d3b7184a594a</guid>
            <category><![CDATA[osquery]]></category>
            <category><![CDATA[threat-hunting]]></category>
            <category><![CDATA[edr]]></category>
            <category><![CDATA[incident-response]]></category>
            <category><![CDATA[elastic-siem]]></category>
            <dc:creator><![CDATA[Mudassir]]></dc:creator>
            <pubDate>Thu, 10 Sep 2026 11:38:45 GMT</pubDate>
            <atom:updated>2026-09-10T11:38:45.091Z</atom:updated>
            <content:encoded><![CDATA[<p><em>After building the detection layer, I went deeper. Here’s everything I added.</em></p><h3>Introduction</h3><p>My previous post covered building the detection foundation: 6 rule types, threat intelligence, automation, and a SOC dashboard.</p><p>But detection is only half the job.</p><p>This post covers what comes after the alert fires: EDR response, entity risk scoring, ML anomaly detection, and live forensics. Everything a real SOC analyst does after the alert lands in their queue.</p><h3>Elastic Defend Complete EDR Policy</h3><p>The first upgrade was enabling <strong>Elastic Defend</strong> with a Complete EDR policy.</p><p>Two settings most people skip:</p><ul><li><strong>Session data collection</strong> captures full terminal session output</li><li><strong>Terminal output capture</strong> records exactly what ran in every shell session</li></ul><p>These two settings turn endpoint telemetry from basic process logs into full forensic evidence.</p><h3>Response Console Incident Response Without Touching the Machine</h3><p>This is where it gets real.</p><p>Elastic’s Response Console lets you interact with a live endpoint directly from Kibana. No SSH. No RDP. No physical access.</p><p>What I did from the console:</p><ul><li>Listed all running processes on the endpoint</li><li><strong>Isolated the host</strong> from the network mid-investigation</li><li>Pulled suspicious files off the endpoint remotely</li><li><strong>Released the host</strong> after the investigation was complete</li><li>Every action logged automatically in Response Actions History</li></ul><p>The audit trail is automatic. Every command, every response, every timestamp all preserved in Elasticsearch.</p><h3>Entity Analytics Automatic Risk Scoring</h3><p>After feeding alert volume into the risk engine, Entity Analytics scored my entities automatically:</p><ul><li>Host kali → <strong>Critical</strong></li><li>User root → <strong>Critical</strong></li></ul><p>No manual work. The engine ingests alerts, weighs them by severity and frequency, and produces a risk score per entity.</p><p>This is exactly how enterprise SOCs prioritize which hosts and users need immediate attention instead of triaging hundreds of individual alerts, you look at which entities are accumulating risk.</p><h3>ML Anomaly Detection When the Model Catches What Rules Miss</h3><p>I ran three ML jobs simultaneously:</p><ul><li>auth_rare_user first-time user authentication</li><li>auth_high_count_logon_fails login failure spikes</li><li>auth_rare_hour_for_a_user unusual login hours</li></ul><p>The third one fired a <strong>real anomaly</strong>.</p><p>No rule was written. No threshold was configured. The model learned the baseline login behavior and flagged a deviation on its own.</p><p>This is the gap ML fills behavioral anomalies that signature-based rules will never catch.</p><h3>Live Forensics with Osquery</h3><p>Without leaving Kibana, I ran live forensic queries directly on the endpoint using Elastic’s built-in Osquery manager.</p><p>Queries I ran during investigation:</p><p>Running processes<br>SELECT name, pid, uid, path FROM processes LIMIT 20;</p><p>Open network connections<br>SELECT * FROM process_open_sockets LIMIT 20;</p><p>All user accounts<br>SELECT * FROM users;</p><p>Files in /tmp<br>SELECT * FROM file WHERE directory = ‘/tmp’;</p><p>Active cron jobs<br>SELECT * FROM crontab;</p><p>Results indexed into Elasticsearch instantly searchable, auditable, and preserved as part of the investigation record.</p><p>This is live host forensics during an active incident. No agents beyond what’s already deployed. No additional tools.</p><h3>Key Lessons</h3><p><strong>1. EDR policy defaults are not enough</strong><br> Session data and terminal output capture are disabled by default. Enable both they are the difference between knowing a process ran and knowing exactly what it did.</p><p><strong>2. Response Console replaces half your IR toolkit</strong><br> Isolate, execute, get-file, release all from a browser tab. The audit trail is automatic.</p><p><strong>3. Entity scores change how you triage</strong><br> Instead of 200 individual alerts, you look at 2 Critical entities. Prioritization becomes obvious.</p><p><strong>4. ML jobs need time to baseline</strong><br> Don’t expect anomalies on day one. The models need data to establish normal behavior before deviations become meaningful.</p><p><strong>5. Osquery results need the right confirmation method</strong><br> The inline results panel can show stale data. Always confirm via the Docs count in the main results table and access full row data through the query UUID link.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uM0cbSJmMyzR2MZwy_503Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*63zDXlrhPABBBvl7QkHpNA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_z06fZQxRXyTfzWWnuyjgQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/534/1*iRnZMjBIUMuSFqA7mEimTQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k_RTVudnfv63xTB83tnBWQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qzakueAoBfnZniZBjV8ueg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_9-4PvMf1UDkHkInJmSBUg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d3b7184a594a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I Built a Production-Grade SOC Using Elastic SIEM - A Complete Walkthrough]]></title>
            <link>https://medium.com/@mudassirrana140/how-i-built-a-production-grade-soc-using-elastic-siem-a-complete-walkthrough-df5750c1ce9b?source=rss-28a64f83cb6d------2</link>
            <guid isPermaLink="false">https://medium.com/p/df5750c1ce9b</guid>
            <category><![CDATA[detection-engineering]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[elastic-siem]]></category>
            <category><![CDATA[gcp-security-operations]]></category>
            <dc:creator><![CDATA[Mudassir]]></dc:creator>
            <pubDate>Thu, 27 Aug 2026 10:13:16 GMT</pubDate>
            <atom:updated>2026-08-27T10:13:16.102Z</atom:updated>
            <content:encoded><![CDATA[<p><em>From zero to a fully automated Security Operations Center running on my network</em></p><h3>Introduction</h3><p>Six months ago I didn’t know what a SIEM was.</p><p>Today I have a fully working Security Operations Center running in my bedroom - complete with real-time threat detection, automated Slack alerts, Jira ticket creation, incident case management, and a 5-panel SOC dashboard that any enterprise analyst would recognize immediately.</p><p>This is not a tutorial about clicking through a vendor demo. This is a walkthrough of everything I actually built, every mistake I made, and everything I learned along the way.</p><p>If you’re learning cybersecurity and you’re stuck in tutorial hell - this post is for you.</p><h3>Lab Architecture</h3><p>Before writing a single detection rule, I needed an environment to run everything.</p><p><strong>Hardware:</strong></p><ul><li>One machine running Ubuntu 24 as the host machine</li><li>Kali Linux VM as the monitored endpoint and attack simulation platform</li></ul><p><strong>Stack:</strong></p><ul><li>Elasticsearch 8.15.3</li><li>Kibana 8.15.3</li><li>Fleet Server via Elastic Agent 8.15.3</li><li>Everything running inside Docker containers</li></ul><p><strong>Why Docker?</strong> Docker made the entire stack reproducible and easy to manage. One docker-compose.yml file controls everything - Elasticsearch, Kibana, and Fleet Server all spin up together with a single command.</p><p>Here’s the key part of my Docker Compose setup:</p><p>elasticsearch:<br> image: docker.elastic.co/elasticsearch/elasticsearch:8.15.3<br> environment:<br>ES_JAVA_OPTS=-Xms1536m -Xmx1536m<br> discovery.type=single-node<br> mem_limit: 3g<br> restart: unless-stopped</p><p>kibana:<br> image: docker.elastic.co/kibana/kibana:8.15.3<br> ports:<br> “5602:5601”<br> restart: unless-stopped</p><p>fleet-server:<br> image: docker.elastic.co/beats/elastic-agent:8.15.3<br> ports:<br> “8220:8220”<br> restart: unless-stopped</p><p><strong>Important lesson learned:</strong> Follow the 50% rule for Elasticsearch JVM heap. If your container has 3GB memory limit, set heap to 1.5GB (-<strong>Xms1536m -Xmx1536m</strong>). Ignoring this causes GC overhead crashes.</p><h3>Log Collection - Fleet + Elastic Agent + Auditd</h3><p>A SIEM is only as good as its log sources. I set up two primary log sources:</p><h3>1. System Authentication Logs</h3><p>Installed rsyslog on Kali Linux to generate /var/log/auth.log. This gave me SSH login events, sudo usage, and user authentication data flowing into logs-system.auth-*.</p><h3>2. Auditd - Linux Audit Framework</h3><p>This was the most powerful log source I configured. Auditd monitors system calls at the kernel level - it sees everything.</p><p>I wrote 11 custom audit rules covering:</p><ul><li>Sudo usage</li><li>User account modification</li><li>SSH configuration changes</li><li>Cron job modifications</li><li>Privilege escalation via setuid binaries</li><li>Login and logout events</li><li>Network connections</li></ul><p><strong>Critical lesson:</strong> Audit rule keys appear in the tags field array in logs-auditd_manager* - not in auditd.data.key as most documentation suggests. This took me hours to figure out.</p><h3>Fleet Server Setup</h3><p>Fleet Server acts as the management plane for all Elastic Agents. Every endpoint running an Elastic Agent checks in with Fleet Server to receive policies and ship logs.</p><p><strong>Docker volume hygiene matters:</strong> Stale Fleet Server service tokens persist in volumes after rebuilds. Always clear both the token AND the fleet-agent-data volume together when rebuilding.</p><p><strong>Docker volume hygiene matters:</strong> Stale Fleet Server service tokens persist in volumes after rebuilds. Always clear both the token AND the fleet-agent-data volume together when rebuilding.</p><h3>Detection Engineering - All 6 Rule Types</h3><p>This was the core of the entire project. Elastic Security supports 6 detection rule types and I built at least one of each.</p><h3>1. EQL Sequence Rule - SSH Login Followed by Privilege Escalation</h3><p>EQL (Event Query Language) is Elastic’s most powerful rule type. It lets you detect sequences of events - not just single events in isolation.</p><p>My rule detected: SSH login from a remote IP followed by a sudo command within 5 minutes.</p><p>sequence by host.id with maxspan=5m<br> [authentication where event.action == “ssh_login” <br> and event.outcome == “success”<br> and source.ip != “127.0.0.1”]<br> [process where event.action == “executed”<br> and process.name == “sudo”]</p><p><strong>Key concept learned:</strong> maxspan and lookback are completely independent parameters. maxspan controls how close correlated events must be to each other within a sequence. Lookback controls how far back the rule searches on each run.</p><p><strong>Process name drift:</strong> Modern Kali Linux uses sshd-session not sshd. Always verify actual field values in Discover before writing queries — never assume</p><h3>2. Threshold Rule - SSH Brute Force Detection</h3><p>Threshold rules fire when a field value exceeds a count within a time window. Perfect for brute force detection.</p><p>My rule fired when the same source IP had 5+ failed SSH login attempts within 5 minutes.</p><p>event.category: “authentication” AND event.outcome: “failure”<br>Threshold: count(source.ip) &gt;= 5 over 5 minutes</p><p>I connected this rule to both a Slack webhook and a Kibana Index connector — every brute force attempt sends a real-time Slack message to #siem-alerts.</p><h3>3. New Terms Rule - First-Time User Login Detection</h3><p>New Terms rules detect the first time a value appears in your data. I used this to detect when a brand new username successfully logged in via SSH — a classic persistence indicator.</p><p>The backdoor user (backdooruser) I created for testing triggered this rule perfectly on first login.</p><h3>4. ML Rules - Anomaly Detection</h3><p>With an Elastic trial license, you get access to machine learning jobs. I ran three ML jobs simultaneously:</p><ul><li>auth_rare_user- detects users logging in for the first time-</li><li>auth_high_count_logon_fails- detects spikes in failed login attempts</li><li>auth_rare_hour_for_a_user- detects logins at unusual hours for a specific user</li></ul><p>The Anomaly Explorer in Kibana confirmed all three were detecting anomalies correctly. ML rules don’t require you to write queries - the algorithm learns your baseline and alerts on deviations.</p><h3>5. Indicator Match Rule - Threat Intelligence</h3><p>This is where it gets enterprise-level. Indicator Match rules compare your live traffic against known malicious indicators from threat intelligence feeds.</p><p>I integrated AbuseCH natively through Elastic’s integration:</p><ul><li><strong>URLhaus </strong>- malicious URLs</li><li><strong>MalwareBazaar </strong>- malware file hashes</li><li><strong>ThreatFox </strong>— malicious IPs and domains</li></ul><p>My rule mapped source.ip from live network logs against threat.indicator.ip from the AbuseCH feed. Any connection from a known malicious IP triggers an immediate alert.</p><h3>6. Query Rules - Auditd-Based Detections</h3><p>Standard KQL/Lucene query rules. I built three:</p><ul><li><strong>Privilege Escalation (Critical) </strong>- detects setuid binary execution via auditd</li><li><strong>New User Account Created (High) </strong>- monitors /etc/passwd modifications</li><li><strong>SSH Config Modified </strong>- detects changes to SSH configuration files</li></ul><p><strong>Tuning lesson:</strong> Monitoring all user_modification events generates too much noise. Narrowing to file.path: &quot;/etc/passwd&quot; isolates true account creation events</p><h3>Threat Intelligence - AbuseCH Integration</h3><p>AbuseCH provides free, high-quality threat intelligence updated in real time. Elastic has a native integration that pulls indicators automatically.</p><p>The integration populates a dedicated threat intelligence index with structured indicators in ECS format. My Indicator Match rule then queries this index on every rule execution - comparing live source IPs against thousands of known malicious IPs.</p><p>This is the same architecture used in enterprise SOCs - the only difference is the scale of the threat intelligence feed.</p><h3>SOC Automation - Slack + Jira + Kibana Cases</h3><p>Detection without response is just logging. I built a complete automated response workflow.</p><h3>Slack Integration</h3><p>Every alert fires a Slack webhook to #siem-alerts with a Mustache-templated message showing:</p><ul><li>Rule name</li><li>Alert severity</li><li>Source IP</li><li>Timestamp</li><li>Link to the alert in Kibana</li></ul><h3>Jira Integration</h3><p>Every alert automatically creates a Jira ticket in my SCRUM project backlog with:</p><ul><li>Issue type: Bug</li><li>Priority mapped to alert severity</li><li>Description populated with alert details</li><li>Status: To Do (ready for analyst triage)</li></ul><h3>Kibana Cases</h3><p>For formal incident management I used the Kibana Cases API directly from Dev Tools:</p><p>POST kbn:/api/cases<br>{<br> “title”: “INC-001 — SSH Brute Force + Privilege Escalation”,<br> “description”: “Confirmed attack chain detected”,<br> “severity”: “critical”,<br> “tags”: [“T1110”, “TA0004”, “ssh”, “brute-force”]<br>}</p><p>I documented a complete incident - INC-001-with timeline narrative, MITRE ATT&amp;CK mapping, and investigation notes. This mirrors exactly how real SOC analysts document incidents.</p><h3>OC Dashboard - 5 Custom Panels</h3><p>Every SOC needs a central visualization layer. I built a custom dashboard in Kibana Lens with 5 panels:</p><h3>Panel 1 - Alert Trend Over Time</h3><p>A stacked bar chart showing alert volume over 7 days, color-coded by detection rule. Immediately shows when attacks happened and which rules fired.</p><h3>Panel 2 - Top Triggered Rules</h3><p>A horizontal bar chart ranking all detection rules by total alert count. SSH Brute Force and SSH Login + Privilege Escalation consistently top the list.</p><h3>Panel 3 - Alerts by Severity</h3><p>A donut chart showing severity distribution. My lab shows 76% High and 24% Critical - no low-severity noise because my rules are tuned to fire only on genuinely serious activity.</p><h3>Panel 4 - Top Source IPs &amp; Users</h3><p>A data table showing attacker IPs paired with usernames, alert count, severity, last rule triggered, and last seen timestamp. This is the first thing a real SOC analyst checks during triage.</p><h3>Panel 5 - MITRE ATT&amp;CK Coverage</h3><p>A horizontal bar chart showing which MITRE techniques my rules are covering. SSH attacks dominate, followed by privilege escalation and authentication techniques <strong>- </strong>exactly matching my lab’s attack scenarios.</p><p><strong>Important:</strong> All dashboard panels query .alerts-security.alerts-default — the dedicated Elastic Security alerts index. This index contains structured alert documents with kibana.alert.* metadata fields populated by the detection engine.</p><h3>MITRE ATT&amp;CK Coverage</h3><p>Every detection rule I built was tagged with the relevant MITRE ATT&amp;CK techniques:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/641/1*1Po0jPzVqRFmSQJGYcKGow.png" /></figure><p>Mapping to MITRE ATT&amp;CK serves two purposes - it helps you understand what attack technique you’re detecting, and it reveals gaps in your coverage where you have no detections at all.</p><h3>Lessons Learned</h3><p>These are the things that cost me the most time and taught me the most:</p><p><strong>1. Index pattern scoping is critical</strong> Broad patterns like logs-* cause rules to miss or mismatch. Always scope to specific data streams like logs-system.auth-*.</p><p><strong>2. Always verify field values in Discover first</strong> Never assume field names or values. Modern Kali uses sshd-session not sshd. Query your actual data before writing detection logic.</p><p><strong>3. maxspan vs lookback are completely different</strong> In EQL sequence rules, maxspan controls the time window between correlated events. Lookback controls how far back the rule searches. They are independent.</p><p><strong>4. Attack simulation must use real network IPs</strong> Use the actual network IP, not localhost or ::1. Localhost connections don&#39;t generate valid source.ip mappings in logs — your detections won&#39;t fire.</p><p><strong>5. Save your dashboard early and often</strong> “Save and return” in Lens only saves the individual panel. The main “Save” button saves the entire dashboard. I lost a full dashboard once by confusing these two.</p><p><strong>6. Docker volume hygiene</strong> Stale service tokens in Docker volumes cause Fleet Server authentication failures after rebuilds. Always clean volumes properly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/678/1*X7GyAvVnjjk5f14VYLhWpQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/689/1*WheSOSq4wVNNTZeiK2bRcw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/1*KE4GfAQTw_AvKb5qk96tyA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*60FOgnWbXtXHI5lChKafCg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=df5750c1ce9b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Custom IRIS Pipeline Module for Sandbox Integration]]></title>
            <link>https://medium.com/@mudassirrana140/building-a-custom-iris-pipeline-module-for-sandbox-integration-7fd40421b9c5?source=rss-28a64f83cb6d------2</link>
            <guid isPermaLink="false">https://medium.com/p/7fd40421b9c5</guid>
            <dc:creator><![CDATA[Mudassir]]></dc:creator>
            <pubDate>Fri, 07 Aug 2026 11:43:57 GMT</pubDate>
            <atom:updated>2026-08-07T11:43:57.407Z</atom:updated>
            <content:encoded><![CDATA[<p>Introduction</p><p>DFIR-IRIS is an open-source incident response platform used by security teams to manage cases, track IOCs, and collaborate on investigations. One of its most powerful features is the ability to extend it with custom modules. In this post I will walk through how I built a custom pipeline module called iris_oam_module that integrates OAM (Object Analysis Manager) sandbox directly into the IRIS case management workflow.</p><p><strong>What is OAM?</strong></p><p>OAM is a malware analysis sandbox that performs multi-layered analysis on submitted files including:</p><ul><li>Antivirus scanning</li><li>Sandbox execution on Windows VMs</li><li>Cyber Threat Intelligence checks (CTI, SIEM, ODB, DMD)</li><li>MITRE ATT&amp;CK technique mapping</li><li>TTP signature detection</li></ul><p><strong>The Problem</strong></p><p>Security analysts working on cases in IRIS had no direct way to submit suspicious files to the OAM sandbox from within the platform. They had to manually upload files to OAM, wait for results, then manually copy findings back into IRIS. This was slow and error-prone.</p><p><strong>The Solution</strong></p><p>I built iris_oam_module a custom IRIS pipeline module that lets analysts upload files directly from a case and get the full OAM analysis report back in DIM Tasks, all without leaving IRIS.</p><p><strong>Architecture</strong></p><p>The module follows the same architecture as built-in modules like IrisVT:</p><p>Analyst uploads file in IRIS UI<br> ↓<br>pipeline_files_upload() saves file to shared Docker volume<br> ↓<br>pipeline_handler() picks up the file<br> ↓<br>Sends file to OAM API via HTTP POST<br> ↓<br>OAM runs AV + MARS sandbox + intelligence checks<br> ↓<br>Full JSON response logged to DIM Tasks UI</p><p>Module Structure</p><p>iris_oam_module/<br>├── setup.py <br>└── iris_oam_module/<br> ├── __init__.py <br> ├── IrisOAMConfig.py <br> └── IrisOAMInterface.py</p><p><strong>Key Technical Challenges and Solutions</strong></p><p><em>Challenge 1 - Shared Volume</em><br> cms-app and cms-worker are separate containers. Files uploaded in cms-app were not visible to cms-worker where pipeline_handler runs. Solution: added a shared Docker volume cms-downloads to docker-compose.yml for both services.</p><p><em>Challenge 2 - Processing only new files</em><br> The pipeline directory accumulates files over time. Every trigger was reprocessing all old files. Solution: implemented a .pending marker file approach - pipeline_files_upload() writes the uploaded filename to .pending, pipeline_handler() reads and immediately deletes .pending, then processes only those files.</p><p><em>Challenge 3 - Clean DIM Tasks output</em><br> IRIS framework adds internal log lines (Retrieved server configuration) to the message queue before our code runs. Solution: two message_queue clear loops - one before and one after module_dict_conf.get() calls.</p><p><em>Challenge 4 - Directory creation</em><br> IRIS passes the upload path but does not always create the directory. Solution: used Path(base_path).mkdir(parents=True, exist_ok=True) in pipeline_files_upload().</p><p><strong>The Result</strong></p><p>Analysts can now:</p><ol><li>Open any case in IRIS</li><li>Go to Pipelines → OAM Sandbox Analysis</li><li>Upload a suspicious file</li><li>Click Process</li><li>Get the full OAM JSON report in DIM Tasks including hashes, verdict, MITRE ATT&amp;CK, TTP signatures, MARS score, and all intelligence check results</li></ol><p><strong>Deployment</strong></p><p>The module is designed like IrisVT - it is installed inside the Docker image so every deployment has it ready. Admin just configures OAM URL and API key from the IRIS UI. Each organization enters their own OAM server details.</p><p><strong>Conclusion</strong></p><p>Building custom IRIS modules is a powerful way to extend the platform for your specific security stack. The pipeline module pattern is straightforward once you understand the two-method flow and the Docker volume sharing requirement. The full source code follows standard Python packaging conventions making it easy to distribute and deploy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aFRlw_QNwV8eIfLDt_GrOw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hshJSglE-yKq_dX9Pq865Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fZ7VAMsKQOcHXLb84tuVaQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7fd40421b9c5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Piping Case Activity from a DFIR Case Management System into Kafka (with Python, Filebeat, and…]]></title>
            <link>https://medium.com/@mudassirrana140/piping-case-activity-from-a-dfir-case-management-system-into-kafka-with-python-filebeat-and-255a1173ded5?source=rss-28a64f83cb6d------2</link>
            <guid isPermaLink="false">https://medium.com/p/255a1173ded5</guid>
            <category><![CDATA[siem]]></category>
            <category><![CDATA[deployment-pipelines]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[apache-kafka]]></category>
            <dc:creator><![CDATA[Mudassir]]></dc:creator>
            <pubDate>Wed, 01 Jul 2026 11:10:43 GMT</pubDate>
            <atom:updated>2026-07-01T11:10:43.740Z</atom:updated>
            <content:encoded><![CDATA[<h3>Piping Case Activity from a DFIR Case Management System into Kafka (with Python, Filebeat, and systemd)</h3><p>If you run a case management system (CMS) like DFIR IRIS, you probably already have a SIEM pipeline collecting logs from your sensors, endpoints, and infrastructure. But there’s a common blind spot: <strong>case activity itself-</strong>who opened a case, who added evidence, who changed a status - usually stays locked inside the CMS’s own database and UI. It never reaches the SIEM, which means your incident timeline and your investigator activity live in two different places that don’t talk to each other.</p><p>I ran into this gap firsthand and built a small, boring-on-purpose pipeline to close it. Here’s how it works, and why I made the design choices I did.</p><h3>The problem</h3><p>SOC and DFIR teams want a single source of truth for “what happened and who did it.” If case management activity isn’t flowing into the same SIEM/Kafka pipeline as everything else, you lose:</p><ul><li>Correlation between case actions and other security events on the same timeline</li><li>Long-term retention and search across your normal log retention policy, instead of whatever the CMS keeps natively</li><li>The ability to alert on suspicious case activity like unusual after-hours access the same way you’d alert on anything else</li></ul><h3>The approach</h3><p>The pipeline is intentionally simple - four moving parts, each doing one job:</p><p><strong>1. A Python polling script (</strong><strong>activity-cms.py)</strong> Authenticates to the CMS&#39;s REST API with a bearer token and pulls new activity records on a schedule. A few deliberate design choices:</p><ul><li><strong>Incremental fetch - </strong>it tracks the timestamp of the last record it saw in a local .state file, so every run only pulls what&#39;s new. No duplicate processing, no re-fetching the whole history every hour.</li><li><strong>NDJSON output - </strong>each record gets appended as a single-line JSON object to an output file, which is exactly the format Filebeat’s ndjson parser wants. No transformation step needed downstream.</li><li><strong>Resilience over correctness-at-all-costs - </strong>HTTP and file I/O errors are caught and logged rather than raising, so a single bad response doesn’t kill the whole polling cycle.</li><li><strong>Observability - </strong>a rotating file handler (5MB × 3 backups) plus console output, so there’s always an audit trail without the log file growing forever.</li></ul><p>Here’s the state-tracking logic that makes the fetch incremental - it’s the core of the “only process what’s new” behavior:</p><p>def load_last_timestamp():<br> if not os.path.exists(STATE_FILE):<br> return None<br> try:<br> with open(STATE_FILE, “r”) as f:<br> ts = f.read().strip()<br> return datetime.fromisoformat(ts) if ts else None<br> except Exception as e:<br> logger.error(f”Failed to read state file: {e}”)<br> return None</p><p>def save_last_timestamp(ts):<br> try:<br> with open(STATE_FILE, “w”) as f:<br> f.write(ts)<br> logger.info(f”Updated last timestamp: {ts}”)<br> except Exception as e:<br> logger.error(f”Failed to write state file: {e}”)</p><p>Every run compares each record’s activity_date against this stored timestamp, keeps only what&#39;s newer, sorts by date, and writes the batch out as NDJSON:</p><p>def write_ndjson(records):<br> try:<br> os.makedirs(os.path.dirname(OUTPUT_FILE), exist_ok=True)<br> with open(OUTPUT_FILE, “a”) as f:<br> for rec in records:<br> f.write(json.dumps(rec) + “\n”)<br> logger.info(f”Wrote {len(records)} new records to {OUTPUT_FILE}”)<br> except Exception as e:<br> logger.error(f”Failed to write NDJSON file: {e}”)</p><p>The rest of the script (main(), logging setup, HTTP fetch with error handling) follows the same pattern — full version is on GitHub.</p><p><strong>2. Filebeat</strong> Watches the NDJSON output file as a new filestream input, parses each line as JSON with json.keys_under_root, and forwards it into the existing Kafka output block already configured for other log sources - so this new input rides on infrastructure that was already there, rather than requiring a parallel delivery path.</p><p><strong>3. Kafka</strong> Receives the events on a topic dedicated to case activity, ready for downstream indexing alongside everything else.</p><p><strong>4. systemd (service + timer)</strong> Runs the Python script on an hourly cycle without depending on a logged-in session or a fragile cron entry. The service is a oneshot unit with Restart=on-failure; the timer fires shortly after boot and every 60 minutes after that, with Persistent=true so a missed run like host was off still catches up.</p><h3>What actually happened when I ran it</h3><p>On first execution - with no prior .state file - the script treated every record returned by the API as new and wrote all of them to the NDJSON output. On subsequent runs, only genuinely new records get appended. The systemd timer was verified as enabled and running, confirmed via systemctl list-timers.</p><h3>What’s still open</h3><p>Two honest loose ends I’m not going to pretend are closed:</p><ol><li><strong>Filebeat needs a restart</strong> to pick up the new input definition - a config file change alone doesn’t hot-reload a new filestream input. That’s a one-command fix, but I want to actually confirm events land on the Kafka topic before calling this “done.”</li><li><strong>Rolling this out to a second host</strong> running its own instance of the CMS, so the same fetch-and-forward pattern doesn’t need to be hand-built twice.</li></ol><h3>Why this pattern is worth knowing</h3><p>None of the individual pieces here are exotic - REST polling, NDJSON, Filebeat, Kafka, systemd timers are all well-worn tools. The value is in the composition: a small, idempotent script that plugs a genuine visibility gap into an existing pipeline, without requiring the CMS vendor to ship a native Kafka integration or the SOC to stand up new infrastructure just for one data source. This is the kind of pragmatic gap-filling that a lot of real SOC/DFIR environments actually need.</p><p>Code is on GitHub: <a href="https://github.com/MUDASSIRRANA/cms-activity-kafka-pipeline">https://github.com/MUDASSIRRANA/cms-activity-kafka-pipeline</a></p><p>Stack: Python · Filebeat · Kafka · systemd · REST APIs</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=255a1173ded5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Package a Running Docker App and Deploy It on a Different Machine (No Source Code, No…]]></title>
            <link>https://medium.com/@mudassirrana140/how-to-package-a-running-docker-app-and-deploy-it-on-a-different-machine-no-source-code-no-05a887febe14?source=rss-28a64f83cb6d------2</link>
            <guid isPermaLink="false">https://medium.com/p/05a887febe14</guid>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[shellscripting]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[dfir-iris]]></category>
            <dc:creator><![CDATA[Mudassir]]></dc:creator>
            <pubDate>Mon, 22 Jun 2026 05:27:29 GMT</pubDate>
            <atom:updated>2026-06-22T05:27:29.632Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>How to Package a Running Docker App and Deploy It on a Different Machine (No Source Code, No Downtime)</strong></h3><p><strong>How to Package a Running Docker App and Deploy It on a Different Machine (No Source Code, No Downtime)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*2Kl6IDUEpqoz2Hir4muXkQ.png" /></figure><h3>The Scenario</h3><p>You’ve got an app running in Docker across several containers (say: nginx, app server, worker, database, message queue). You need to get an identical, fully working copy running on a different VM. Constraints:</p><ul><li>No source code in the package</li><li>No build step on the target machine</li><li>No disrupting whatever else is already running there</li><li>The new instance should come up with the same data, same branding, same custom features</li></ul><p>This is a common ask for handing off demo environments, disaster-recovery copies, or air-gapped deployments. Here’s the full workflow, step by step.</p><h3>Step 1- Stop the Containers Before Snapshotting</h3><p>docker commit captures whatever state a container is in <em>right now</em>. If it&#39;s mid-write to a file or mid-transaction in a database, you can capture an inconsistent snapshot. Stop everything first:</p><p>command: docker stop app-nginx app-worker app-server app-db app-rabbitmq</p><h3>Step 2- Bake In Any Bind-Mounted Files First</h3><p>Check your docker-compose.yml for volume mounts like this:</p><p>volumes:<br>./certificates/:/etc/ssl/certs/:ro<br>./custom-branding/login.css:/app/static/css/login.css</p><p>These pull files from the <strong>host machine</strong> at startup — they are not part of the image, and docker commit will not capture them. If you skip this step, your packaged app will be missing certificates, custom branding, or any other externally-mounted file the moment it runs on a machine that doesn&#39;t have that host folder.</p><p>Copy them into the container manually, using the <strong>original, unmodified image</strong> (not a container started with a placeholder command):</p><p>commands:</p><p>docker run -d — name temp-app app-server:original sleep infinity</p><p>docker cp ./certificates/server.crt temp-app:/etc/ssl/certs/server.crt<br>docker cp ./custom-branding/login.css temp-app:/app/static/css/login.css<br>docker cp ./custom-branding/logo.png temp-app:/app/static/img/logo.png</p><p>docker stop temp-app<br>docker rm temp-app</p><p><strong>Why </strong><strong>sleep infinity and not a placeholder entrypoint flag?</strong> Starting the container with its <em>normal</em> command (just running in the background) means committing it later won&#39;t accidentally bake in a fake startup command. More on this in Step 3.</p><h3>Step 3- Commit the Containers Into New Images</h3><p>docker commit app-nginx app-nginx:packaged<br>docker commit app-server app-server:packaged<br>docker commit app-worker app-worker:packaged<br>docker commit app-db app-db:packaged<br>docker commit app-rabbitmq app-rabbitmq:packaged</p><p><strong>Watch out:</strong> if you committed from a container you started with something like --entrypoint sleep ... infinity to &quot;pause&quot; it while copying files in, that sleep command gets baked into the image as its <em>permanent</em> entrypoint. Every future container from that image will just sleep and never actually run your app.</p><p>If you need to override what got baked in, fix it explicitly at commit time:</p><p>command:</p><p>docker commit \<br>-change=’ENTRYPOINT []’ \<br> -change=’CMD [“./start.sh”]’ \<br> temp-app app-server:packaged</p><p>Safer option: avoid the problem entirely by copying files into a container you start <em>normally</em> (Step 2), not one running a throwaway sleep command.</p><h3>Step 4- Export Each Image to a Portable .tar File</h3><p>commands:</p><p>mkdir -p package/images</p><p>docker save app-nginx:packaged -o package/images/nginx.tar<br>docker save app-server:packaged -o package/images/server.tar<br>docker save app-worker:packaged -o package/images/worker.tar<br>docker save app-db:packaged -o package/images/db.tar<br>docker save app-rabbitmq:packaged -o package/images/rabbitmq.tar</p><p>These .tar files are now fully self-contained. No registry, no internet access, no build context needed -docker load on any machine brings them back.</p><h3>Step 5- Export Your Database Separately</h3><p>This is the step people forget. <strong>Application data lives in a Docker volume, not in the image.</strong> commit and save never touch it. If you skip this, your &quot;identical copy&quot; boots up completely empty.</p><p>docker exec app-db pg_dumpall -U postgres &gt; package/db-backup.sql</p><p>You’ll restore this on the target machine after the new database container is running (Step 8).</p><h3>Step 6- Restart the Original Containers</h3><p>docker start app-nginx app-worker app-server app-db app-rabbitmq</p><p>The source machine goes right back to normal. Nothing about this process is destructive to the original.</p><h3>Step 7- Namespace Everything for the Target Machine</h3><p>If the target VM already runs other things, avoid collisions by giving your package’s container names, networks, and exposed ports a unique identity in docker-compose.yml:</p><p>services:<br> nginx:<br> container_name: pkg-app-nginx<br> ports:<br> — “8443:443” # define port for your service<br> networks:<br> — pkg-app-frontend</p><p>networks:<br> pkg-app-frontend:<br> name: pkg-app-frontend<br> pkg-app-backend:<br> name: pkg-app-backend</p><p>Do this for every service. It costs nothing and saves you from a port-already-in-use error on deploy day.</p><h3>Step 8- Write One Installer Script to Do the Rest</h3><p>Manual multi-step deploys are where mistakes happen. A single install.sh should:</p><p>#!/bin/bash<br>set -e</p><p># 1. Make sure Docker exists, install it if not<br>if ! command -v docker &gt;/dev/null 2&gt;&amp;1; then<br> curl -fsSL <a href="https://get.docker.com/">https://get.docker.com</a> | bash<br>fi</p><p># 2. Load every image<br>for f in images/*.tar; do<br> docker load — input “$f”<br>done</p><p># 3. Bring the stack up<br>docker compose up -d</p><p># 4. Wait, then restore the database<br>sleep 15<br>cat db-backup.sql | docker exec -i pkg-app-db psql -U postgres</p><p># 5. Confirm everything is actually running — not just “didn’t error”<br>sleep 15<br>docker compose ps</p><p>In a real installer, add proper checks before each destructive step: confirm required files exist, check if ports/containers/networks already exist and ask before overwriting, and verify each container reaches a healthy state rather than assuming docker compose up -d succeeding means the app is actually working.</p><h3>Step 9- Package and Transfer</h3><p>tar -czvf app-package.tar.gz package/<br>scp app-package.tar.gz user@target-vm:~/</p><p>On the target machine:</p><p>tar -xzvf app-package.tar.gz<br>cd package<br>sudo bash install.sh</p><h3>Step 10- Verify on a Machine That’s Never Seen the App Before</h3><p>The real test isn’t “it works on my machine” — it’s deploying to a clean VM that has no prior knowledge of your app. Check:</p><ul><li>All containers report healthy (docker ps)</li><li>The app is reachable over its configured port</li><li>Custom branding/files render correctly (confirms Step 2 actually worked)</li><li>Database content matches the source (confirms Step 5 actually worked)</li><li>Anything else already running on that VM is still untouched</li></ul><p>If all five hold up, you’ve got a genuinely portable package — not just a working container, but a working <em>deployment process</em>.</p><h3>The Core Lesson</h3><p>A Docker image only contains what’s <em>inside</em> the image. Bind-mounted files, database volumes, and anything injected at container-start time will silently not travel with a commit/save. The fix is always the same: bring everything the container depends on <em>inside</em> the image before you snapshot it, and validate the result on a machine that&#39;s starting from zero.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=05a887febe14" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I Deployed DFIR IRIS v2.4.22 with Docker - A Practical Walkthrough]]></title>
            <link>https://medium.com/@mudassirrana140/how-i-deployed-dfir-iris-v2-4-22-with-docker-a-practical-walkthrough-6d933443dc6d?source=rss-28a64f83cb6d------2</link>
            <guid isPermaLink="false">https://medium.com/p/6d933443dc6d</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[digital-forensics]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[incident-response]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Mudassir]]></dc:creator>
            <pubDate>Tue, 16 Jun 2026 04:55:38 GMT</pubDate>
            <atom:updated>2026-06-16T04:56:17.289Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*2Kl6IDUEpqoz2Hir4muXkQ.png" /></figure><p><em>Building an air-gapped, portable incident response platform from scratch</em></p><p>If you’ve worked in digital forensics or incident response, you’ve probably heard of <strong>DFIR IRIS - </strong>the open-source collaborative investigation platform built for SOC analysts and forensic investigators. Setting it up for production, especially in an offline or air-gapped environment, involves more moving parts than the docs let on.</p><p>This post walks through exactly what I did to get DFIR IRIS v2.4.22 fully deployed using Docker, packaged into a portable archive, and scripted for clean, repeatable installation.</p><h3>Prerequisites</h3><p>Before anything else, confirm your environment has the two essentials:</p><ul><li><strong>Docker</strong> (with Docker Compose)</li><li><strong>Git</strong></li></ul><p>Run a quick check on both before cloning anything. Nothing is more frustrating than getting halfway through a setup only to discover your Docker version doesn’t support a Compose feature you need.</p><h3>Step 1 — Clone the DFIR IRIS Repository</h3><p>Start by pulling down the official DFIR IRIS source:</p><pre>git clone https://github.com/dfir-iris/iris-web.git<br>cd iris-web</pre><p>Once inside the repo, <strong>checkout the specific release tag</strong> you want to pin to. In my case, that was v2.4.22:</p><pre>git checkout v2.4.22</pre><p>Pinning to a tag instead of running off main is critical for production deployments. You want predictable, tested behavior -not whatever landed in the repo last Tuesday.</p><h3>Step 2 - Configure the Environment</h3><p>DFIR IRIS uses a .env file to manage its configuration. Copy the provided sample into place:</p><pre>cp .env.model .env</pre><p>Then open .env and <strong>set your passwords</strong>. At minimum, you&#39;ll want to change the default database credentials and the IRIS admin password. Leaving defaults in place is a security risk, especially if the platform will be accessible beyond localhost.</p><h3>Step 3-Bring It Up with Docker Compose</h3><p>With the environment configured, spin up the stack:</p><pre>docker compose up -d</pre><p>The -d flag runs everything detached in the background. Docker will pull and build the required images — this may take a few minutes on the first run. Once complete, IRIS will be accessible at https://localhost (or your server&#39;s IP).</p><h3>Packaging for Offline Deployment</h3><p>This is where things get interesting. In many forensic and enterprise environments, your target machine won’t have internet access. You need to <strong>package everything up and carry it in</strong>.</p><h3>Save the Docker Images</h3><p>First, check which images are running:</p><pre>docker images</pre><p>Then save each container image to a .tar file:</p><pre>docker save &lt;image-name&gt; -o &lt;image-name&gt;.tar</pre><p>Do this for every image in the IRIS stack. Bundle them all together into a single deployable archive:</p><pre>tar -cvf iris-final-deploy.tar iris-deploy/</pre><p>You now have a portable package that can be transferred to any machine -USB drive, internal file share, whatever your environment allows.</p><h3>Deployment on the Target Machine</h3><p>On the destination server, the installation process becomes clean and scriptable.</p><h3>Set Up the Directory Structure</h3><pre>mkdir -p /var/cms</pre><p>Copy all the packaged IRIS files into this directory, along with any TLS certificates your environment requires:</p><pre>cp -r iris-deploy/* /var/cms/<br>cp your-cert.pem /var/cms/</pre><p>Set proper ownership so the service user can read everything:</p><pre>chown -R &lt;your-user&gt;:&lt;your-group&gt; /var/cms</pre><p>Verify the structure looks right before proceeding:</p><pre>ls -la /var/cms</pre><h3>Check the Environment File</h3><p>Before running anything, double-check your .env file is in place and configured correctly for the new host. IP addresses, hostnames, and paths may need updating from your build machine.</p><h3>Creating the Installer Script</h3><p>Rather than running commands manually every time, I wrapped the deployment into a single installer.sh script. The script handles:</p><ol><li>Stopping and removing any previously running IRIS containers/images</li><li>Extracting the tar archive</li><li>Loading the Docker images from the saved .tar files</li><li>Starting the stack.</li></ol><p># Extract<br>tar -xvf iris-final-deploy.tar</p><p># Load Docker images<br>docker load -i iris-deploy/iris-v2.4.22-package.tar</p><p># Start IRIS<br>cd iris-deploy<br>docker compose up -d</p><p>Make the script executable:</p><pre>chmod +x installer.sh</pre><p>Now deployment on any new machine is a single command. This matters more than it sounds-when you’re responding to an incident at 2am, you don’t want to be manually typing Docker commands and second-guessing yourself.</p><h3>Why This Matters</h3><p>DFIR IRIS is a powerful platform, but getting it into a production-ready, portable state takes deliberate engineering work. By pinning to a specific version, packaging images for offline use, and scripting the install process, you end up with something that’s:</p><ul><li><strong>Reproducible- </strong>same result every time</li><li><strong>Portable- </strong>works in air-gapped environments</li><li><strong>Maintainable- </strong>easy to update to the next version by repeating the process with a new tag</li></ul><p>The extra effort upfront pays dividends when you’re deploying to a restricted environment or handing the setup off to another team member.</p><p>Have questions or want to share how you’ve set up IRIS in your environment? Drop a comment below.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6d933443dc6d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Secure SIEM-Ready OpenSearch Lab: Docker, HTTPS, Filebeat & Python in One Setup]]></title>
            <link>https://medium.com/@mudassirrana140/building-a-secure-siem-ready-opensearch-lab-docker-https-filebeat-python-in-one-setup-24c0ee1e3820?source=rss-28a64f83cb6d------2</link>
            <guid isPermaLink="false">https://medium.com/p/24c0ee1e3820</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[opensearch]]></category>
            <category><![CDATA[siem]]></category>
            <dc:creator><![CDATA[Mudassir]]></dc:creator>
            <pubDate>Fri, 12 Jun 2026 07:48:16 GMT</pubDate>
            <atom:updated>2026-06-12T07:48:16.137Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*ia4eBJeiKO2bOYMdgraaVw.png" /></figure><p><em>How I deployed a fully secured, single-node OpenSearch stack from scratch-with SSL, log shipping, RBAC, and cross-index data migration.</em></p><p>If you’ve ever tried to stand up a search and analytics environment that’s actually production-adjacent-not just a quick docker run throwaway-you know the rabbit hole it becomes. Ports conflict. Containers crash with cryptic errors. SSL feels like overkill until it isn&#39;t.</p><p>This post walks through exactly what I built: a single-node OpenSearch 2.19.5 deployment on Ubuntu 24.04.3 LTS using Docker Compose, with HTTPS enabled on the Dashboards interface, Filebeat shipping logs into it, role-based access control, and a Python script for cross-index data migration. Every step is documented because I ran into each failure myself.</p><h3>Why OpenSearch Over Elasticsearch?</h3><p>OpenSearch is the open-source fork of Elasticsearch maintained by AWS. It’s free, it ships with security features enabled by default (unlike the older open Elastic stack), and it’s increasingly the go-to choice for SIEM and observability pipelines in environments where licensing costs or audit requirements make commercial Elastic a non-starter.</p><h3>The Stack</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/201/1*8hKsBMvqXHjYFXPjxijZ8Q.png" /></figure><p>The architecture is straightforward: two containers (opensearch-node1 and opensearch-dashboards) on a private Docker bridge network, with a named volume for persistent data. The Dashboards container gets a self-signed SSL certificate mounted into it, turning the web interface from HTTP to HTTPS.</p><h3>Step 0: System Check</h3><p>Before touching Docker, I verified the host met OpenSearch’s minimum requirements:</p><ul><li><strong>RAM:</strong> 11 GB available (minimum 4 GB required)</li><li><strong>CPU:</strong> 8 cores (minimum 2)</li><li><strong>Disk:</strong> 133 GB free (minimum 20 GB)</li><li><strong>Ports 9200 and 5601:</strong> confirmed free</li></ul><p>I also had a native OpenSearch installation on the machine from a previous setup. Before containerizing, I stopped those services to free the ports:</p><p>sudo systemctl stop opensearch-dashboards.service<br>sudo systemctl stop opensearch.service</p><p>Note: I stopped them but didn’t remove them — preserving the original install as a fallback reference</p><h3>Step 1: Install Docker</h3><p>Docker was installed via the official convenience script, which auto-detects the OS:</p><p>curl -fsSL <a href="https://get.docker.com/">https://get.docker.com</a> -o get-docker.sh<br>sudo sh get-docker.sh</p><p># Allow running Docker without sudo<br>sudo usermod -aG docker $USER<br>newgrp docker</p><p>Result: Docker Engine 29.5.1 with Docker Compose plugin v2, both in a single install.</p><h3>Step 2: Generate the SSL Certificate</h3><p>This is where most guides cut corners and tell you to just skip HTTPS for the lab. I didn’t, because the whole point was a SIEM-ready environment. A self-signed cert is fine for internal use — browsers will warn, but the traffic is encrypted.</p><p>mkdir ~/opensearch-docker &amp;&amp; cd ~/opensearch-docker<br>mkdir certs</p><p>openssl req -x509 -nodes -days 365 -newkey rsa:2048 \<br> -keyout ~/opensearch-docker/certs/dashboard.key \<br> -out ~/opensearch-docker/certs/dashboard.crt \<br> -subj “/C=PK/ST=Islamabad/L=Islamabad/O=SIEM-Lab/CN=192.168.0.93”</p><p>The certificate is valid for one year. Two files are produced:</p><ul><li>dashboard.crt — the public certificate, world-readable</li><li>dashboard.key — the private key, owner-only (rw-------)</li></ul><p>For production, swap these out for a certificate from Let’s Encrypt or your internal CA.</p><h3>Step 3: The Docker Compose File</h3><p>Here’s the full docker-compose.yml:</p><p>services:<br> opensearch-node1:<br> image: opensearchproject/opensearch:2.19.5<br> container_name: opensearch-node1<br> environment:<br> — cluster.name=opensearch-cluster<br> — node.name=opensearch-node1<br> — discovery.type=single-node<br> — bootstrap.memory_lock=true<br> — OPENSEARCH_INITIAL_ADMIN_PASSWORD=&lt;your-password&gt;<br> — “OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m”<br> ulimits:<br> memlock:<br> soft: -1<br> hard: -1<br> nofile:<br> soft: 65536<br> hard: 65536<br> volumes:<br> — opensearch-data:/usr/share/opensearch/data<br> ports:<br> — 9200:9200<br> — 9600:9600<br> networks:<br> — opensearch-net</p><p>opensearch-dashboards:<br> image: opensearchproject/opensearch-dashboards:2.19.5<br> container_name: opensearch-dashboards<br> ports:<br> — 5601:5601<br> environment:<br> — OPENSEARCH_HOSTS=[“<a href="https://opensearch-node1:9200/">https://opensearch-node1:9200</a>&quot;]<br> — SERVER_SSL_ENABLED=true<br> — SERVER_SSL_CERTIFICATE=/usr/share/opensearch-dashboards/certs/dashboard.crt<br> — SERVER_SSL_KEY=/usr/share/opensearch-dashboards/certs/dashboard.key<br> volumes:<br> — ~/opensearch-docker/certs:/usr/share/opensearch-dashboards/certs<br> networks:<br> — opensearch-net<br> depends_on:<br> — opensearch-node1</p><p>volumes:<br> opensearch-data:</p><p>networks:<br> opensearch-net:</p><p>A few things worth calling out:</p><ul><li>discovery.type=single-node is critical — without it, OpenSearch waits for other nodes and never becomes healthy.</li><li>bootstrap.memory_lock=true with matching ulimits prevents the OS from swapping OpenSearch memory to disk, which would tank performance.</li><li>The Dashboards container uses depends_on to wait for the search node before starting.</li></ul><h3>Step 4: The Kernel Parameter Nobody Mentions</h3><p>This one will silently crash your OpenSearch container if you skip it:</p><p>sudo sysctl -w vm.max_map_count=262144</p><p># Make it permanent across reboots<br>echo ‘vm.max_map_count=262144’ | sudo tee -a /etc/sysctl.conf</p><p>OpenSearch uses memory-mapped files for its Lucene indices. The Linux kernel’s default vm.max_map_count of 65530 is far too low. The container just dies at startup without a clear error if you don&#39;t set this.</p><h3>Step 5: Launch and Verify</h3><p>docker compose up -d</p><p>After about 30–60 seconds, verify everything is healthy:</p><p># Check both containers are running<br>docker ps</p><p># Verify the OpenSearch API responds<br>curl -X GET <a href="https://localhost:9200/">https://localhost:9200</a> -u ‘admin:&lt;password&gt;’ — insecure</p><p># Check cluster health<br>curl -X GET “<a href="https://localhost:9200/_cluster/health?pretty">https://localhost:9200/_cluster/health?pretty</a>&quot; \<br> -u ‘admin:&lt;password&gt;’ — insecure</p><p>The cluster health response came back green across the board:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/532/1*uv8Am9Mfm1-N_l8jHQ1oAg.png" /></figure><p>The Dashboards interface was accessible at https://192.168.0.93:5601. The browser showed the expected &quot;Not Secure&quot; warning for the self-signed cert — click through, log in with admin credentials, and you&#39;re in.</p><h3>Step 6: Shipping Logs with Filebeat</h3><p>A search stack without data is just a fancy empty box. I configured Filebeat to ship logs into the instance.</p><p># Add the Elastic GPG key<br>wget -qO — <a href="https://artifacts.elastic.co/GPG-KEY-elasticsearch">https://artifacts.elastic.co/GPG-KEY-elasticsearch</a> \<br> | sudo gpg — dearmor -o /usr/share/keyrings/elasticsearch-keyring.gpg</p><p># Add the APT repository<br>echo “deb [signed-by=/usr/share/keyrings/elasticsearch-keyring.gpg] \<br> <a href="https://artifacts.elastic.co/packages/8.x/apt">https://artifacts.elastic.co/packages/8.x/apt</a> stable main” \<br> | sudo tee /etc/apt/sources.list.d/elastic-8.x.list</p><p># Install<br>sudo apt-get update<br>sudo apt-get install filebeat -y</p><p># Enable and start<br>sudo systemctl enable filebeat<br>sudo systemctl start filebeat</p><p>After configuring /etc/filebeat/filebeat.yml to point at the OpenSearch output, I created an index pattern in Dashboards (filebeat-* with @timestamp as the time field) and live log data started populating in the Discover view.</p><h3>Step 7: Role-Based Access Control</h3><p>OpenSearch ships with RBAC out of the box. I created a custom analyst-write role scoped to the filebeat-* index pattern with read, write, and create_index permissions — then mapped a user to it.</p><p>The principle here is least privilege: analysts get exactly what they need to do their job, nothing more. Role mappings take effect immediately; no restart required</p><h3>Step 8: Python Cross-Index Migration Script</h3><p>The final piece was a Python script to copy documents between indices-useful for archiving, replication, or migrating data between environments.</p><p>from opensearchpy import OpenSearch</p><p>HOST = ‘192.168.0.93’<br>PORT = 9200<br>USERNAME = ‘admin’<br>PASSWORD = ‘&lt;your-password&gt;’<br>SOURCE_INDEX = ‘source-index’<br>DEST_INDEX = ‘destination-index’</p><p>client = OpenSearch(<br> hosts=[{‘host’: HOST, ‘port’: PORT}],<br> http_auth=(USERNAME, PASSWORD),<br> use_ssl=True,<br> verify_certs=False,<br> ssl_show_warn=False<br>)</p><p>response = client.search(<br> index=SOURCE_INDEX,<br> body={‘query’: {‘match_all’: {}}, ‘size’: 1000}<br>)</p><p>hits = response[‘hits’][‘hits’]<br>print(f’[*] Retrieved {len(hits)} document(s) from “{SOURCE_INDEX}”’)</p><p>for hit in hits:<br> client.index(index=DEST_INDEX, id=hit[‘_id’], body=hit[‘_source’])</p><p>print(f’[+] Successfully copied {len(hits)} document(s) to “{DEST_INDEX}”’)</p><p>The script preserves original document IDs during migration. The size: 1000 limit works for moderate datasets — for larger indices, implement pagination with the scroll API or search_after.</p><p>Install the dependency with:</p><p>pip install opensearch-py</p><h3>Port Reference</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/527/1*MbYM1g80UL7tNtd6OvGlqQ.png" /></figure><h3>What I’d Change for Production</h3><ul><li>Replace the self-signed cert with one from Let’s Encrypt or an internal CA</li><li>Use Docker Secrets or a secrets manager instead of plaintext passwords in docker-compose.yml</li><li>Implement the scroll API in the migration script for indices with more than 1,000 documents</li><li>Add a multi-node cluster configuration for redundancy</li><li>Set up Curator or ISM policies for index lifecycle management</li></ul><h3>Wrapping Up</h3><p>The full stack — OpenSearch with HTTPS, containerized via Docker Compose, fed by Filebeat, with RBAC and Python-based data tooling — took a focused afternoon to stand up correctly. The gotchas (the kernel parameter, the SSL Dashboards wiring, the discovery.type flag) are the kind of things that eat hours if you&#39;re working from scattered documentation.</p><p>Hopefully this saves you some of that time.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=24c0ee1e3820" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Virtualized Firewall Lab: pfSense on ESXi from Scratch]]></title>
            <link>https://medium.com/@mudassirrana140/building-a-virtualized-firewall-lab-pfsense-on-esxi-from-scratch-d9522e3055e4?source=rss-28a64f83cb6d------2</link>
            <guid isPermaLink="false">https://medium.com/p/d9522e3055e4</guid>
            <dc:creator><![CDATA[Mudassir]]></dc:creator>
            <pubDate>Thu, 14 May 2026 15:12:06 GMT</pubDate>
            <atom:updated>2026-05-14T15:12:06.906Z</atom:updated>
            <content:encoded><![CDATA[<p>A hands-on walkthrough of deploying pfSense 2.8.1 in a VMware ESXi environment -from ISO upload to blocking social media with custom firewall rules.</p><h3>Why pfSense in a Virtual Lab?</h3><p>If you’re serious about learning network security, there’s no substitute for getting your hands dirty with a real firewall. pfSense is one of the most powerful open-source firewall/router platforms available — and running it inside a virtualized environment gives you a full-featured lab without needing dedicated hardware.</p><p>In this post, I’ll walk you through the exact steps we followed to deploy pfSense on a <strong>Dell PowerEdge R730XD</strong> running <strong>VMware ESXi 7.0</strong>, configure WAN/LAN interfaces, set up the web GUI, and implement and test real firewall rules — including a LAN rule that blocks social media sites.</p><p>Let’s get into it.</p><h3>The Lab Environment</h3><p>ComponentDetails</p><p><strong>Physical Server</strong>Dell PowerEdge R730XD</p><p><strong>Hypervisor</strong>VMware ESXi 7.0 Update 2</p><p><strong>Firewall OS</strong>pfSense 2.8.1</p><p><strong>WAN Network</strong>192.168.100.x (office network)</p><p><strong>LAN Network</strong>10.10.10.x (internal virtual subnet)</p><p><strong>Test Client</strong>Windows VM at 10.10.10.2</p><h3>Phase 1: Uploading the pfSense ISO to ESXi</h3><p>Before creating any virtual machine, the pfSense ISO needs to live on your ESXi datastore.</p><p>Navigate to <strong>Storage → Datastore Browser</strong> in the ESXi web UI and upload the pfSense ISO. This is straightforward but easy to skip — without the ISO on the datastore, you can’t attach it to a VM during creation.</p><blockquote><strong>Tip:</strong> Give the ISO a clean, versioned filename like pfSense-2.8.1-amd64.iso so you can easily identify it later when managing multiple images.</blockquote><h3>Phase 2: Creating the pfSense Virtual Machine</h3><p>With the ISO uploaded, it’s time to spin up the VM.</p><h3>Key VM Configuration Choices</h3><p>When running the <strong>New Virtual Machine</strong> wizard, a few settings matter most:</p><ul><li><strong>Guest OS Type:</strong> Select <em>Other (FreeBSD 64-bit)</em> — pfSense is based on FreeBSD, so this ensures ESXi applies the right optimizations.</li><li><strong>Storage:</strong> Allocate to datastore1 (or your preferred datastore).</li><li><strong>CPU &amp; Memory:</strong> Even modest resources work fine for a lab — 1–2 vCPUs and 1–2 GB RAM is sufficient.</li></ul><h3>The Critical Part: Two Network Adapters</h3><p>pfSense needs <strong>two</strong> virtual NICs:</p><ul><li><strong>vmx0 → WAN</strong> — bridged to your office/physical network (192.168.100.x)</li><li><strong>vmx1 → LAN</strong> — connected to an internal virtual switch (10.10.10.x)</li></ul><p>Getting this topology right from the start saves significant debugging later. The WAN adapter connects pfSense to the outside world; the LAN adapter is where your internal test machines will live.</p><h3>Attaching the ISO</h3><p>Before finalizing the VM, attach the pfSense ISO to the CD/DVD drive. This is how the VM boots into the installer on first power-on. Once installation is complete, you can detach it.</p><h3>Phase 3: Installing pfSense &amp; Configuring Interfaces</h3><p>Boot the VM and walk through the pfSense installer. The defaults work well for a lab setup.</p><h3>Interface Assignment via Console</h3><p>After installation, pfSense boots to a console menu. This is where you assign which physical adapter maps to which logical interface:</p><pre>Option 1: Assign Interfaces<br>  WAN → vmx0<br>  LAN → vmx1</pre><p>Then set your IP addresses:</p><ul><li><strong>WAN:</strong> 192.168.100.64/24 (static, on the office network)</li><li><strong>LAN:</strong> 10.10.10.1/24 (static, the gateway for your internal subnet)</li></ul><p>Once confirmed, the console displays both interfaces as active-your firewall is live.</p><h3>Phase 4: Standing Up a Windows Test VM</h3><p>To actually <em>test</em> firewall rules, you need a machine behind the firewall. We created a Windows VM in ESXi with:</p><ul><li>Network adapter connected to the <strong>LAN virtual switch</strong></li><li>Static IP: 10.10.10.2</li><li>Default gateway: 10.10.10.1 (pfSense LAN interface)</li></ul><p>This machine becomes our “user” -the one whose traffic we’ll be controlling with firewall rules.</p><h3>Phase 5: Accessing the pfSense Web GUI</h3><p>Accessing the pfSense Web GUI. pfSense’s WebConfigurator is a full-featured management interface accessible over HTTPS. Two access paths exist in our setup: Via WAN <a href="https://192.168.100.64/">https://192.168.100.64</a> Office laptop and Via LAN <a href="https://10.10.10.1/">https://10.10.10.1</a> Windows test VM.</p><h3>First-Time Setup Wizard</h3><p>On first login (default credentials: admin / pfsense), the setup wizard guides you through:</p><ol><li>Assigning static IP, subnet mask, and gateway for the WAN interface</li><li>Configuring the LAN interface</li><li><strong>Changing the admin password</strong> -don’t skip this in any environment, even a lab</li><li>Reloading the configuration</li></ol><p><strong>Security note:</strong> Always change default credentials immediately. Even in an isolated lab, building the habit matters.</p><h3>Phase 6: Implementing Firewall Rules</h3><p>This is where pfSense starts earning its reputation. We implemented two rules to cover the most common real-world scenarios.</p><h3>Rule 1-WAN: Allow GUI Access</h3><p>By default, pfSense blocks external access to the management interface. We added a WAN rule to allow HTTPS management from the office network:</p><p>Action: Pass<br>Interface: WAN<br>Protocol: TCP<br>Destination: WAN Address<br>Port: 443<br>Description: Allow WebGUI WAN Access</p><p>We also unchecked <strong>Block private networks</strong> and <strong>Block bogon networks</strong> on the WAN interface -necessary since our “WAN” is actually an internal office network, not a true public internet connection.</p><h3>Rule 2 -LAN: Block Social Media</h3><p>First, we created a <strong>firewall alias</strong> called BlockedSites containing:</p><ul><li>facebook.com</li><li>youtube.com</li><li>twitter.com</li></ul><p>Aliases in pfSense are a clean way to group hosts/networks/ports and reference them across multiple rules — much easier to maintain than hardcoding destinations.</p><p>Then we added the LAN block rule:</p><pre>Action:      Block<br>Interface:   LAN<br>Source:      10.10.10.2 (test VM)<br>Destination: BlockedSites alias<br>Description: Block Social Media<br><br></pre><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*U58xhhAOHa2Os2Ji0dCwwQ.jpeg" /></figure><h3>Phase 7: Testing &amp; Verification</h3><p>The rules are only as good as the results. We verified both rules from the Windows test VM (10.10.10.2):</p><ul><li>Attempting to load <strong>twitter.com</strong> → ❌ Not accessible</li><li>Attempting to load <strong>facebook.com</strong> → ❌ Not accessible</li></ul><p>We also reviewed the <strong>pfSense firewall logs</strong> to confirm the block rule was actively matching and logging the traffic — a critical step often skipped in lab setups but essential for understanding how your rules behave in production.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*NrM8EmnI9OI7j3SvYJgkWg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*uUynRcQgIxYX_ON7H_NQdQ.jpeg" /></figure><h3>Summary of What We Built</h3><p>✅ pfSense 2.8.1 deployed as a VM on Dell PowerEdge R730XD (ESXi 7.0)<br> ✅ WAN interface: 192.168.100.64/24 (office network)<br> ✅ LAN interface: 10.10.10.1/24 (internal subnet)<br> ✅ Web GUI accessible from both WAN and LAN<br> ✅ WAN rule: HTTPS management access from office network<br> ✅ Firewall alias: BlockedSites (facebook.com, youtube.com, twitter.com)<br> ✅ LAN block rule: Social media inaccessible from test VM<br> ✅ Rules verified via live testing and log review</p><h3>What’s Next?</h3><p>This lab setup gives you a solid foundation to explore more advanced pfSense features:</p><ul><li><strong>VLANs</strong> -segment your internal network further</li><li><strong>Snort/Suricata</strong> -add intrusion detection to your firewall</li><li><strong>OpenVPN</strong> -set up a site-to-site or remote access VPN</li><li><strong>Traffic shaping</strong> -apply QoS policies to prioritize or throttle traffic</li><li><strong>pfBlockerNG</strong> -DNS-based ad and threat blocking</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d9522e3055e4" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>