<?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 Sriranjan Kapilan on Medium]]></title>
        <description><![CDATA[Stories by Sriranjan Kapilan on Medium]]></description>
        <link>https://medium.com/@sriranjankapilan?source=rss-6d90a6f9489e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*0U5N6Yk-ACxX26WBOuHebA@2x.jpeg</url>
            <title>Stories by Sriranjan Kapilan on Medium</title>
            <link>https://medium.com/@sriranjankapilan?source=rss-6d90a6f9489e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 06:55:51 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sriranjankapilan/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[Wazuh for Sysadmins: One Dashboard for Every Server and Laptop]]></title>
            <link>https://medium.com/@sriranjankapilan/wazuh-for-sysadmins-one-dashboard-for-every-server-and-laptop-7987c966f7d5?source=rss-6d90a6f9489e------2</link>
            <guid isPermaLink="false">https://medium.com/p/7987c966f7d5</guid>
            <category><![CDATA[siem]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[wazuh]]></category>
            <category><![CDATA[system-administration]]></category>
            <dc:creator><![CDATA[Sriranjan Kapilan]]></dc:creator>
            <pubDate>Sun, 18 Oct 2026 16:36:39 GMT</pubDate>
            <atom:updated>2026-10-18T16:36:39.964Z</atom:updated>
            <content:encoded><![CDATA[<p>Wazuh is a free, open-source security platform that unifies SIEM (Security Information and Event Management) and XDR (Extended Detection and Response) in a single stack. It gives system administrators one place to collect logs, detect threats, check configurations, find vulnerable packages and respond to incidents across every server, virtual machine, cloud instance and laptop they manage.</p><p>This article is written for system administrators and DevOps engineers. It explains what problem Wazuh solves, how its components fit together, what each component does, and how to get a working deployment running with Docker.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fMfmrd2qLJEW9K-_Jkgulw.png" /></figure><h3>The problem: life before Wazuh</h3><p>Without a central security platform, every machine is its own island. Logs, alerts and configuration drift stay on the host where they happen, and an administrator only sees them after logging in and looking.</p><p>A typical environment without Wazuh looks like this:</p><ul><li><strong>Scattered logs.</strong> Linux servers write to /var/log and journald, Windows machines to the Event Log, macOS to the unified log. Investigating an incident means SSH or RDP into each machine and running grep, journalctl or Event Viewer by hand.</li><li><strong>No correlation.</strong> A failed SSH login on one server, a new admin account on a Windows host and an outbound connection from a laptop may be one attack. Viewed separately, none of them looks serious.</li><li><strong>Late detection.</strong> Problems are found when a user complains, a disk fills up or an outside party reports a breach, often days after the first sign was logged.</li><li><strong>Tool sprawl.</strong> File integrity needs one tool (AIDE, Tripwire), hardening audits another (Lynis, OpenSCAP), vulnerability scanning a third, and log shipping a fourth. Each has its own configuration, output format and gaps.</li><li><strong>Manual compliance.</strong> Proving PCI DSS, GDPR or HIPAA controls means collecting evidence from each system by hand before every audit.</li><li><strong>High cost of the alternative.</strong> Commercial SIEM and XDR products solve much of this, but their licensing (often per GB ingested or per endpoint) is out of reach for many small and mid-sized teams.</li></ul><p>Wazuh addresses these points by putting a lightweight agent on every endpoint and sending everything to one central server for analysis, storage and display.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0EwkjhrXm0HDRiBitf-FOw.png" /></figure><h3>Key concepts: SIEM and XDR</h3><p>Wazuh combines two categories of security tooling. Knowing what each one does makes the rest of the architecture easier to follow.</p><h3>SIEM: Security Information and Event Management</h3><p>A SIEM collects logs and events from many systems into one place, normalises them, and analyses them against rules to produce alerts. It also keeps the data for search, investigation and compliance reporting.</p><p>In short, a SIEM answers: <em>what happened, where, and when?</em></p><h3>XDR: Extended Detection and Response</h3><p>XDR extends Endpoint Detection and Response (EDR) beyond a single endpoint. It brings together telemetry from several layers:</p><ul><li>Endpoints (servers, desktops, laptops, virtual machines)</li><li>Network devices and network traffic</li><li>Cloud services and workloads</li><li>Threat intelligence feeds</li></ul><p>An XDR platform:</p><ul><li>Detects attacks across these layers rather than on one host at a time</li><li>Correlates related events automatically into a single picture</li><li>Gives faster, more accurate detection with fewer false positives</li><li>Responds automatically, for example by blocking an IP address, killing a process or isolating a device</li></ul><p>In short, XDR answers: <em>is this an attack, and what should be done about it right now?</em></p><h3>How Wazuh fits</h3><p>Wazuh delivers SIEM functions (log collection, rule-based analysis, storage, dashboards, compliance reporting) and XDR functions (endpoint telemetry, cloud monitoring, threat intelligence, MITRE ATTACK mapping and automated active response). Network-layer visibility usually comes from ingesting logs of firewalls, IDS sensors (for example Suricata) and network devices via syslog, rather than from Wazuh inspecting traffic itself.</p><h3>Wazuh Architecture</h3><p>Wazuh has one endpoint component, the agent, and three central components: the server, the indexer and the dashboard. The central components can run on a single host for small environments or be split and clustered for scale and high availability.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PwypOpvo582_DpR2SigacA.png" /></figure><h3>Wazuh agent</h3><p>The agent is a lightweight, multi-platform program that runs on each endpoint. Its modules are,</p><p>. Log collector — Reads log files, Windows Event Log channels, journald and command output, and forwards them to the server.</p><p>.Command execution — Runs authorised commands periodically and sends their output for analysis</p><p>.File integrity monitoring (FIM) — Watches files, directories and (on Windows) registry keys; reports creation, modification and deletion with hashes, owner and permissions, and can record who made the change.</p><p>.Malware detection — Rootcheck looks for rootkits, hidden processes and anomalies; integrations such as YARA, ClamAV and VirusTotal extend this.</p><p>. Security configuration assessment (SCA) — Checks the host against hardening policies, mostly based on CIS benchmarks</p><p>. System inventory (Syscollector) — Collects installed packages, running processes, open ports, network interfaces, hardware and OS details.</p><p>.Container security monitoring — Monitors Docker events (container start, stop, pause and image changes) through the Docker listener</p><p>. Cloud security monitoring — Pulls security logs from AWS, Azure, Google Cloud, Microsoft 365 and GitHub; these modules can also run on the server.</p><p>. Active response — Executes response scripts on the endpoint, such as blocking an IP with the firewall or disabling an account.</p><h3>Wazuh server (manager)</h3><p>The server receives data from agents and syslog sources, analyses it, and decides what becomes an alert. Its internal services are:</p><ul><li><strong>Agent enrollment service</strong> (wazuh-authd): registers new agents and issues their keys.</li><li><strong>Agent connection service</strong> (wazuh-remoted): receives encrypted agent traffic and pushes centralised configuration back to agents.</li><li><strong>Analysis engine</strong> (wazuh-analysisd): decodes each event, then matches it against thousands of built-in and custom rules. Each rule has a level from 0 to 15.</li><li><strong>Wazuh RESTful API</strong>: lets the dashboard and external tools manage agents, rules and configuration.</li><li><strong>Cluster daemon</strong>: synchronises configuration and agent data between server nodes in a multi-node deployment.</li><li><strong>Filebeat</strong>: ships generated alerts (and optionally archived events) to the Wazuh indexer over TLS.</li></ul><p>On top of these services, the server provides:</p><ul><li><strong>Threat intelligence</strong>: matching against IoC lists (CDB lists) and lookups such as VirusTotal.</li><li><strong>MITRE ATTACK mapping</strong>: rules are tagged with <strong>ATTACK </strong>tactics and techniques, so alerts show which stage of an attack they belong to.</li><li><strong>Vulnerability detection</strong>: since Wazuh 4.8 this runs on the server. It compares the software inventory reported by agents against the Wazuh CTI vulnerability feed, which aggregates vendor and NVD data.</li><li><strong>Integrations</strong> (wazuh-integratord): forwards alerts to Slack, PagerDuty, Shuffle, VirusTotal or custom webhooks.</li><li><strong>Endpoint state</strong>: keeps each agent’s status, inventory and FIM baseline in its local databases (wazuh-db).</li><li><strong>Regulatory compliance mapping</strong>: rules are tagged for PCI DSS, GDPR, HIPAA, NIST 800–53, TSC and other frameworks, so compliance reports can be generated directly.</li></ul><h3>Wazuh indexer</h3><p>The indexer is a full-text search and analytics engine based on OpenSearch. It stores alerts and events as JSON documents and makes them searchable in near real time. Key concepts:</p><ul><li><strong>Cluster</strong>: one or more indexer nodes working together. Production setups typically use three or more nodes for resilience.</li><li><strong>Index</strong>: a collection of related documents. Wazuh creates daily indices with patterns such as wazuh-alerts-4.x-* (alerts), wazuh-archives-4.x-* (all events, if archiving is enabled), wazuh-monitoring-* (agent status) and wazuh-states-vulnerabilities-* (vulnerability state).</li><li><strong>Shard</strong>: each index is split into shards so data can be spread across nodes. <strong>Primary shards</strong> hold the original data; <strong>replica shards</strong> are copies on other nodes that protect against node failure and help serve searches.</li></ul><h3>Wazuh dashboard</h3><p>The dashboard is the web interface, based on OpenSearch Dashboards. It reads alert data from the indexer and talks to the Wazuh server API for management tasks. From it, administrators can:</p><ul><li>View and search alerts, and drill into events by agent, rule, MITRE technique or compliance requirement</li><li>Use ready-made views for FIM, SCA, vulnerabilities, threat hunting and compliance</li><li>Deploy and manage agents, and edit rules, decoders and configuration</li><li>Control access with role-based access control (RBAC) and single sign-on.</li></ul><h3>How the components work together</h3><p>Every event follows the same path: endpoint, server, indexer, dashboard. The server is the only component that endpoints talk to.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/857/1*cGjIb5QX-tX5-AwL1Wu5Lw.png" /></figure><p>Agents push events to the server, which decides what becomes an alert and can send active-response commands back. Alerts flow on to the indexer, and the dashboard reads them from there while using the server API for management.</p><h3>Step by step</h3><ol><li><strong>Collect.</strong> The agent gathers log lines, FIM changes, inventory, SCA results and other telemetry on the endpoint.</li><li><strong>Send.</strong> After enrolling on port 1515/TCP, the agent sends events to the server over 1514/TCP, compressed and encrypted (AES by default). Devices without an agent send syslog instead.</li><li><strong>Analyse.</strong> The analysis engine decodes each event and matches it against rules. Inventory and state go to the server’s local databases, and vulnerability detection runs against that inventory.</li><li><strong>Alert and respond.</strong> Events that match a rule at or above the alert threshold (level 3 by default) become alerts. A rule can also trigger active response on the endpoint or forward the alert to an integration such as Slack.</li><li><strong>Store.</strong> Filebeat on the server ships alerts to the indexer over 9200/TCP, where they land in daily wazuh-alerts-4.x-* indices.</li><li><strong>Display.</strong> The dashboard queries the indexer for alerts and calls the server API on 55000/TCP for agent management and configuration. Administrators reach the dashboard over HTTPS on 443/TCP.</li></ol><h3>Default ports</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/912/1*rm7bEtU6guUoORfy-wGjEA.png" /></figure><h3>Life after Wazuh: one view of every device</h3><p>With Wazuh in place, every endpoint reports to the same server, whatever its operating system or where it runs. The administrator works from one dashboard instead of logging in to each machine.</p><h3>What gets connected</h3><ul><li><strong>Physical servers</strong> in a data centre or office, running Linux or Windows Server</li><li><strong>Virtual machines</strong> on Proxmox, VMware, Hyper-V or KVM</li><li><strong>Cloud instances</strong> on AWS, Azure, Google Cloud or any VPS provider</li><li><strong>Desktops and laptops</strong> running Windows, macOS or Linux, including remote staff machines</li><li><strong>Container hosts</strong> running Docker</li><li><strong>Network devices and appliances</strong> (firewalls, routers, switches) through syslog, without an agent</li></ul><h3>How an endpoint is connected</h3><p>The Wazuh dashboard has a <strong>Deploy new agent</strong> wizard that generates the exact install command for each platform. The pattern is the same everywhere:</p><ol><li>Install the agent package for the platform (.deb or .rpm on Linux, .msi on Windows, .pkg on macOS), setting the server address with the WAZUH_MANAGER variable.</li><li>The agent enrols with the server on port 1515/TCP and receives a unique key.</li><li>Start the agent service (systemctl start wazuh-agent on Linux, NET START Wazuh on Windows, /Library/Ossec/bin/wazuh-control start on macOS).</li><li>The agent connects to the server on port 1514/TCP and appears as <strong>Active</strong> in the dashboard within a minute or two.</li></ol><p>The endpoint only needs outbound access to the server; no inbound ports are opened on the endpoint itself. This is what makes it practical for laptops that move between networks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o2Ubwc42hc9WDBNMkY-fjw.png" /></figure><h3>Getting started with Docker</h3><p>The quickest way to try Wazuh is the official single-node Docker deployment, which runs the server, indexer and dashboard as three containers on one host. Follow the <a href="https://documentation.wazuh.com/current/deployment-options/docker/wazuh-container.html">official Docker guide</a> for the full and current procedure; the steps below are a summary.</p><h3>Requirements</h3><ul><li>Docker Engine and Docker Compose installed</li><li>At least 4 CPU cores and 8 GB of RAM for a test deployment</li><li>On Linux, a raised memory-map limit for the indexer</li></ul><pre>sudo sysctl -w vm.max_map_count=262144</pre><p>Deployment using docker</p><pre># Clone the repository at the release tag you want (4.14.7 was current at the time of writing)<br>git clone https://github.com/wazuh/wazuh-docker.git -b v4.14.7<br>cd wazuh-docker/single-node<br><br># Generate the TLS certificates used between the components<br>docker compose -f generate-indexer-certs.yml run --rm generator<br><br># Start the stack<br>docker compose up -d</pre><p>The indexer takes a minute or two to initialise on first start.</p><h3>First login</h3><p>Open <a href="https://localhost/"><strong>https://localhost</strong></a> (port 443) in a browser. The connection uses a self-signed certificate, so the browser will show a warning on first visit. Log in with the default credentials from the Docker guide:</p><ul><li>Username: admin</li><li>Password: SecretPassword</li></ul><p>These defaults are public. Change them before the deployment is reachable from any network other than your own machine; the Docker guide documents the password-change procedure.</p><p>From here, use <strong>Deploy new agent</strong> in the dashboard to connect your first endpoint.</p><h3>Conclusion</h3><p>Wazuh turns a collection of isolated machines into one monitored environment. A lightweight agent on each server, VM, cloud instance and laptop feeds a central server that analyses events, maps them to MITRE ATT&amp;CK and compliance frameworks, stores them in a searchable indexer, and presents them in one dashboard. For system administrators, that replaces hours of manual log searching, scattered audit tools and late detection with continuous, centralised visibility, at no licence cost.</p><p>The best way to learn it is to deploy the Docker stack, enrol two or three agents on different operating systems, and watch what the dashboard shows when you change a monitored file or fail an SSH login a few times.</p><h3>References</h3><ul><li><a href="https://documentation.wazuh.com/current/">Wazuh documentation</a> — official reference for all components</li><li><a href="https://documentation.wazuh.com/current/release-notes/">Wazuh release notes</a> — version history and changes</li><li><a href="https://documentation.wazuh.com/current/deployment-options/docker/wazuh-container.html">Deploying Wazuh with Docker</a> — the deployment used in this article</li><li><a href="https://github.com/wazuh/wazuh-docker">wazuh-docker on GitHub</a> — Docker Compose files and certificates generator</li><li><a href="https://attack.mitre.org/">MITRE ATT&amp;CK</a> — the adversary tactics and techniques framework Wazuh maps alerts to</li><li><a href="https://www.cisecurity.org/cis-benchmarks">CIS Benchmarks</a> — the hardening standards behind most SCA policies</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7987c966f7d5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Conversational AI Architectures Work: Inside the System Design of Modern AI Agents]]></title>
            <link>https://medium.com/@sriranjankapilan/how-conversational-ai-architectures-work-inside-the-system-design-of-modern-ai-agents-2e8d8008fe11?source=rss-6d90a6f9489e------2</link>
            <guid isPermaLink="false">https://medium.com/p/2e8d8008fe11</guid>
            <category><![CDATA[design-systems]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[large-language-models]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Sriranjan Kapilan]]></dc:creator>
            <pubDate>Wed, 05 Aug 2026 11:00:11 GMT</pubDate>
            <atom:updated>2026-08-05T11:00:11.421Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qm1gcBJ-9Pdh9f6adES0Sg.png" /><figcaption>Inside Conversational AI Agent System Architecture</figcaption></figure><p>When you ask an AI like ChatGPT, Claude, or Gemini to recall a preference you mentioned weeks ago or to continue a multi-page code refactoring session, it feels as if you are interacting with a conscious, continuous entity. In reality, Large Language Models (LLMs) are entirely stateless inference engines. They have no innate memory, no awareness of time and no persistent state between API calls.</p><p>To bridge the gap between a raw stateless text predictor and a persistent digital collaborator, systems engineers build a sophisticated orchestrator around the LLM. Drawing from deep system design breakdowns of AI agent architectures, this article provides a complete reference guide to how conversational AI applications bundle context, optimise token limits, and leverage three-tiered long-term memory architectures to deliver seamless personalisation.</p><h4>1. The Stateless Inference Engine: Tokens, Windows and Rules</h4><p>At the lowest level of any conversational AI platform sits the <strong>Inference Engine</strong>. Every time you press “Send,” the platform executes a fresh, isolated computation. Understanding this execution requires four core technical concepts:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fKYFsbYUyGVSEkRM7gJCdA.png" /><figcaption>Stateless LLM Inference Engine Data Flow</figcaption></figure><ul><li><strong>Tokens (The Atomic Unit):</strong> LLMs do not process words or characters directly; they process tokens. One token represents roughly 3 to 4 characters of English text (or ~0.75 words). For example, the string &quot;System Design&quot; breaks into two tokens: [&quot;System&quot;, &quot; Design&quot;].</li><li><strong>Token Limit:</strong> The maximum number of tokens a model can accept and generate in a single operation.</li><li><strong>Context Window:</strong> The total operational workspace available in RAM during a single request. Everything the model needs to know your prompt, history, developer rules and retrieved background data must fit inside this window simultaneously.</li><li><strong>System Prompt:</strong> Behind-the-scenes instructions configured by developers to set the agent’s persona and guardrails (e.g., <em>“Act as a senior Python developer. Keep explanations concise and always prioritise security best practices.”</em>).</li></ul><h4>2. Ephemeral State Processing: The Request Lifecycle</h4><p>Because an LLM cannot natively remember past turns in a conversation, the application backend must dynamically reconstruct the conversation history on <strong>every single turn</strong>. This pipeline operates in active working memory (RAM) and is discarded immediately after rendering the output unless saved to persistent storage.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dc7VrdHAnfVSmCYNawS_Dg.png" /><figcaption>LLM Data Flow and Memory Optimization</figcaption></figure><h4>Step 1: Input Bundling</h4><p>When a user submits a query, the system constructs an <strong>Input Bundle</strong> combining:</p><ol><li>The <strong>System Prompt</strong> (behavioural directives).</li><li>The <strong>Current Chat History</strong> (previous back-and-forth messages in the active session).</li><li>The <strong>User Query</strong> (the fresh prompt).</li></ol><h4>Step 2: Working Memory Verification</h4><p>The bundled payload is stored in <strong>Working Memory</strong> (context RAM) and measured against the LLM’s maximum token capacity.</p><h4>Step 3: Token Window Optimization</h4><p>If a conversation runs too long, the payload will exceed the context window limit. To prevent application failure, a <strong>Token Window Optimizer</strong> intercepts the bundle:</p><ul><li>A smaller, high-speed LLM reads the older chat history.</li><li>It compresses lengthy historical turns into a high-density summary.</li><li>The original word-for-word history is swapped for this compact summary, reducing token consumption while preserving critical conversational context.</li></ul><h4>Step 4: Inference Execution</h4><p>The optimized, size-compliant bundle is passed to the primary LLM, which processes the context and streams the generated response back to the user interface.</p><h4>3. The 3 Long-Term Memory Layers</h4><p>To provide persistence across days, months, and distinct sessions, modern AI architectures attach three specialized memory systems outside the core inference engine:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cTXHDdGrmDNmOaBfTj1WuQ.png" /><figcaption>Understanding Three AI Memory Layers</figcaption></figure><h4>Layer 1: Procedural Memory (“How to Act”)</h4><p>Procedural memory dictates the operational rules, safety boundaries, and task execution logic.</p><ul><li><strong>Guardrails:</strong> Hardened rules that block unauthorized actions (e.g., rejecting requests for sensitive credentials or preventing prompt injections).</li><li><strong>Agent Skills:</strong> Modular instruction files (frequently written in Markdown). For example, an AI agent configured for frontend web development loads a procedural “skill file” instructing it to default to React, Tailwind CSS, and strict TypeScript types.</li></ul><h4>Layer 2: Semantic Memory (“Facts &amp; Preferences”)</h4><p>Semantic memory manages structured knowledge about the user across multiple sessions.</p><ul><li><strong>User Profile Data:</strong> Explicit facts entered into settings (e.g., job title, location, custom instructions).</li><li><strong>Implicit Fact Extraction:</strong> As you converse with the agent, background tasks evaluate your inputs to learn implicit habits (e.g., <em>“User prefers concise code snippets without lengthy prose”</em>).</li><li><strong>Fact Consolidation:</strong> Every $N$ chats (e.g., after 5 new sessions), a background worker model analyzes recent logs, extracts updated user facts, and updates the user’s permanent profile in a <strong>Vector Database</strong>.</li></ul><h4>Layer 3: Episodic Memory (“The Event Vault”)</h4><p>Episodic memory stores the historical timeline of past interactions, anchored to exact timestamps and session identifiers.</p><ul><li><strong>Dual-Database Architecture:</strong></li></ul><p>◆ <strong>Relational Database (PostgreSQL):</strong> Stores exact, raw text records of every prompt and response linked to User IDs and Session IDs.</p><p>◆ <strong>Vector Database:</strong> Converts text into numerical embeddings, allowing conceptual search across historical logs.</p><ul><li><strong>Retrieval-Augmented Generation (RAG):</strong> When you ask, <em>“What were the deployment steps we worked on last Tuesday?”</em>, a RAG engine queries the vector database, extracts the most relevant past conversation segments (<strong>Top-K chunks</strong>), and injects them into the Working Memory for the main model to read.</li></ul><h4>4. End-to-End System Blueprint: The Complete Data Flow</h4><p>When all these components are combined, every user query triggers a synchronized execution pipeline across retrieval engines, memory layers, token optimizers and storage syncs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SG1IvT6v7OLrlRYawcfemQ.png" /><figcaption>Complete System Architecture for AI Agents</figcaption></figure><ul><li><strong>RAG Retrieval:</strong> The user’s query triggers a semantic search against <strong>Semantic Memory</strong> (for profile facts) and <strong>Episodic Memory</strong> (for past context).</li><li><strong>Input Bundling:</strong> The <strong>Input Bundler</strong> merges system rules (<strong>Procedural Memory</strong>), retrieved RAG chunks, active chat history, and the new query.</li><li><strong>Context Optimization:</strong> The <strong>Token Window Optimizer</strong> verifies payload size against the model’s context window limit, summarizing older turns if necessary.</li><li><strong>Model Inference:</strong> The stateless <strong>Main LLM</strong> processes the complete payload and streams the generated output.</li><li><strong>Dual Storage Synchronization:</strong> The text response is saved to a <strong>Relational SQL Database</strong> (for exact transcript history) and indexed into a <strong>Vector Database</strong> (for semantic retrieval).</li><li><strong>Background Consolidation:</strong> A background process asynchronously updates the user’s permanent fact profile in <strong>Semantic Memory</strong>, ensuring the agent continuously adapts over time.</li></ul><h4>Conclusion</h4><p>The seamless, human-like continuity of modern conversational AI is ultimately an architectural illusion powered by elegant systems engineering. Large Language Models themselves remain stateless mathematical functions, but when wrapped in an orchestration layer that balances ephemeral working memory, token window optimization, and a three-tiered long-term memory framework procedural guardrails, semantic profiles, and episodic event vaults they transform into persistent, context-aware digital collaborators.</p><p>As AI platforms evolve toward autonomous agency, master design patterns like context bundling, RAG retrieval pipelines, and asynchronous memory consolidation will become fundamental primitives for developers. Building state-of-the-art AI applications is no longer just about prompting a larger model; it is about designing distributed systems that efficiently give a stateless engine the power to learn, adapt, and remember.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2e8d8008fe11" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Get Real Time Google Chat Notifications for Website Outages with Checkmk 2.4]]></title>
            <link>https://medium.com/@sriranjankapilan/how-to-get-real-time-google-chat-notifications-for-website-outages-with-checkmk-2-4-664ab8908a0b?source=rss-6d90a6f9489e------2</link>
            <guid isPermaLink="false">https://medium.com/p/664ab8908a0b</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[check-mk]]></category>
            <category><![CDATA[google-chat]]></category>
            <category><![CDATA[website-monitoring]]></category>
            <category><![CDATA[monitoring]]></category>
            <dc:creator><![CDATA[Sriranjan Kapilan]]></dc:creator>
            <pubDate>Sun, 26 Apr 2026 07:52:13 GMT</pubDate>
            <atom:updated>2026-04-26T07:52:13.274Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8uaiMEwEn-YH7w9Jc3N3gQ.png" /><figcaption>Instant website outage notifications in Google Chat.</figcaption></figure><p>In a digital landscape where every second of downtime bleeds revenue and erodes customer trust, the silence of your monitoring system isn’t a sign of stability it’s a ticking time bomb.</p><p>Imagine your business website hitting a <strong>502 Bad Gateway</strong> or an expired SSL certificate locking out thousands of users and you only find out hours later through a frustrated support ticket. While traditional email alerts are easily buried in an overflowing inbox, integrating <a href="https://medium.com/@sriranjankapilan/from-zero-to-alerts-a-hands-on-guide-to-checkmk-monitoring-45d3c5f669d6"><strong>Checkmk 2.4</strong></a> directly into <strong>Google Chat</strong> provides the definitive solution: real-time, high-priority notifications exactly where your team already collaborates.</p><p>In this comprehensive guide, we transform your monitoring from a passive dashboard into a proactive first responder. We will walk you through building a high-performance pipeline on <strong>Debian 12 </strong>from configuring intelligent “dummy” hosts to deploying a custom Python bridge for Google Chat Webhooks. The result is a professional grade infrastructure that works for you, triggers instant push notifications during incidents and hands you total control over your digital presence.</p><h4>🔹 Phase 1: Creating a “Logic Container” for Your Websites</h4><p>Checkmk organizes everything around “Hosts.” Since we are monitoring external URLs rather than a physical server, we start by creating a “Dummy Host” to act as a container for our web checks.</p><ol><li><strong>Add a New Host</strong>: Go to <strong>Setup &gt; Hosts &gt; Add host</strong>.</li><li><strong>Hostname</strong>: Use a descriptive name like External_Websites.</li><li><strong>Network Address</strong>:</li></ol><ul><li>Set <strong>IP address family</strong> to <strong>No IP</strong>.</li><li>Set <strong>Checkmk agent / API integrations</strong> to <strong>No API integrations, no Checkmk agent</strong>.</li></ul><p><strong>4. Host Check Command</strong>: Under monitoring rules, set the Host Check Command to <strong>Always assume host is up</strong>. This ensures your dashboard stays green even if the “dummy” has no IP to ping.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ClXIFR6Mm11HLTCIJDd9xQ.png" /><figcaption>create host</figcaption></figure><h4>🔹 Phase 2: Configuring the “Check HTTP Web Service”</h4><p>Now, we tell Checkmk which URLs to probe. We use the modern <strong>Check HTTP web service</strong> rule.</p><ol><li><strong>Create the Rule</strong>: Navigate to <strong>Setup &gt; Services &gt; HTTP, TCP, email, … &gt; Check HTTP web service</strong>.</li><li><strong>Define Endpoints</strong></li></ol><ul><li><strong>Service Name</strong>: Give it a clear label (e.g., HTTPS Homeit Health).</li><li><strong>URL</strong>: Enter the full address (e.g., <a href="https://homeit-system.com/de).">https://homeit-system.com/de).</a></li><li><strong>Connection Buildup</strong>: Select <strong>Use any network address</strong> for the IP family to ensure flexibility between IPv4 and IPv6.</li></ul><p><strong>3. Advanced Settings</strong>:</p><ul><li><strong>Expected Status Code</strong>: Set this to <strong>200</strong>. Anything else will trigger a CRITICAL alert.</li><li><strong>SSL/TLS</strong>: Enable <strong>Check SSL Certificate Age</strong> to get warned 30 days before your certificate expires.</li></ul><p><strong>4. Conditions</strong>: Assign this rule to your External_Websites host.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gHy5Mz3KVslXqdzn7tAJAA.png" /><figcaption>create HTTP Web Service</figcaption></figure><h4>🔹 Phase 3: The Secret Sauce The Google Chat Python Script</h4><p>Checkmk doesn’t have a native Google Chat button, but it allows <strong>Custom Notification Scripts</strong>. We will write a bridge between Checkmk’s environment variables and Google’s Webhook API.</p><ol><li><strong>Generate a Webhook</strong>: In your Google Chat Space, go to <strong>Apps &amp; integrations &gt; Manage webhooks</strong> and copy your unique URL.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mF92SbdpyjjOjkaYC74DiA.png" /></figure><p><strong>2. Access the Server</strong>: SSH into your Checkmk server and navigate to the local notifications directory:</p><p>cd /omd/sites/monitoring/local/share/check_mk/notifications/</p><p><strong>3. Create the Script</strong>: Create a file named google_chat.py</p><pre>#!/usr/bin/env python3<br>import os<br>import json<br>import requests<br><br>def main():<br>    # Retrieve the Webhook URL from the Checkmk Rule Parameter<br>    webhook_url = os.environ.get(&quot;NOTIFY_PARAMETER_1&quot;)<br>    <br>    # Capture alert details from Checkmk environment variables<br>    host = os.environ.get(&quot;NOTIFY_HOSTNAME&quot;)<br>    state = os.environ.get(&quot;NOTIFY_SERVICESTATE&quot;) or os.environ.get(&quot;NOTIFY_HOSTSTATE&quot;)<br>    service = os.environ.get(&quot;NOTIFY_SERVICEDESC&quot;, &quot;Host Check&quot;)<br>    output = os.environ.get(&quot;NOTIFY_SERVICEOUTPUT&quot;) or os.environ.get(&quot;NOTIFY_HOSTOUTPUT&quot;)<br>    <br>    # Assign emojis for visual clarity<br>    emoji = &quot;✅&quot; if state in [&quot;OK&quot;, &quot;UP&quot;] else &quot;❌&quot; if state in [&quot;CRITICAL&quot;, &quot;DOWN&quot;] else &quot;⚠️&quot;<br><br>    # Construct the JSON payload<br>    message = {<br>        &quot;text&quot;: f&quot;{emoji} *{state}* - {host}\n*Service:* {service}\n*Detail:* {output}&quot;<br>    }<br>    <br>    # Dispatch the notification<br>    requests.post(webhook_url, data=json.dumps(message), headers={&#39;Content-Type&#39;: &#39;application/json&#39;})<br><br>if __name__ == &quot;__main__&quot;:<br>    main()</pre><p>4. <strong>Set Permissions</strong>: Crucial for security and execution.</p><pre>chmod +x google_chat.py<br>chown monitoring:monitoring google_chat.py</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0bLriT9b4mpAMg3uQJALug.png" /><figcaption>Checkmk Python script for Google Chat notifications.</figcaption></figure><h4>🔹 Phase 4: Linking the Script to the Checkmk Web UI</h4><p>Now we tell Checkmk to use our new script whenever a website fails.</p><ol><li><strong>Add Notification Rule</strong>: Go to <strong>Setup &gt; Events &gt; Notifications &gt; Add notification rule</strong>.</li><li><strong>Notification Method</strong>: Select <strong>Google Chat Notification</strong> (Checkmk will automatically detect your .py file).</li><li><strong>Parameters</strong>: Select <strong>Call with the following parameters</strong> and paste your Google Chat Webhook URL into the first box.</li><li><strong>Conditions</strong>: Set it to trigger on <strong>Critical</strong>, <strong>Warning</strong>, and <strong>OK</strong> (to get “Fixed” messages). Ensure it only applies to the host External_Websites.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OoNzALSs6-EjV6EMsdl60w.png" /><figcaption>adding notification rule</figcaption></figure><h4>🔹 Phase 5: Safety First — Testing Without “Downing” the Site</h4><p>You should never pull the plug on a live website just to test your alerts. Use the <strong>Fake Check Results</strong> feature.</p><ol><li>Find your service in the <strong>Service View</strong>.</li><li>Click the <strong>Commands (Hammer icon)</strong> and select <strong>Fake check results</strong>.</li><li>Set the status to <strong>OK</strong>, then immediately set it to <strong>CRITICAL</strong>.</li><li>Check your Google Chat — you should see a ❌ notification followed by a ✅ recovery.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gYI_izXC-GeZ3K2okrYXBg.png" /><figcaption>going to check fake check results</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/846/1*mLyQ74dGr6GLARxBCsQGcQ.png" /><figcaption>testing fake results</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/552/1*XZYn759xxyT-3SXjRwcShA.png" /><figcaption>getting alerts when website is down</figcaption></figure><h4>Conclusion</h4><p>By integrating Checkmk 2.4 with Google Chat through a custom Python bridge, you have effectively eliminated the “blind spots” in your web infrastructure. You no longer have to wait for a frustrated customer’s ticket to know your site is down; instead, your monitoring system now acts as an automated, high-priority member of your DevOps team.</p><p>This setup on <strong>Debian 12</strong> provides a production-ready balance of stability and speed. By moving away from buried email alerts and toward real-time push notifications, you’ve shifted from a reactive stance to a proactive one. Whether you are managing a single homepage or an entire organization’s fleet of containers, you now have a professional grade pipeline that ensures you are always the first to know and the first to respond when seconds count.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=664ab8908a0b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[DHCP Explained: From the DORA Process to Preventing DoS Attacks]]></title>
            <link>https://medium.com/@sriranjankapilan/dhcp-explained-from-the-dora-process-to-preventing-dos-attacks-f1a369fccb2d?source=rss-6d90a6f9489e------2</link>
            <guid isPermaLink="false">https://medium.com/p/f1a369fccb2d</guid>
            <category><![CDATA[dhcp]]></category>
            <category><![CDATA[denial-of-service-attack]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[network-security]]></category>
            <category><![CDATA[networking]]></category>
            <dc:creator><![CDATA[Sriranjan Kapilan]]></dc:creator>
            <pubDate>Fri, 03 Apr 2026 04:32:43 GMT</pubDate>
            <atom:updated>2026-04-03T04:42:13.878Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Rk9qipJSfWQf7XkS-sU8lg.png" /><figcaption>DHCP with simple examples</figcaption></figure><p>Imagine walking into a massive, bustling hotel. You don’t have to wander the halls knocking on doors to find an empty room instead, you go to the front desk. The receptionist checks their system, hands you a key and tells you exactly where to go.</p><p>In the world of networking, <strong>DHCP (Dynamic Host Configuration Protocol)</strong> is that receptionist. It is the silent, essential service that ensures your laptop, smartphone, and smart fridge can all join a network without you ever having to manually assign them a “digital home address” (IP address).</p><h4>Why DHCP Matters</h4><p>Before DHCP became the standard, network administrators had to manually assign a unique IP address to every single device. This was not only tedious but prone to human error. If two devices were accidentally given the same address, neither could connect, a “collision” that would ground productivity to a halt.</p><p>DHCP solves this by automating the process. It manages a pool of available IP addresses and “leases” them to devices as they come and go.</p><h4>How It Works: The “DORA” Process</h4><p>To keep things professional yet simple, networking experts use the acronym <strong>DORA</strong> to describe how a device gets its settings.</p><h4>Discover (The Shout)</h4><p>The device wakes up and shouts to the whole network: <em>“Hey! I’m new here! Is there a DHCP Server around? I need an IP address!”</em></p><p><strong>Analogy:</strong> You walk into the hotel lobby and yell, “Is anyone working the front desk?!”</p><h4>Offer (The Menu)</h4><p>The Router (acting as the DHCP Server) hears the shout and looks at its list of available addresses. It responds: <em>“I’m here! I have address 192.168.1.50 available. Do you want it?”</em></p><ul><li><strong>Analogy:</strong> The manager says, “Yes! I have Room 202 open for you.”</li></ul><h4>Request (The Choice)</h4><p>The device says: <em>“Yes, please! I’ll take 192.168.1.50. Lock it down for me!”</em></p><ul><li><strong>Analogy:</strong> You say, “Perfect, I’ll take Room 202.”</li></ul><h4>Acknowledge (The Key)</h4><p>The Router finishes the paperwork and sends a final message: <em>“Done. You are now 192.168.1.50. You can use it for 24 hours. Enjoy!”</em></p><ul><li><strong>Analogy:</strong> The manager hands you the key and tells you check-out is tomorrow.</li></ul><h4>Essential DHCP Commands for Your Toolkit</h4><p>Whether you are a student or a budding IT professional, knowing how to interact with DHCP via the command line is vital for troubleshooting.</p><h4>In Windows (Command Prompt or PowerShell)</h4><p>If your internet is acting up, these are your “go to” tools:</p><ul><li><strong>View your current lease</strong></li></ul><pre>ipconfig /all # Look for &quot;DHCP Enabled: Yes&quot; and the &quot;Lease Obtained&quot; date.</pre><ul><li><strong>Give up your current IP</strong></li></ul><pre>ipconfig /release</pre><ul><li><strong>Request a brand new IP from the server</strong></li></ul><pre>ipconfig /renew</pre><h4>The APIPA Red Flag: 169.254.x.x</h4><p>APIPA (Automatic Private IP Addressing) is a fallback mechanism. When a device cannot contact a DHCP server after 60–90 seconds of trying, Windows/macOS/Linux automatically assigns itself an address in the 169.254.0.0/16 range. ( IP address of <strong>169.254.x.x )</strong></p><p>Think of this as your device giving up on the “receptionist.” If your computer shouts for an address (Discover) and hears nothing back (No Offer), it assigns itself this temporary address.</p><ul><li><strong>Problem:</strong> You cannot access the internet with an APIPA address.</li><li><strong>Solution:</strong> This usually means the DHCP server is down, the pool is exhausted (DoS attack) or there is a physical cable/Wi-Fi issue.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D_PD7e0PSG7L-idrIROMFw.png" /><figcaption>Automatic Private IP Addressing</figcaption></figure><h4>The Dark Side of Convenience: DHCP DoS Attacks</h4><p>A <strong>DHCP Starvation Attack</strong> is a specific type of <strong>Denial of Service (DoS)</strong> attack. In the world of cybersecurity, a DoS attack is any action that prevents legitimate users from accessing a service.</p><p>In a standard setup, the DHCP server assumes that every request it receives is from a legitimate device. Hackers exploit this “open door policy” primarily through a method called <strong>DHCP Starvation</strong>.</p><h4>What is a DHCP Starvation Attack?</h4><p>Think back to our hotel analogy. Imagine a prankster wearing a thousand different masks who runs into the lobby and books every single room in the hotel under different names. When a real guest arrives, the receptionist says, <em>“Sorry, we’re full!”</em> In technical terms,</p><ul><li>An attacker uses a tool (like <em>Yersinia</em> or a simple script) to send thousands of <strong>DHCP Discover</strong> packets.</li><li>Each packet uses a <strong>spoofed (fake) MAC address</strong>.</li><li>The DHCP server, trying to be helpful, assigns an IP address to every fake request until its <strong>pool is exhausted</strong>.</li><li><strong>The Result:</strong> Legitimate users cannot get an IP address, effectively knocking them off the network. This is a classic DoS.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wAXR8NuhFro7r-Qfcx1leg.png" /></figure><h4>How to Prevent the “Starvation”</h4><p>To stop this, we turn our network switches into “Bouncers” using a feature called <strong>DHCP Snooping</strong>.</p><h4>1. DHCP Snooping (The “Bouncer”)</h4><p>Think of this as <strong>“Real Manager vs. Fake Manager.”</strong> * <strong>The Problem:</strong> An attacker plugs in a fake router (Rogue Server) to give out wrong IP addresses and steal data.</p><ul><li><strong>Fix:</strong> You tell the switch which port the <strong>real</strong> DHCP server is on (<strong>Trusted Port</strong>).</li><li><strong>Result:</strong> If a “DHCP Offer” comes from any other port (<strong>Untrusted Port</strong>), the switch instantly <strong>blocks</strong> it. It ensures only the official server can hand out addresses.</li></ul><h4>2. Port Security (The “Limit”)</h4><p>Think of this as <strong>“One Seat per Ticket.”</strong></p><ul><li><strong>Problem:</strong> In a <strong>Starvation Attack</strong>, one hacker pretends to be 1,000 different devices to steal every available IP address.</li><li><strong>Fix:</strong> You set a limit on the switch port (e.g., <strong>Max 1 MAC Address</strong>).</li><li><strong>Result:</strong> If the hacker tries to send requests using multiple fake identities, the switch notices the trick and <strong>shuts down the port</strong> immediately.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*durQpZpmogeEs3UwROf65A.png" /><figcaption>ways to prevent DHCP starvation</figcaption></figure><h4>Final Thoughts: Connectivity and Control</h4><p>DHCP is the invisible engine that makes modern, mobile networking possible. It transforms a complex manual task into a seamless “plug-and-play” experience. However, as we’ve seen, that convenience comes with security risks like DHCP Starvation.</p><p>By mastering the <strong>DORA</strong> process, knowing your <strong>troubleshooting commands</strong>, and implementing <strong>DHCP Snooping</strong>, you ensure that your network remains both accessible for users and a “no-go zone” for attackers. In the world of networking, the goal is simple: keep the “receptionist” organized, the “bouncers” at the door, and the traffic flowing smoothly.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f1a369fccb2d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Beyond the IP: The Hidden World of ARP and the “Invisible” Middleman]]></title>
            <link>https://medium.com/@sriranjankapilan/beyond-the-ip-the-hidden-world-of-arp-and-the-invisible-middleman-b943f08927c3?source=rss-6d90a6f9489e------2</link>
            <guid isPermaLink="false">https://medium.com/p/b943f08927c3</guid>
            <category><![CDATA[man-in-the-middle-attack]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[network-security]]></category>
            <category><![CDATA[arp-protocol]]></category>
            <category><![CDATA[networking]]></category>
            <dc:creator><![CDATA[Sriranjan Kapilan]]></dc:creator>
            <pubDate>Thu, 02 Apr 2026 06:29:51 GMT</pubDate>
            <atom:updated>2026-04-02T07:04:53.146Z</atom:updated>
            <content:encoded><![CDATA[<p>When you type a URL into your browser, you probably think of <strong>IP addresses</strong>. But in the physical wires and Wi-Fi signals of your local network, IP addresses are almost useless. To actually deliver data, your computer needs a <strong>MAC Address</strong> the hard coded “fingerprint” of a network card.</p><p>How do we get from a digital IP to a physical MAC? That is the job of <strong>ARP (Address Resolution Protocol)</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tytnNjW3rcPz732GN85OqA.png" /></figure><h4>1. The Basics: ARP vs RARP</h4><p>In networking, we have two primary ways of identifying a device.</p><ul><li><strong>IP Address (Logical):</strong> Like a mailing address that can change if you move.</li><li><strong>MAC Address (Physical):</strong> Like your fingerprint. It is hard coded into your hardware.</li></ul><p>let’s define the two players ARP &amp; RARP.</p><ul><li><strong>ARP (Address Resolution Protocol):</strong> The Translator. It says: <em>“I have the IP address </em><em>192.168.1.10. Who does this belong to? Give me your MAC address.&quot;</em></li><li><strong>RARP (Reverse ARP):</strong> The Identity Searcher. It says: <em>“I know my MAC address is </em><em>AA:BB:CC, but I don&#39;t have an IP. Can someone give me one?&quot;</em> * <em>Note:</em> In 2026, RARP is like a vintage car cool to know about, but rarely driven. Modern networks use <strong>DHCP</strong> for this.</li></ul><h4>2. The Local “Shout”: How ARP Works (Same Network)</h4><p>Let’s imagine an office with two employees <strong>Alice</strong> and <strong>Bob</strong>. <strong>Alice</strong> needs to send a file to <strong>Bob</strong>. She knows Bob’s IP is 192.168.1.50, but her network card can&#39;t send data without a Physical (MAC) address.</p><ol><li><strong>The Memory Check:</strong> Alice looks at her <strong>ARP Cache</strong> (her internal notebook). If Bob isn’t in there, she moves to the next step.</li><li><strong>The Broadcast (The Shout):</strong> Alice sends a packet to <strong>everyone</strong> on the network. It says: <em>“Attention everyone! Who has IP 192.168.1.50? Please tell Alice at 192.168.1.20.”</em></li><li><strong>The Response:</strong> Everyone hears the shout, but they ignore it except Bob. Bob sees his IP and replies directly to Alice: <em>“Hey Alice, that’s me. My MAC address is </em><em>B1:B1:B1:B1:B1:B1.&quot;</em></li><li><strong>The Cache:</strong> Alice saves this in her notebook (ARP Table) and writes it in her address book so she doesn’t have to shout next time before beginning the data transfer.</li></ol><h4>3. The Deep Handoff: How Alice Reaches a Website (Different Network)</h4><p>If Alice wants to visit <em>google.com</em> (IP <em>8.8.8.8</em>), the process gets much deeper. Alice cannot &quot;shout&quot; to the whole internet; she can only shout to her local &quot;room.&quot;</p><p>✔ <strong>Step 1: Targeting the Gateway</strong></p><p>Alice compares the destination IP ( <em>8.8.8.8</em>) to her own. She realizes it is on a different network. She knows she cannot talk to Google directly, so she targets her <strong>Default Gateway</strong> (The Router).</p><p>✔ <strong>Step 2: The Local ARP</strong></p><p>Alice ARPs for the <strong>Router’s MAC address</strong>. She encapsulates her data in a “Frame” where:</p><ul><li><strong>Source IP:</strong> Alice (<em>192.168.1.20</em>)</li><li><strong>Destination IP:</strong> Google ( <em>8.8.8.8</em>)</li><li><strong>Source MAC:</strong> Alice (A1:A1...)</li><li><strong>Destination MAC:</strong> <strong>The Router</strong> (R1:R1...)</li></ul><p>✔ <strong>Step 3: The Router’s Operation</strong></p><p>When the Router receives the frame, it performs <strong>De-encapsulation</strong>. It strips off Alice’s MAC address and looks at the Destination IP. Seeing it’s for Google, the Router checks its <strong>Routing Table</strong> to find the next “hop.”</p><p>✔ <strong>Step 4: NAT and The Outside World</strong></p><p>Before sending the data out to the Internet Service Provider (ISP), the Router performs <strong>Network Address Translation (NAT)</strong>. It replaces Alice’s private local IP with the Router’s public “Internet” IP.</p><p>The Router then looks at the MAC address of the <em>next</em> router in the ISP’s network. It “re-packages” Alice’s data into a new frame with a <strong>new Source MAC (The Router)</strong> and a <strong>new Destination MAC (The ISP’s Router)</strong>. This “MAC-swapping” happens at every single router jump across the globe until the packet reaches its destination.</p><h4>4. The Vulnerability: ARP Spoofing and the “Race”</h4><p>ARP is a <strong>stateless</strong> protocol. This means it has no memory of what it asked for. If a computer receives an ARP Reply, it assumes it must have asked for it and updates its table immediately.</p><p><strong>The Man-in-the-Middle (MitM) Attack</strong></p><p>Imagine <strong>Eve</strong>, a malicious actor on the same network.</p><ol><li><strong>The Lie:</strong> Eve sends a constant stream of fake ARP replies to Alice: <em>“I am the Router! My MAC is E1:E1…”</em></li><li><strong>The Update:</strong> Alice’s computer receives this “unsolicited” reply. Even if the real Router also sent a reply, Alice’s computer usually accepts the <strong>most recent</strong> or <strong>last</strong> packet it received.</li><li><strong>The Trap:</strong> Alice now sends all her “Google” traffic to Eve’s MAC address. Eve can <strong>intercept the data, misuse it, modify</strong> it or <strong>do whatever</strong> she wants with it before forwarding it to the real Router so Alice doesn’t notice any lag.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/386/1*mJqKw8ppDxHagVo6rJH4Dg.png" /><figcaption>man in middle attack scenario</figcaption></figure><h4>5. Investigating the ARP Table (arp -a)</h4><p>You can view your computer’s “Identity Ledger” by opening a terminal and typing <strong><em>arp -a</em></strong></p><pre>arp -a</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/652/1*_WVzHNMsMe0D1gXYttQ_sg.png" /></figure><ul><li><strong>Dynamic:</strong> The computer “learned” these via broadcasts. They will expire and be deleted after a few minutes of inactivity.</li><li><strong>Static:</strong> These are manually entered or permanent.</li></ul><h4>6. Prevention: How to Escape the Man-in-the-Middle</h4><p>If your network is being “poisoned” by Eve, you have two primary ways to defend yourself.</p><p><strong>❖ The Manual Shield: Static ARP Entries</strong></p><p>Some suggest locking your ARP table manually.</p><ul><li><strong>The Command:</strong> arp -s 192.168.1.1 00-14-22-01-23-45</li><li><strong>The Result:</strong> This tells your computer: <em>“The Router is definitely at this hardware ID. Ignore any other claims.”</em></li><li><strong>Is it practical?</strong> No. If you buy a new router or take your laptop to a coffee shop, your internet will break because your computer is looking for a hardware ID that isn’t there. Additionally, if you have multiple devices, you would need to configure static ARP entries on each device individually, which is not practical or scalable.</li></ul><p><strong>❖ The Professional Shield: DAI (Dynamic ARP Inspection)</strong></p><p>In business environments, the <strong>Switch</strong> acts as the security guard.</p><ul><li><strong>How it works:</strong> The Switch keeps a master list of which MAC address belongs on which port.</li><li><strong>The Action:</strong> If Eve (on Port 12) sends a message saying she is the Router (which the Switch knows is on Port 1), the Switch <strong>drops her packet immediately</strong> and can even disable her connection.</li></ul><p><strong>❖The Personal Armor: Encryption and VPNs</strong></p><p>The absolute best way to “escape” a MitM attack is to make your data unreadable.</p><ul><li><strong>VPNs:</strong> By using a VPN, your data is encrypted before it ever hits the ARP layer. Even if Eve successfully intercepts your packets, all she sees is scrambled code.</li><li><strong>HTTPS:</strong> Never ignore <strong>Certificate Errors</strong> in your browser. This is the most common sign that someone is trying to hijack your connection.</li></ul><h4>Conclusion</h4><p>ARP is the glue that holds our local networks together, but its simplicity is its greatest weakness. By understanding how the “Deep Handoff” to the router works and using tools like VPNs and smart switches, you can ensure your data stays between you and your destination with no “Man in the Middle” invited.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b943f08927c3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Secret Life of a Data Packet: A 7-Layer Journey From Your Screen to the World]]></title>
            <link>https://medium.com/@sriranjankapilan/the-secret-life-of-a-data-packet-a-7-layer-journey-from-your-screen-to-the-world-070c87d4712d?source=rss-6d90a6f9489e------2</link>
            <guid isPermaLink="false">https://medium.com/p/070c87d4712d</guid>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[internet]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[osi-model]]></category>
            <dc:creator><![CDATA[Sriranjan Kapilan]]></dc:creator>
            <pubDate>Tue, 31 Mar 2026 08:38:24 GMT</pubDate>
            <atom:updated>2026-03-31T08:38:24.337Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/842/1*2cCACSYc_Ftd1ADqD93YFA.png" /></figure><p>Imagine you are sending a high quality photo of your cat to a friend across the ocean. In less than a second, that image is<em> sliced into thousands of pieces</em>, <em>encrypted into a secret code</em>, <em>bounced off satellites </em>and <em>reassembled perfectly</em> on your friend’s screen.</p><p>To make this happen, every device on earth follows a “rulebook” called the <strong>OSI (Open Systems Interconnection) Model</strong>.</p><h4>What is the OSI Model and Why Do We Need It?</h4><p>Before the 1980s, computers from different manufacturers often couldn’t “talk” to each other. The OSI model was created to standardize how data moves across a network.</p><h4>Why does it matter?</h4><ul><li><strong>Interoperability:</strong> It allows a Mac, a Windows PC, and an Android phone to communicate seamlessly.</li><li><strong>Troubleshooting:</strong> If a website isn’t loading, system engineers can use the OSI model to figure out if the problem is at the physical cable level (Layer 1) or the software level (Layer 7).</li><li><strong>Specialization:</strong> It allows developers to focus on building apps without worrying about how the electrical signals in a fiber optic cable work.</li></ul><h4>🟢Part 1: The Descent (The Sender’s Journey)</h4><p>When you click “Send” on an image or audio file, the data travels from <strong>Layer 7 down to Layer 1</strong>. This is called <strong>Encapsulation</strong>.</p><h4>🔸Layer 7: Application (The User Gateway)</h4><ul><li>This is the layer you directly interact with. Apps like WhatsApp, Gmail, or your web browser operate here.</li><li>It provides <strong>network services to end users</strong>, allowing you to send messages, load websites or upload files.</li><li>Identifies the <strong>type of service</strong> (web, email, file transfer)</li><li>Ensures the correct <strong>application protocol</strong> is used</li><li>Acts as the bridge between <strong>user actions and network communication</strong></li><li><strong>HTTP/HTTPS</strong> → Loading websites</li><li><strong>SMTP</strong> → Sending emails</li><li><strong>FTP</strong> → File transfers</li><li><strong>DNS</strong> → Converts domain names (like <em>google.com</em>) into IP addresses</li></ul><p>👉 For example, when you type a website URL, <strong>DNS first finds the IP address</strong>, then HTTP/HTTPS is used to request the webpage.</p><h4>🔸Layer 6: Presentation (The Translator &amp; Guard)</h4><p>This layer prepares the data for the network.</p><ul><li><strong>Translation:</strong> Converts your image into binary (1s and 0s).</li><li><strong>Compression:</strong> Shrinks the file so it sends faster.</li><li><strong>Encryption:</strong> Using <strong>TLS/SSL</strong>, it turns your image into unreadable code. Even if a hacker steals the data mid-air, they can’t see your photo without the “key.”</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HVIekJr7vU_Bfz0z2412ew.png" /><figcaption>stages executed inside presentation layer</figcaption></figure><h4>🔸Layer 5: Session (The Conversation Manager)</h4><p>This layer is responsible for <strong>starting, maintaining and ending communication sessions</strong> between two devices.</p><p>Think of it like a <strong>conversation controller,</strong></p><ul><li>It opens a session when communication begins</li><li>Keeps the session active while data is being exchanged</li><li>Closes the session when communication ends</li></ul><p>It also ensures that <strong>multiple sessions don’t get mixed up</strong>.</p><h4>🔸Layer 4: Transport (The Courier)</h4><p>Your large image is now chopped into small <strong>Segments</strong>.</p><ul><li><strong>Port Numbers:</strong> It assigns a “destination port.” (e.g., <strong>Port 80/443</strong> for web traffic, <strong>Port 21</strong> for files).</li></ul><p><strong>TCP vs UDP</strong></p><ul><li><strong>TCP (Transmission Control Protocol):</strong> Used for <strong>Email or File Transfers</strong>. It is “Connection-Oriented.” It sends an acknowledgment (ACK) for every piece received. It is slow but 100% reliable.</li><li><strong>UDP (User Datagram Protocol):</strong> Used for <strong>Live Streaming or Gaming</strong>. It is “Connectionless.” It sends data as fast as possible without checking if it arrived. If a “frame” of your video call is lost, the screen just glitches for a second and moves on.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2kok54aKaEEzFf4dTvqIrg.png" /><figcaption>TCP vs UDP</figcaption></figure><h4>🔸Layer 3: Network (The GPS)</h4><p>Segments are wrapped into <strong>Packets</strong>. This layer handles <strong>Routing</strong>.</p><ul><li><strong>IP Addressing:</strong> It attaches the <strong>Source IP</strong> and <strong>Destination IP</strong>.</li><li><strong>The Logic:</strong> Routers don’t just look for the <em>shortest</em> path; they look for the <strong>best</strong> path. This could mean the highest-speed fiber link or avoiding a “congested” path where there is too much traffic.</li></ul><h4>🔸Layer 2: Data Link (The Local Delivery Inspector)</h4><p>The Data Link layer is the “Local Courier” It manages how data moves between two devices on the <strong>same</strong> Wi-Fi or Ethernet network.</p><ul><li><strong>Framing:</strong> It wraps Network packets into <strong>Frames</strong> (the data unit for this layer).</li><li><strong>Addressing:</strong> It uses <strong>MAC Addresses</strong> (physical hardware IDs) to find the exact device in your house or office.</li><li><strong>Error Detection:</strong> It adds a mathematical “seal” called the <strong>FCS (Frame Check Sequence)</strong> to the end of every frame.</li></ul><p>If the receiver checks the <strong>FCS</strong> and finds that the data was corrupted (even by one tiny bit):</p><ol><li><strong>The Frame is silently dropped:</strong> It is thrown in the trash immediately.</li><li><strong>No Correction:</strong> This layer <strong>does not</strong> try to fix the data or ask for a retry.</li><li><strong>The Silence:</strong> The receiver doesn’t tell the sender it dropped the data.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/842/1*wIGwcO2ffuD8Wa6YltFZeA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fFY_zoejgKtDW8AxGVWjDQ.png" /></figure><h4>🔸Layer 1: Physical (The Signal Carrier)</h4><p>This layer is responsible for <strong>actually transmitting raw data as signals</strong> through a medium.</p><p>It converts binary data (1s and 0s) into,</p><ul><li>Electrical signals → cables</li><li>Light pulses → fiber optics</li><li>Radio waves → Wi-Fi</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/835/1*ltfXD_ndrWY76yvRiPbBkA.png" /><figcaption>visualizing the core concept of Layer 1</figcaption></figure><h4>🟢 Part 2: Crossing Networks (Same vs Different)</h4><h4>Condition 1: Same Network</h4><p>If you send a file to a laptop in the same room, your device uses <strong>ARP (Address Resolution Protocol)</strong> to find the receiver’s MAC address. The data goes through a local switch and arrives instantly.</p><h4>Condition 2: Different Network (The Internet)</h4><p>If the receiver is in another city, your device sends the data to the <strong>Default Gateway</strong> (your Router). The router “hops” the packet through several other routers across the world until it finds the receiver’s network.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/842/1*DpWB0CMKHjpvF_TJiGo8ww.png" /><figcaption>networks destination types</figcaption></figure><h4>🟢 Part 3: The Ascent (The Receiver’s Journey)</h4><p>When the data arrives at your friend’s device, it travels from <strong>Layer 1 up to Layer 7</strong> (<strong>De-encapsulation</strong>).</p><h4>🔹 Physical (L1): Signal Capture</h4><ul><li>The device picks up the radio waves or light pulses and turns them back into bits.</li></ul><h4>🔹Data Link (L2): The MAC &amp; Integrity Check</h4><p>The device checks the <strong>MAC Address</strong>.</p><ul><li><strong>Is it for me?</strong> If the MAC doesn’t match, it’s ignored.</li><li><strong>Is it broken?</strong> It checks the <strong>FCS</strong> value. If a single bit was flipped during the journey, <strong>the Frame is thrown away.</strong></li></ul><h4>🔹Network (L3): The IP Check</h4><ul><li>The device strips the Frame header and looks at the <strong>IP Address</strong>. If it matches the receiver’s IP, it moves to the next stage.</li></ul><h4>🔹Transport (L4): The Puzzle Master</h4><p>This is where the magic happens.</p><ul><li><strong>Reordering:</strong> Because of routing, Segment #3 might arrive before Segment #1. Layer 4 uses <strong>Sequence Numbers</strong> to sort them back into the correct order.</li><li><strong>Handling Lost Data:</strong> If a segment is missing, and the protocol is <strong>TCP</strong>, the receiver sends a message back: <em>“Stop! I’m missing piece #2. Please resend.”</em> The sender then re-transmits only that specific piece.</li></ul><h4>🔹Session (L5): Verification</h4><ul><li>The device confirms that this data belongs to the active session started earlier.</li></ul><h4>🔹Presentation (L6): Decryption</h4><ul><li>The data is still encrypted “garbage.” Layer 6 uses the <strong>Decryption Key</strong> to turn that unreadable code back into a beautiful image or audio file. It also de-compresses the data to its original size.</li></ul><h4>🔹Application (L7): Final View</h4><ul><li>Finally, the app (like Instagram or WhatsApp) displays the image. Your friend sees the photo of your cat exactly as you sent it.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/897/1*-NJbqOxPz5b1cn1ObcSsqQ.png" /><figcaption>summary</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SSNP01pIi_cm-1jujIPq1A.png" /><figcaption>sending and retrieving data final overview</figcaption></figure><h4>Conclusion: The Universal Language of Data</h4><p>The OSI model is the invisible “relay race” that makes our digital world possible. By dividing communication into seven logical layers, it ensures that data no matter how complex is formatted, secured, and delivered accurately across any network. Whether you are sending a quick text or a massive file, these layers work in perfect harmony to turn a chaotic stream of bits into the seamless experience we call the Internet.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=070c87d4712d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Recovering and Verifying a Proxmox VE Installation on Hetzner Dedicated Server]]></title>
            <link>https://medium.com/@sriranjankapilan/recovering-and-verifying-a-proxmox-ve-installation-on-hetzner-dedicated-server-9aa9cb2cf927?source=rss-6d90a6f9489e------2</link>
            <guid isPermaLink="false">https://medium.com/p/9aa9cb2cf927</guid>
            <category><![CDATA[sysadmin]]></category>
            <category><![CDATA[virtualization]]></category>
            <category><![CDATA[proxmox-ve]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[hetzner-server]]></category>
            <dc:creator><![CDATA[Sriranjan Kapilan]]></dc:creator>
            <pubDate>Sun, 29 Mar 2026 05:38:38 GMT</pubDate>
            <atom:updated>2026-03-29T05:38:38.416Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nig_wh-n-kzLJXO9DHkFrg.png" /><figcaption>recover hetzner dedicated servers</figcaption></figure><p>When deploying hypervisors like <strong>Proxmox Virtual Environment</strong> (VE) on a <strong>Dedicated Server</strong>, administrators gain raw hardware power but take on total management responsibility. A simple mistake such as a <strong>lost root password</strong>, a <strong>failed network bridge</strong> configuration or an issue during a manual apt installation can render powerful hardware completely unreachable.</p><p>Unlike a Cloud Server, which benefits from a provider’s virtualization layer and easy console access, a Dedicated Server is a physical, standalone computer sitting in a data center. If you lose access, you are truly locked out until you “break in” via a Rescue System.</p><p>This article is a comprehensive, step by step reference for using the Hetzner Rescue System to recover access, reset authentication and most crucially verify a Proxmox vmbr0 network configuration from an outside, offline state.</p><h4>Technical Core Concepts</h4><p>Understanding this infrastructure is key to a successful recovery.</p><p>🔵 <strong>The Proxmox Networking Model</strong>: <em>enp35s0 </em>vs <em>vmbr0</em></p><p>On a typical dedicated server running standard Debian Linux, the physical network interface (e.g. named enp35s0 or eth0) directly holds the server’s Public IP and Gateway information.</p><p><strong>Proxmox VE</strong> is a virtualization platform. Its main function is to <strong>allow multiple separate Operating Systems</strong> (Virtual Machines) to “share” that single physical connection. To achieve this, it uses a <strong>Linux Bridge</strong> named <strong>vmbr0</strong>.</p><p>The Network Anatomy (Hetzner Standard)</p><p>A correct Proxmox setup on Hetzner works like this,</p><p>◆ <strong>Physical NIC (enp35s0)</strong>: This card becomes “manual.” It stops holding an IP. It simply passes all raw traffic (packets) from the internet directly to the bridge.</p><p>◆ <strong>Linux Bridge (vmbr0)</strong>: This is a software layer. It now holds your Public IP Address (168.119.3.58/26) and configuration.</p><p>▪️Administrators: Connect to the Public IP address of the vmbr0 bridge for management (SSH or Web Panel).</p><p>▪️Virtual Machines: Are plugged into the vmbr0 bridge, allowing them to communicate over your main IP connection to the internet.</p><p>🔵 <strong>Physical Storage</strong>: <em>RAID </em>(Redundant Array of Independent Disks)</p><p>Dedicated servers often use RAID to protect against a physical hard drive failure. RAID combines multiple physical disks into a single, reliable Logical Volume.</p><ul><li>RAID 0 (Striping): Speed only. If one disk dies, all data is lost. (Never use for Proxmox).</li><li>RAID 1 (Mirroring): Data is written to both disks simultaneously. If Disk 1 dies, Disk 2 keeps running seamlessly. (Standard for hypervisor root drives).</li><li>RAID 5/6/10: More advanced configurations for speed and high capacity redundancy, often used for data storage within VMs.</li></ul><p>🔵 <strong>Hetzner Cloud</strong> and <strong>Hetzner Dedicated Servers</strong></p><ul><li><strong>Cloud Server:</strong> These are <strong>Virtual Machines (VMs)</strong>. Your server lives on a large physical “Host” machine alongside other users. A “Hypervisor” slices the host’s CPU and RAM into smaller pieces for you.</li><li><strong>Dedicated Server:</strong> This is a <strong>Bare Metal</strong> machine. You rent the entire physical computer. No one else’s data or processes touch that CPU, RAM, or Disk.</li></ul><h4>Step by Step Recovery Guide</h4><p>This process utilizes the concept of chroot (Change Root) a technique that allows you to “break in” to an offline operating system by tricking it into thinking you are running it normally from the inside.</p><p><em>Prerequisites. You must have,</em></p><p>⚠️The IP address of your dedicated server (assume we have server of ip address 168.119.3.58 ).</p><p>⚠️SSH Access to the Hetzner Cloud Console.</p><p>⚠️The temporary Rescue System activated for your server, which has provided you with a unique root password.</p><h4>🔴Step 1: Initialize Rescue Mode and Identification</h4><p>First, access the temporary “scaffolding” system that allows us to work on the offline hardware.</p><p><strong>1.Log into the Rescue System</strong> via SSH:</p><pre>ssh root@YOUR_SERVER_IP<br># (Enter the temporary Rescue root password provided by the Admin Console).</pre><p><strong>2. Identify the Offline System Drives.</strong> Since the drives are currently dormant, you must locate the logical RAID partition where your broken Proxmox install resides. We need to find the main storage partition.</p><pre>lsblk</pre><p>Analysis of typical output:</p><pre>NAME        MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINTS<br>nvme1n1     259:0    0 476.9G  0 disk  <br>`-nvme1n1p3 259:3    0 443.9G  0 part  <br>  `-md2       9:2    0 443.8G  0 raid1 # &lt;-- THIS IS THE TARGET VOLUME<br>nvme0n1     259:4    0 476.9G  0 disk  <br>`-nvme0n1p3 259:7    0 443.9G  0 part  <br>  `-md2       9:2    0 443.8G  0 raid1 # &lt;-- MIRROR DEVICE</pre><p>In this example, we see two physical NVMe disks mirrored into a single logical volume: <strong>/dev/md2</strong>. This is our target.</p><h4>🔴Step 2: The ‘Chroot’ Process (Break In)</h4><p>We will now perform the “chroot” procedure to enter your actual, broken server from the inside.</p><ol><li><strong>Mount the main drive.</strong> We attach your logical volume (/dev/md2) to a temporary &quot;folder&quot; in the rescue environment. We choose /mnt as our mount point.</li></ol><pre>mount /dev/md2 /mnt</pre><p>2. <strong>Bind Mount Core Utilities.</strong> For an operating system to “function” while we are inside the chroot, it needs access to essential system information (processes, device mappings, system files). We link the rescue system’s core “organs” into our mounted /mnt folder.</p><pre>mount -t proc /proc /mnt/proc<br>mount -o bind /dev /mnt/dev<br>mount -o bind /sys /mnt/sys</pre><p><strong>3. Execute Inside (Chroot).</strong> Execute the final command to move your entire terminal environment inside your Proxmox server.</p><pre>chroot /mnt</pre><p><strong>Verification:</strong> Look at your command prompt. It has changed. You are no longer acting as the root user of the &#39;Rescue&#39; system. you are now the root user of your permanent Proxmox installation.</p><h4>🔴Step 3: Password and Credential Recovery</h4><p>Now that you are inside, you can reset the master access.</p><ol><li><strong>Reset the Root Password.</strong> Run the standard Linux password utility. This creates a new master administrator key.</li></ol><pre>passwd root<br>#It will ask you to type the new password twice.<br>#Remember, nothing will appear on the screen while you type.</pre><h4>🔴 Step 4: Critical Network Configuration Verification (/etc/network/interfaces)</h4><p>This is the most dangerous part of manual Proxmox installations (apt install proxmox-ve). If the bridge configuration is broken, you cannot reach the Proxmox dashboard (https://YOUR_SERVER_IP:8006).</p><p>While still inside the chroot environment, you must verify this specific structure.</p><pre>cat /etc/network/interfaces</pre><p>Verification Checklist for a Clean Proxmox Setup on Hetzner.</p><p>The following structure is a required best practice for bridging.</p><ul><li><strong>Physical Interface Is Manual</strong></li></ul><pre>auto enp35s0<br>iface enp35s0 inet manual<br># Physical interface - MUST BE MANUAL and contain NO IP info.</pre><ul><li><strong>Bridge vmbr0 Holds the IP</strong></li></ul><pre># Proxmox Bridge - REQUIRED<br>auto vmbr0<br>iface vmbr0 inet static<br>    address 168.119.3.58/26         # &lt;-- YOUR PUBLIC IP<br>    gateway 168.119.3.1             # &lt;-- HETZNER GATEWAY<br>    bridge-ports enp35s0            # &lt;-- MUST MAP TO PHYSICAL NIC<br>    bridge-stp off<br>    bridge-fd 0<br>    # Critical Point-to-Point Route for some Hetzner subnets:<br>    up route add -net 168.119.3.0 netmask 255.255.255.192 gw 168.119.3.1 dev vmbr0</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yf6be_ywfnbIlPD_5jNIzA.png" /></figure><h4>🔴 Step 5: Clean Up and Reboot</h4><p>We must now exit the “house” and take down the scaffolding properly to prevent disk corruption.</p><ol><li><strong>Exit the Chroot</strong></li></ol><pre>exit</pre><p><strong>2. Unmount Utilities and Main Drive (Crucial):</strong> Run these to detach all RAID drives safely from the temporary environment</p><pre>umount /mnt/proc /mnt/dev /mnt/sys /mnt</pre><p><strong>3.Initiate Reboot:</strong> The server will now shut down the temporary Rescue system and start the permanent Proxmox system you have just repaired</p><pre>reboot</pre><h4>🔴 Step 6: Final Proxmox Web Panel Access</h4><p>Wait <strong>for few minutes</strong>. Proxmox takes a few minutes to start its extensive virtualization services.</p><ol><li><strong>The Web Dashboard:</strong> Open Chrome or Firefox and navigate to your server’s IP address <strong>using HTTPS and port 8006:</strong> <a href="https://168.119.3.58:8006/">https://168.119.3.58:8006</a></li></ol><ul><li><em>Warning:</em> You will see a “Your connection is not private” warning because Proxmox uses a self-signed security certificate. Click <strong>Advanced</strong> and then click <strong>Proceed to 168.119.3.58 (unsafe)</strong>.</li></ul><p><strong>2. Credentials:</strong></p><ul><li><strong>Username:</strong> root</li><li><strong>Password:</strong> The <em>new permanent password</em> you just created in Step 3.</li><li><strong>Realm:</strong> Select <strong>Linux PAM standard authentication</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9HCFvXtjiqELpni0JkrqXQ.png" /><figcaption>proxmox web UI login dashboard</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PxxbmdKT_-N2oWXxR0pQFQ.png" /><figcaption>proxmox web UI for 168.119.3.58:8006</figcaption></figure><h4>Conclusion</h4><p>Successfully recovering a <strong>Proxmox VE</strong> installation on a <strong>Hetzner Dedicated Server</strong> is a masterclass in low level system administration. By combining the <strong>Hetzner Rescue System</strong> with the <strong>Chroot</strong> technique, we bypassed a total lockout, reset the administrative “front door” and verified the complex <strong>vmbr0</strong> network bridge from the outside.</p><p>This process proves that while dedicated hardware demands more responsibility than a cloud instance, it also offers the ultimate flexibility. With your password reset and your network configuration validated, your Proxmox node is now a stable, powerful foundation for your virtualized infrastructure.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9aa9cb2cf927" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Securing Your Infrastructure: Visualizing Linux Vulnerabilities with PatchMon & Docker.]]></title>
            <link>https://medium.com/@sriranjankapilan/securing-your-infrastructure-visualizing-linux-vulnerabilities-with-patchmon-docker-7a07ae3ccc68?source=rss-6d90a6f9489e------2</link>
            <guid isPermaLink="false">https://medium.com/p/7a07ae3ccc68</guid>
            <category><![CDATA[infrastructure]]></category>
            <category><![CDATA[server-security]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[patchmon]]></category>
            <dc:creator><![CDATA[Sriranjan Kapilan]]></dc:creator>
            <pubDate>Sun, 15 Feb 2026 08:29:21 GMT</pubDate>
            <atom:updated>2026-02-15T08:34:06.402Z</atom:updated>
            <content:encoded><![CDATA[<h4>Introduction: The Battle Against “Patching Fatigue”</h4><p>In the world of Linux administration, <strong>“Patching Fatigue”</strong> is a real phenomenon. Whether you’re managing a professional home lab or a fleet of enterprise VMs, the ritual is often the same. SSH into a server, run <strong>apt update</strong> or <strong>dnf check update</strong>, rinse and repeat across dozens of nodes.</p><p>Keeping track of security vulnerabilities and pending updates across different distributions is more than just a chore. It’s a security risk. That’s where <strong>PatchMon</strong> comes in.</p><h4>What is PatchMon?</h4><p><a href="https://patchmon.net/"><strong>PatchMon</strong></a> is an open source Linux patch management and monitoring system that provides administrators with <strong>centralized visibility</strong> over their entire infrastructure. It isn’t just another dashboard, it’s a dedicated tool designed to answer one question: <em>“Which of my servers need attention right now?”</em></p><p><strong>Key Highlights:</strong></p><ul><li><strong>Distro Agnostic:</strong> Seamlessly works with standard package managers like <em>apt, yum</em> and <em>dnf</em>.</li><li><strong>Zero Inbound Requirements:</strong> Unlike traditional tools that require open SSH or HTTP ports, PatchMon uses an <strong>outbound only agent model</strong>.</li><li><strong>Modern Interface:</strong> A clean, intuitive UI that replaces messy terminal outputs with actionable data.</li></ul><h4>Why you need PatchMon (The Modern Admin’s Secret)</h4><p>Maintaining security compliance across a mix of Ubuntu, Debian, RHEL and Fedora is a logistical nightmare. PatchMon simplifies this by focusing on three core pillars.</p><ul><li><strong>Centralized Visibility:</strong> See which servers need security patches or a reboot from one beautiful “Single Pane of Glass.”</li><li><strong>Outbound only security:</strong> Monitored VMs “call home” to the PatchMon server. This ensures your hosts remain securely behind your firewall with zero inbound exposure.</li><li><strong>Lightweight Infrastructure:</strong> The entire management stack can be spun up in minutes using Docker, making it ideal for both localhost testing and production server hosting.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Di4Y07ytbFPJkRXwZ7nlQQ.png" /></figure><h4>Running PatchMon with Docker</h4><p>The most efficient way to deploy PatchMon is via Docker Compose. <a href="https://github.com/PatchMon/PatchMon/tree/main/docker">Here is the github repository url</a> to get your management server up and running on your localhost or a central server.</p><h4>★ Configuration and Security Hardening</h4><p>Prioritize security by hardening your configuration before the initial launch. After cloning the repository, navigate to the project folder and update the environment file with robust <strong>PostgreSQL</strong> and <strong>Redis</strong> passwords, alongside a unique <strong>JWT Secret</strong> to ensure all API communications between your agents and the server are fully encrypted and secure.</p><pre># Copy the template to a live environment file<br>cp env.example .env<br><br># Generate a secure JWT Secret and update your .env<br># Tip: Use &#39;openssl rand -hex 32&#39; to generate high-entropy strings</pre><h4>★ Launching the PatchMon Stack</h4><p>Deploy your secured application and launch the database and services in a containerized environment.</p><pre>docker compose up -d</pre><p>Once the containers are healthy, you can access the centralized management interface by navigating to, <a href="http://localhost:3000/"><strong><em>http://localhost:3000</em></strong></a></p><p>Then we need to create account.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/542/1*t_9Rn5FfyeV2IBuCwca5dA.png" /><figcaption>create admin account</figcaption></figure><p>then enter into dashboard. It looks like,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/794/1*XnNQkWzP2SOddsmhkbNbQQ.jpeg" /><figcaption>patchmon UI dashboard</figcaption></figure><h4>★ Integrating your Linux VM</h4><p>The true power of PatchMon lies in its effortless agent deployment. To begin monitoring a remote Linux VM, follow these steps:</p><ul><li><strong>Generate the Installer:</strong> In the PatchMon UI, navigate to the <strong>Hosts</strong> tab and select <strong>Add Host</strong>.</li><li><strong>The One Liner installation:</strong> PatchMon will generate a unique Bash installation command (a “one-liner”) specifically for that host.</li><li><strong>Deploy the Agent:</strong> SSH into your target Linux VM and paste the command. The script will automatically install the PatchMon agent, configure it as a system service and establish an outbound connection to your dashboard.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z1kYNC-s7CZbYFN56IG48w.png" /><figcaption>create host name</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/886/1*eTSMWU-YVtQSUEc9fW5oPw.png" /><figcaption>getting one line installer command</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nuPqtPD_L3tls8eJ_09Vyg.png" /><figcaption>installing patchmon to linux vm</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FDLbBHy0e5rZF56J2PVHbA.png" /><figcaption>installation finished to vm</figcaption></figure><h4>★ Real time Insights via the dashboard</h4><p>Once the agent is installed, the VM will automatically register itself in the UI. From the <strong>Dashboard</strong>, you now have a high level overview of your server’s health without ever having to touch a terminal:</p><ul><li><strong>Security Status:</strong> Instantly identify how many critical security patches are pending.</li><li><strong>Reboot Requirements:</strong> See at a glance which servers require a restart following a kernel update.</li><li><strong>System Metadata:</strong> Monitor OS versions, uptimes, and hardware specifications across your entire fleet from a single screen.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G8muXRZosfnC7eWJqT8wPw.png" /><figcaption>details showing in dashboard</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h5ZN7CjAfxkko4s-Qr4SUg.png" /><figcaption>all host details showing in dashboard</figcaption></figure><p>By consolidating these metrics into a single screen, PatchMon allows you to identify critical vulnerabilities across your fleet in seconds. You no longer need to audit each server individually instead, the dashboard tells you exactly where your attention is needed most to keep your environment secure and up to date.</p><h4>Reference</h4><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FR7gNsitLUEc%3Fstart%3D288%26feature%3Doembed%26start%3D288&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DR7gNsitLUEc&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FR7gNsitLUEc%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/feda0a4b3f2427378d09e5367af535fa/href">https://medium.com/media/feda0a4b3f2427378d09e5367af535fa/href</a></iframe><h4>Conclusion</h4><p>PatchMon transforms the tedious task of patch management into a streamlined, visual experience. By utilizing Docker for the backend and a simple “one liner” for your VMs, you ensure your infrastructure stays secure, updated and compliant with minimal effort.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7a07ae3ccc68" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Implementing 2FA on an Ubuntu VM]]></title>
            <link>https://medium.com/@sriranjankapilan/implementing-2fa-on-an-ubuntu-vm-a9d94cfc13ef?source=rss-6d90a6f9489e------2</link>
            <guid isPermaLink="false">https://medium.com/p/a9d94cfc13ef</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[ssh]]></category>
            <category><![CDATA[ubuntu]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[2fa-authentication]]></category>
            <dc:creator><![CDATA[Sriranjan Kapilan]]></dc:creator>
            <pubDate>Sun, 01 Feb 2026 16:01:58 GMT</pubDate>
            <atom:updated>2026-02-01T16:01:58.480Z</atom:updated>
            <content:encoded><![CDATA[<p>In the world of server administration, SSH keys are often hailed as the gold standard of security. But what happens if your laptop is stolen or your private key is accidentally committed to a public GitHub repo? Suddenly, that ‘unbreakable’ key is a master pass for an attacker. Relying on a single factor of authentication no matter how strong is a gamble. In this guide, we’re going to level up your Ubuntu VM security by layering Google Authenticator on top of your existing SSH Public Key infrastructure. By the end of this, even an attacker with your private key will be stopped dead in their tracks by a ticking 30 second code on your phone.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/962/1*33NybuPujxzranmUq2cQOQ.png" /></figure><h4>Prerequisites</h4><p>Before we dive into the terminal, ensure you have,</p><ul><li>An Ubuntu VM (assume my vm server ip address is 146.193.113.42)</li><li><strong>SSH Public Key authentication</strong> already configured and working.</li><li>An authentication app on your phone (Google Authenticator, Authy or Bitwarden).</li></ul><h4>Implementation</h4><p>◆ Install the PAM Module</p><pre>ssh 146.193.113.42<br>sudo apt update &amp;&amp; sudo apt install libpam-google-authenticator -y</pre><p>◆ Initialize 2FA for Your User.</p><p>Run this as the user you want to secure, <strong><em>without</em> sudo</strong></p><pre>google-authenticator</pre><p>then it will show QR code which we need to scan. We can use Google Authenticator mobile application to scan. Once scanned we need to enter the code. Later it will ask some confirmations.</p><ul><li>Make tokens time-based? Yes (y)</li><li>Update the .google_authenticator file? Yes (y)</li><li>Disallow multiple uses of the same token? Yes (y)</li><li>Enable rate-limiting? Yes (y)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/650/1*A384IAuWbtS3GVlrvJu-Tw.png" /></figure><p>◆ Configure PAM for SSH</p><pre>sudo nano /etc/pam.d/sshd</pre><p>then search and find the line ( @include common-auth)and comment this immediately. Then add the given code at the bottom. Finally it needs to be like this,</p><pre># @include common-auth<br>auth required pam_google_authenticator.so</pre><p>◆ SSH Configuration</p><p>Next, we edit the SSH configuration.</p><pre>sudo nano /etc/ssh/sshd_config</pre><p>Now, we must configure the SSH daemon to enforce our new security layers. We will enable interactive prompts for the 2FA code while strictly disabling traditional password logins to prevent brute force attacks.</p><pre>KbdInteractiveAuthentication yes  #(Allows the terminal to show the 2FA prompt)<br>PasswordAuthentication no  #(Disables standard password entry for everyone)<br><br><br># Define the &#39;Double-Lock&#39; Require BOTH a Key AND the 2FA Code<br>AuthenticationMethods publickey,keyboard-interactive</pre><p>◆ Handling Exceptions (<strong>if necessary only</strong>)</p><p>In many real world scenarios, you might need a specific user ( for example name <strong>johnson</strong>) to bypass the 2FA requirement and use <strong>only</strong> a Public Key.</p><p>Add a <strong>Match Block</strong> to the very end of your <em>/etc/ssh/sshd_config</em></p><pre>sudo nano /etc/ssh/sshd_config</pre><pre># Exception for user johnson: Key only, no 2FA prompt<br>Match User johnson<br>    AuthenticationMethods publickey</pre><p>◆ Restart the service and test</p><pre>sudo systemctl restart ssh</pre><p>now you can confirm that to enter into server it is asking verification code.Here we need to give correct code. Then only we can enter into server.</p><h4>Reference</h4><p><a href="https://www.youtube.com/watch?v=OBhoCu4DRO0">https://www.youtube.com/watch?v=OBhoCu4DRO0</a></p><h4>Conclusion</h4><p>We’ve just transformed a standard Ubuntu VM into a hardened vault. By combining the cryptographic strength of SSH keys with the time sensitive security of OTP (2FA), we have eliminated the risks of password cracking and mitigated the fallout of a lost private key.</p><p>Modern security isn’t about building one tall wall, it’s about building multiple layers that an attacker has to climb. Whether you’re managing a single hobbyist server or a fleet of enterprise VMs, this setup ensures that you remain the sole gatekeeper of your data. Remember stay curious, keep your emergency scratch codes in a physical safe and never stop hardening your perimeter.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a9d94cfc13ef" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Beyond Fail2ban: How CrowdSec Revolutionizes VM Server Security with Collective Intelligence]]></title>
            <link>https://medium.com/@sriranjankapilan/beyond-fail2ban-how-crowdsec-revolutionizes-vm-server-security-with-collective-intelligence-1a9f5fd25def?source=rss-6d90a6f9489e------2</link>
            <guid isPermaLink="false">https://medium.com/p/1a9f5fd25def</guid>
            <category><![CDATA[fail2ban]]></category>
            <category><![CDATA[lapis]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[crowdsec]]></category>
            <category><![CDATA[linux-security]]></category>
            <dc:creator><![CDATA[Sriranjan Kapilan]]></dc:creator>
            <pubDate>Thu, 15 Jan 2026 15:57:12 GMT</pubDate>
            <atom:updated>2026-01-15T23:02:41.400Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction: The Security Dilemma in a Connected World</h3><p>Imagine your Linux server as a medieval castle. For years, <a href="https://en.wikipedia.org/wiki/Fail2ban">Fail2ban </a>has been the steadfast gatekeeper scanning your logs for failed logins and dropping the firewall rules when threats are spotted. It’s reliable, battle tested and has protected countless servers. But in <strong>today’s world</strong> of coordinated <strong>botnet attacks and sophisticated threats</strong>, a castle standing alone is vulnerable. What if your gatekeeper could learn from every attack on every castle worldwide? That’s the revolutionary promise of CrowdSec.</p><p>In this comprehensive guide, we’ll explore why system administrators are migrating from traditional tools like Fail2ban to this collaborative security engine. We’ll demystify CrowdSec’s architecture, provide practical setup instructions for your VM infrastructure and reveal how its “collective intelligence” model solves fundamental security limitations. Whether you’re managing a single VM or a fleet of cloud servers, understanding this evolution is crucial for modern defense.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HlORwApXOq-f4oXkBu9Few.png" /></figure><h3>The Legacy Champion: Fail2ban and Its Limitations</h3><p>Fail2ban has been the go to security workhorse for over a decade. Its straightforward approach made it accessible.</p><ul><li>Lightweight Design: Minimal resource consumption, perfect for small VPS or resource constrained environments.</li><li>Simple Logic: Monitors log files, detects patterns (like 5 failed SSH attempts in 60 seconds) and blocks IPs via iptables.</li><li>Proven Effectiveness: Excellent at stopping basic brute force attacks and dictionary assaults.</li><li>Mature Ecosystem: Extensive documentation and community support.</li></ul><h3>The Fundamental Problem: Isolated Defense</h3><p>Despite its strengths, Fail2ban operates in a security vacuum. <strong>Each server fights its battles alone</strong>, creating critical vulnerabilities.</p><ol><li>The Attacker’s Advantage: A botnet probing 1,000 servers learns from each attempt, while each server gains <strong>no knowledge from attacks on the other 999.</strong></li><li>Reactive Nature: <strong>Only acts after attacks succeed locally. </strong>Which means<strong> no pre protection.</strong></li><li>Maintenance Burden: New attack patterns require manual filter updates.</li><li>Limited Scope: Primarily focuses on authentication attacks, missing complex multi-vector assaults.</li></ol><p>Real world Analogy: Fail2ban is like having a <strong>security guard who only knows what happens inside your building</strong>. If a <em>thief tries every door</em> in the <em>neighborhood</em>, each <em>building’s guard</em> must learn about that thief <em>independently</em>.</p><h3>The Collaborative Revolution: How CrowdSec Changes Everything</h3><p>CrowdSec isn’t merely a Fail2ban replacement. It’s a security platform with a fundamentally different philosophy.</p><ol><li>Local Agent: The log parser running on your VM (similar to Fail2ban’s scanning function).</li><li>Scenarios: Intelligent YAML based detection rules.</li><li>Local API (LAPI): The command center of your CrowdSec installation.</li></ol><ul><li>Manages local decisions and storage.</li><li>Curates and anonymizes data before community sharing.</li><li>Distributes global threat intelligence to your agents.</li></ul><p>4. Bouncers: Lightweight enforcement modules (like the Firewall Bouncer) that act on LAPI decisions.</p><p>5. Collective Intelligence: The curated, real time feed of malicious IPs from the global network.</p><h4>The “Magic” Behind CrowdSec</h4><p>When your VM detects an attack,</p><ol><li>The <strong>Agent identifies</strong> malicious behavior using scenarios</li><li>It <strong>reports </strong>to your <strong>LAPI</strong>, which makes the <strong>blocking decision</strong></li><li>The anonymized <strong>IP</strong> can be <strong>shared </strong>with the <strong>CrowdSec community</strong></li><li>Your server receives thousands of other verified malicious IPs in return</li><li><strong>Bouncers </strong>enforce these decisions <strong>across your infrastructure</strong></li></ol><p>finally your VM now blocks threats seen by the entire network, often before they even target you.</p><h3>CrowdSec vs Fail2ban - Detailed comparison</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lUznD2pS2Vs6IaETVFjsfg.png" /><figcaption>differences between Fail2ban and CrowdSec</figcaption></figure><h4>When to Choose Which Tool</h4><p>⬛ Choose Fail2ban when,</p><ul><li>managing a single, low traffic server.</li><li>resources are extremely constrained.</li><li>need simple, predictable protection.</li><li>threat model is limited to basic brute force attacks.</li></ul><p>⬛ Choose CrowdSec when,</p><ul><li>managing <strong>multiple VM</strong>s or a <strong>cloud infrastructure</strong>.</li><li>if u want <strong>proactive threat prevention</strong>.</li><li>services face diverse attack vectors (web apps, APIs, etc.)</li><li>value community driven <strong>security intelligence</strong></li></ul><h3>Practical Implementation</h3><p>🔴 Single Server Setup (All in one)</p><p>Your VM now has a complete CrowdSec stack agent detects threats, LAPI manages decisions and the Firewall Bouncer blocks IPs in iptables.</p><pre># 1. Install CrowdSec<br>curl -s https://packagecloud.io/install/repositories/crowdsec/crowdsec/script.deb.sh | sudo bash<br>sudo apt update<br>sudo apt install crowdsec<br><br># 2. During installation, select services to monitor:<br>#    Choose ssh, nginx/apache, and any other relevant services<br><br># 3. Install the Firewall Bouncer<br>sudo apt install crowdsec-firewall-bouncer-iptables<br><br># 4. Check your protection status<br>sudo cscli metrics</pre><p>🟠 Multi server Architecture (Centralized management)</p><ul><li>For managing multiple VMs, a centralized LAPI is more efficient.</li></ul><p>Step 1: Set up LAPI Server (Management VM)</p><pre># Install CrowdSec<br>sudo apt install crowdsec<br><br># Configure as dedicated LAPI<br>sudo cscli config set api.server.listen_uri &quot;0.0.0.0:8080&quot;<br>sudo cscli config set api.server.trusted_ips &quot;&lt;YOUR_VM_NETWORK&gt;/24&quot;<br><br># Generate machine registration credentials<br>sudo cscli machines add production-vm-01 --auto<br># Save the output token and URL</pre><p>Step 2: Configure Agent VMs</p><pre># Install CrowdSec agent only<br>sudo apt install crowdsec<br><br># Register with central LAPI<br>sudo cscli lapi register -u https://&lt;LAPI_IP&gt;:8080 -k &lt;REGISTRATION_TOKEN&gt;<br><br># Install and configure firewall bouncer<br>sudo apt install crowdsec-firewall-bouncer-iptables<br># Edit config to point to LAPI:<br>sudo nano /etc/crowdsec/bouncers/crowdsec-firewall-bouncer.yaml<br># Set: api_url: https://&lt;LAPI_IP&gt;:8080<br>#      api_key: &lt;BOUNCER_KEY_FROM_LAPI&gt;</pre><ul><li>we need to verify cross server protection. To ensure IP blocking propagates across your infrastructure,</li></ul><pre># On LAPI server, check decisions being distributed<br>sudo cscli decisions list<br><br># On any agent VM, verify firewall blocks<br>sudo iptables -L CROWDSEC -n --line-numbers<br></pre><ul><li>When any agent detects and reports a malicious IP, the LAPI immediately shares this decision with all connected bouncers, creating synchronized protection across your entire VM fleet.</li></ul><h4>Monitoring and Maintenance</h4><pre># View security metrics<br>sudo cscli metrics<br><br># Check active decisions (blocked IPs)<br>sudo cscli decisions list<br><br># Monitor community contributions<br>sudo cscli capi status<br><br># Review alerts and timelines<br>sudo journalctl -u crowdsec -f<br><br># Reload CrowdSec<br>sudo systemctl reload crowdsec</pre><p>⚫ Multi server CrowdSec architecture</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UdWBhpQWT5GlNy9JtOf0IA.png" /></figure><p>♦ verify at the source (LAPI server)</p><p>The LAPI is the command center. All blocking decisions are made here and distributed. First, check if the IP is in the central block list.</p><pre># Block a single IP for 4 hours (default duration)<br>sudo cscli decisions add --ip 203.0.113.50 --duration 4h --reason &quot;Manual block for suspicious activity&quot;<br><br># Block an entire subnet<br>sudo cscli decisions add --ip 203.0.113.0/24 --duration 2h --reason &quot;Block malicious subnet&quot;</pre><p>now verify output that <strong>includes the blocked IP</strong>.</p><pre><br># Check block <br>sudo cscli decisions list -i 203.0.113.50<br><br># Output will show:<br># ┌─────────┬──────────┬─────────────────┬──────────────────────────┐<br># │   ID    │  SOURCE  │       IP        │         REASON           │<br># ├─────────┼──────────┼─────────────────┼──────────────────────────┤<br># │ 99999   │  cscli   │ 203.0.113.50    │ Manual SSH block         │<br># └─────────┴──────────┴─────────────────┴──────────────────────────┘</pre><p>♦ verify enforcement on each agent VM</p><p>A decision on the LAPI means it was <em>sent</em> to all bouncers. You must then confirm it was <em>received and applied</em> on each server’s firewall.</p><pre># On ANY Agent VM, check the CROWDSEC firewall chain<br>sudo iptables -L CROWDSEC -n --line-numbers<br><br># or if using nftables,<br>sudo nft list chain inet crowdsec crowdsec_chain</pre><p>You should see your blocked IP ( 203.0.113.50) in a DROP or REJECT rule within the crowdsec chain.</p><h3>Conclusion</h3><p>The journey from Fail2ban to CrowdSec represents more than just a tool replacement, it’s a paradigm shift in how we think about server security. Where Fail2ban gave us reliable, isolated defense, CrowdSec offers interconnected, intelligent protection.</p><p>For VM administrators, the choice is becoming clearer. You can continue with individual guardians for each server or you can join a global alliance where every participant makes the network stronger. In an era of botnets and distributed attacks, collective intelligence isn’t just an advantage, it’s becoming a necessity.</p><h4>Reference</h4><ul><li><a href="https://www.letshosting.com/16626.html">https://www.letshosting.com/16626.html</a></li><li><a href="https://danielmiessler.com/blog/crowdsec">https://danielmiessler.com/blog/crowdsec</a></li><li><a href="https://www.youtube.com/watch?v=-GxUP6bNxF0">https://www.youtube.com/watch?v=-GxUP6bNxF0</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1a9f5fd25def" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>