<?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 Mariskarthickm on Medium]]></title>
        <description><![CDATA[Stories by Mariskarthickm on Medium]]></description>
        <link>https://medium.com/@mariskarthickm?source=rss-82eafcc2a231------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*kq1MSLvnGKxg0EC7OVJJAQ.jpeg</url>
            <title>Stories by Mariskarthickm on Medium</title>
            <link>https://medium.com/@mariskarthickm?source=rss-82eafcc2a231------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 15:19:32 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mariskarthickm/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[Diagnosing Data: Learning Elasticsearch Through a Doctor’s Eyes]]></title>
            <link>https://medium.com/@mariskarthickm/diagnosing-data-learning-elasticsearch-through-a-doctors-eyes-4a29921c6720?source=rss-82eafcc2a231------2</link>
            <guid isPermaLink="false">https://medium.com/p/4a29921c6720</guid>
            <category><![CDATA[elastic-stack]]></category>
            <category><![CDATA[elastic]]></category>
            <category><![CDATA[elasticsearch]]></category>
            <dc:creator><![CDATA[Mariskarthickm]]></dc:creator>
            <pubDate>Sun, 26 Jul 2026 20:06:52 GMT</pubDate>
            <atom:updated>2026-07-27T04:02:23.112Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lRSsgUsA9jacRHo2_zXJsA.png" /></figure><p>Every diagnosis begins with a clue. A patient describes something like “itchy purple spots on the legs,” and an experienced doctor begins narrowing down the possibilities using pattern, symptom, and history to reach the most likely answer.</p><p>Elasticsearch works in a surprisingly similar way. It takes data, organizes it intelligently, and makes it searchable almost instantly. Instead of scanning every record one by one, it prepares data in advance so searches can jump directly to what matters.</p><h3>Why Elasticsearch feels different</h3><p>Most databases are built mainly to store and retrieve records. Elasticsearch is built to <strong>search</strong> them fast, which is why it’s used so heavily in logs, monitoring, analytics, and large text-heavy datasets.</p><p>Elasticsearch is built on <strong>Apache Lucene</strong>, a high-performance search library responsible for creating inverted indexes and executing searches at the core level. Elasticsearch takes Lucene and adds distributed storage, clustering, REST APIs, and horizontal scalability on top of it. In short, Lucene is the engine, and Elasticsearch is what turns that engine into a scalable, production-ready system.</p><p>Elasticsearch exposes REST APIs, so applications send HTTP requests and receive JSON responses. It also offers official client libraries in languages like Python and Java, so developers aren’t limited to raw HTTP calls.</p><h3>The patient record analogy</h3><p>Think of each incoming record as a patient case file. A single <strong>document</strong> is one case file, stored inside an <strong>index</strong>, which is simply a collection of related documents.</p><pre>{<br>  &quot;patient&quot;: &quot;Case 214&quot;,<br>  &quot;symptom&quot;: &quot;itchy purple spots&quot;,<br>  &quot;location&quot;: &quot;legs&quot;,<br>  &quot;diagnosis&quot;: &quot;pigmented purpuric dermatosis&quot;<br>}</pre><p>If one case is about dermatology, it belongs in a dermatology registry. Keeping similar records together is what makes search easier later.</p><h3>How Elasticsearch stores data</h3><p>When a new document enters Elasticsearch, it doesn’t just sit in a drawer. Elasticsearch analyses the text and converts it into searchable tokens using an analyzer — we’ll explore analyzers in more detail in a later article. These tokens are written into Lucene segments that contain an inverted index. As more data comes in, Elasticsearch merges these segments once a certain threshold is reached, which is part of what keeps performance stable over time.</p><p>That preparation is what makes searches nearly instantaneous.</p><h3>Horizontal vs vertical scaling</h3><p>Here’s a distinction that explains almost everything about how Elasticsearch grows.</p><p><strong>Vertical scaling</strong> means making one machine more powerful — more CPU, more RAM, more storage on the same server. It’s like a single hospital ward getting a bigger building.</p><p><strong>Horizontal scaling</strong> means adding more machines instead of making one bigger. It’s like opening new wards across the hospital instead of expanding a single one endlessly.</p><p>Elasticsearch is designed as a horizontally scalable engine. Instead of relying on one powerful server, it grows by adding more nodes to the cluster. Vertical scaling always hits a ceiling — there’s a limit to how big one machine can get. Horizontal scaling doesn’t have that same hard limit, which is why Elasticsearch clusters can keep growing as data increases.</p><blockquote><strong><em>In plain technical terms:</em></strong><em> Horizontal scaling adds more nodes to a cluster to increase capacity. Vertical scaling increases the resources (CPU, RAM, disk) of a single existing node. Elasticsearch is designed to scale horizontally by default.</em></blockquote><h3>Clusters, nodes, and shards</h3><p>Elasticsearch runs as a <strong>cluster</strong>, a group of servers working together, where each server is a <strong>node</strong>.</p><p>As data grows, an index gets split into <strong>shards</strong>. A shard is simply a smaller piece of an index. Instead of storing every document in one huge location, Elasticsearch divides the index into multiple shards that can live on different nodes. This is what allows a single index to scale beyond the capacity of any one machine.</p><p>This raises a practical question: if there are multiple nodes, which one should your application talk to? In practice, requests are typically distributed across nodes using client-side round-robin, a load balancer, or a coordinating node. The important idea is to avoid sending every request to a single node — the way a hospital spreads incoming patients across available doctors instead of overloading one, keeping the cluster balanced and responsive.</p><h3>Primary vs replica shards</h3><p>Every shard falls into one of two roles.</p><p><strong>Primary shards</strong> store the original data. When you index a document, it’s written to a primary shard first.</p><p><strong>Replica shards</strong> are exact copies of primary shards, kept on different nodes. If a node holding a primary shard fails, Elasticsearch automatically promotes one of its replicas to take over, so the cluster keeps serving requests without data loss. Replicas also improve search throughput, since queries can be distributed across both primary and replica shards instead of relying on the primary alone.</p><p>In medical terms: the primary shard is the original chart, and the replica is the backup copy kept in another department. If the original goes missing, the backup keeps the patient’s history intact.</p><blockquote><strong><em>In plain technical terms:</em></strong><em> A primary shard holds the authoritative copy of a subset of an index’s data. A replica shard is a synchronized copy of a primary shard, stored on a different node, used for failover and to distribute read/search load.</em></blockquote><h3>An important limitation: primary shard count is fixed</h3><p>One rule catches many beginners off guard: <strong>you cannot change the number of primary shards on an index after it’s created.</strong> If you created an index with 3 primary shards, it stays at 3 for the life of that index. You can add or remove replica shards later, but the primary shard count is locked in at creation time. Changing it means reindexing into a brand-new index.</p><p>This is similar to deciding, at the moment a hospital registry is created, exactly how many main sections it will be divided into. You can add backup copies of records later, but you can’t casually resize the core structure without rebuilding the registry from scratch.</p><p>Because of this, it’s worth planning shard count carefully upfront, based on expected data volume, rather than treating it as something to fix later.</p><h3>Why an odd number of nodes is recommended</h3><p>There’s another practical rule worth knowing: it’s better to run an <strong>odd number of master-eligible nodes</strong> in a cluster.</p><p>Clusters need to reach agreement (a “quorum”) on decisions like which node is the master. Historically, this helped prevent split-brain scenarios, where different parts of a cluster disagree on leadership. Modern Elasticsearch has greatly improved its cluster coordination subsystem, but an odd number of master-eligible nodes is still the recommended design because it simplifies quorum decisions and avoids the possibility of a tie.</p><p>Think of it like a hospital board voting on a decision — an odd number of members avoids deadlocked ties.</p><blockquote><strong><em>In plain technical terms:</em></strong><em> An odd number of master-eligible nodes ensures a cluster can always reach a majority (quorum) when electing a master node, avoiding tie-vote scenarios during leader election.</em></blockquote><h3>The real magic — the Inverted Index</h3><p>When an experienced doctor hears “itchy purple spots on legs,” their brain doesn’t search chronologically, case by case. It jumps straight to a shortlist of likely diagnoses, built from years of pattern recognition.</p><p>Elasticsearch’s inverted index works the same way — instead of asking “does this file contain the word ‘purple’?” for every single document, it already knows which documents contain which terms, and jumps straight to matches.</p><h3>From TF-IDF to BM25: how relevance is ranked</h3><p>Finding matching documents is only half the story. Elasticsearch also needs to decide <strong>which</strong> match is most relevant — the same way a doctor doesn’t just list every possible diagnosis, but ranks the most likely ones first.</p><p>Historically, Elasticsearch ranked documents using <strong>TF-IDF: Term Frequency × Inverse Document Frequency.</strong></p><ul><li><strong>Term Frequency (TF)</strong> measures how often a term appears within a single document. If “purple” appears five times in one case file, that file is likely more relevant to a “purple” search than one where it appears once.</li><li><strong>Inverse Document Frequency (IDF)</strong> measures how rare or common a term is across <em>all</em> documents. If “spots” appears in almost every dermatology case file, it’s too common to be distinctive. A rarer term like “purpuric” appearing in only a few files makes those files stand out.</li></ul><p>The intuition is simple: rare, specific terms are more useful for narrowing down a match than common, generic ones — exactly like how a rare, specific symptom is more diagnostically useful than a common one.</p><p>It’s worth being accurate here: <strong>modern Elasticsearch no longer uses TF-IDF as its default scoring method.</strong> Since Elasticsearch 5, the default similarity algorithm is <strong>BM25</strong>, which builds on the same core intuition as TF-IDF but improves how it handles term frequency saturation and document length. TF-IDF remains important to learn because it’s the foundation BM25 evolved from, and understanding it makes BM25 far easier to grasp when we cover it in the next article.</p><blockquote><strong><em>In plain technical terms:</em></strong><em> TF-IDF scores a term’s relevance by multiplying how often it appears in a document (term frequency) by how rare it is across all documents (inverse document frequency). BM25, the current default, refines this by capping the effect of repeated terms and factoring in document length.</em></blockquote><h3>Try it yourself</h3><p>Here’s how the shard and replica concepts translate into an actual Elasticsearch command:</p><pre>PUT /dermatology_cases<br>{<br>  &quot;settings&quot;: {<br>    &quot;number_of_shards&quot;: 3,<br>    &quot;number_of_replicas&quot;: 2<br>  }<br>}<br></pre><p>This creates an index with 3 primary shards (each holding a distinct portion of the data) and 2 replica copies of each primary shard, spread across available nodes for resilience and read scaling.</p><h3>Technical recap</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Yst-9GyvmHbSQ1C1-5cBEA.png" /></figure><h3>The first big idea</h3><p>Elasticsearch doesn’t search quickly because it scans faster. It searches quickly because it prepares smarter.</p><p>That’s the fundamental idea behind everything you’ve learned in this article — a system built on Lucene that organizes data in advance, scales horizontally across nodes, protects itself with primary and replica shards, distributes load intelligently, and ranks results using relevance scoring that evolved from TF-IDF into BM25.</p><h3>What comes next</h3><p>In the next blog, we’ll move into <strong>mapping and indexing data</strong>, and take a closer look at how BM25 actually works ,how Elasticsearch decides the shape of a document, how fields are stored, and why the same input can behave differently depending on the mapping.</p><h3>Connect Me :)</h3><p>If you have any suggestions for improvement or need help regarding this topic, feel free to reach out to me on <a href="https://www.linkedin.com/in/mariskarthickm/">Mariskarthick M | LinkedIn</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4a29921c6720" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[You Vibe-Coded a Tool. Now What?]]></title>
            <link>https://medium.com/@mariskarthickm/you-vibe-coded-a-tool-now-what-75c484d54aaf?source=rss-82eafcc2a231------2</link>
            <guid isPermaLink="false">https://medium.com/p/75c484d54aaf</guid>
            <category><![CDATA[vibecodingatool]]></category>
            <category><![CDATA[artificalintelligence]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[productdevolopmentwithai]]></category>
            <category><![CDATA[vibe-coding]]></category>
            <dc:creator><![CDATA[Mariskarthickm]]></dc:creator>
            <pubDate>Wed, 15 Apr 2026 17:04:11 GMT</pubDate>
            <atom:updated>2026-04-16T14:48:02.302Z</atom:updated>
            <content:encoded><![CDATA[<h3>The 8 Question Ship-Ready Test every builder must pass through a Product Developer, CEO, and CISO lens.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o78RWe7NsbMBbvrVsm_bmA.png" /></figure><p>AI made building fast. Everyone’s shipping tools in a weekend. But speed without strategy is just technical debt with a landing page.</p><p>The builders who win aren’t the fastest, they’re the ones who pause long enough to ask the right questions.</p><p><strong>These 8 questions are that pause.</strong></p><h3>The 8-Question Ship-Ready Test</h3><h3>01. What pain are you actually solving?</h3><p><em>Product Developer + CEO</em></p><p>“I thought it would be useful” is not a why. A valid why is rooted in a real, observed, repeatable pain. Someone woke up this morning wishing this existed — can you describe that person in one sentence?</p><p>The sharper your why, the tighter your scope. Vague why = feature creep, scope drift, and a product that tries to solve everything and succeeds at nothing. Most early-stage tools churn in under 90 days — not because they were badly built, but because no one actually needed them.</p><blockquote><strong><em>The test:</em></strong><em> Describe your tool’s purpose in one sentence. If it contains the word “and” more than once, your scope is already drifting.</em></blockquote><h3>02. What can’t be copied in 2 weeks?</h3><p><em>Product Developer + CEO</em></p><p>Connecting open-source tools is infrastructure, not differentiation. Everyone can connect MISP to VirusTotal to Shodan. That’s plumbing.</p><p>Your differentiation is the logic, scoring, automation, and UX decisions that sit on top of the plumbing. Strip away every open-source component — does what remains still have value? If yes, <em>that’s</em> your product.</p><blockquote><strong><em>The moat question:</em></strong><em> Can a well-funded team reproduce your tool in a weekend using the same AI tools you used? If yes — your real moat has to be data, network effects, proprietary logic, or domain expertise that takes years to build, not hours.</em></blockquote><h3>03. Who pays, and why won’t they stop?</h3><p><em>CEO</em></p><p>Free tools get used. Paid tools get evaluated. Your business model shapes everything — pricing signals positioning, tier structure defines your ICP, revenue model drives infrastructure decisions.</p><p>SaaS, self-hosted license, BYOK, usage-based, contract — each has different buyers, different objections, different GTM motions. “We’ll figure out monetization later” is how you build a popular free tool that drains your time and your cloud bill.</p><blockquote><strong><em>Three questions every serious buyer will ask:</em></strong></blockquote><ul><li>Who pays, how much, and how often?</li><li>What does it cost you to serve one customer?</li><li>Why won’t they churn after 90 days?</li></ul><h3>04. Did you build it securely — or just functionally?</h3><p><em>Product Developer + CISO</em></p><p>AI generates functional code. It does not proactively flag that your API key is exposed in the frontend bundle, your auth check is bypassable, or that your dependency hasn’t been patched in 18 months.</p><p><strong>Vibe coding creates vibe security — which is no security posture at all.</strong></p><p>80% of breaches trace back to basics: leaked credentials, missing input validation, unpatched libraries. When your tool touches customer data or security infrastructure, a breach isn’t a bug report. It’s a company-ending event.</p><blockquote><strong><em>Pre-ship security checklist:</em></strong></blockquote><ul><li>No secrets in frontend code or public repos</li><li>Auth is real — not just a login page with no session validation</li><li>All data in transit is encrypted (TLS 1.2+)</li><li>Dependencies audited (npm audit / pip-audit)</li><li>Input sanitization on every user-controlled field</li><li>You know exactly what data you’re storing and where</li></ul><h3>05. Did you vet the tools you integrated?</h3><p><em>CISO + Product Developer</em></p><p>You connected 6 open-source tools. Did you vet any of them?</p><p>Open-source ≠ safe. Abandoned repos, unmaintained dependencies, and supply chain attacks are documented, real attack vectors. <strong>When you integrate a tool, you inherit its entire risk surface.</strong> Your customer doesn’t care that the vulnerability was in a library you didn’t write — it was in your product.</p><blockquote><strong><em>For each integrated tool, ask:</em></strong></blockquote><ul><li>When was it last maintained?</li><li>What data does it touch or transmit?</li><li>Is there a security contact for incidents?</li><li>What are the license implications for commercial use?</li></ul><h3>06. Can it pass an InfoSec review?</h3><p><em>CISO + CEO</em></p><p>Buyers don’t evaluate features first. They evaluate risk first.</p><p>Before your demo reaches a decision maker, it passes through procurement and an InfoSec review. If you can’t answer questions about ISO 27001, SOC 2, GDPR, NCA ECC, PDPL, or SAMA — you’re not getting past the gate. You won’t even know you didn’t — they’ll just go quiet.</p><p>Compliance isn’t bureaucratic overhead. In regulated markets, it <em>is</em> the buying criterion.</p><blockquote><strong><em>GCC-specific:</em></strong><em> Targeting Saudi Arabia, UAE, or wider GCC market? NCA ECC compliance posture, PDPL data residency, and SAMA guidelines will come up in every serious conversation. Know your position before the first meeting — not during it.</em></blockquote><h3>07. What breaks at 2am and who fixes it?</h3><p><em>Product Developer + CEO</em></p><p>Here’s the thing about AI-generated code — it works until it doesn’t. And when it doesn’t, the gap shows immediately. Not a bug you can Google. A system behaviour you don’t understand because you never had to think about what sits underneath the code: how processes talk to each other, how traffic actually moves, what a container boundary means for your data, why that upstream API timing out takes your whole app with it.</p><p>Most vibe-built tools skip this layer entirely. The result isn’t just fragility — it’s invisibility. You can’t fix what you can’t see, and you can’t see what you never learned to look for.</p><p>So before you ship: who handles production issues? What’s your patch cadence when a dependency CVE drops? What actually has to change when usage triples? If those answers are vague, your tool isn’t ready — it’s just ready-looking.</p><blockquote><strong><em>Define these three things before launch:</em></strong></blockquote><ul><li><strong>On-call:</strong> Who handles production issues? How fast is your SLA?</li><li><strong>Patch cadence:</strong> How often do you review and update dependencies?</li><li><strong>Scaling trigger:</strong> What architecture change is needed at 10× users?</li></ul><h3>08. Can you pitch it in 3 sentences?</h3><p><em>CEO</em></p><p>A demo is not a pitch. A pitch answers: who is this for, what do they gain, why now, and why you?</p><p><em>“AI-powered security tool”</em> tells a buyer nothing. <em>“We cut your Tier-1 analyst’s IOC triage time by 70% with automated scoring across 6 intel sources”</em> — that’s a pitch.</p><p>Speak in outcomes. Your buyer doesn’t care how it’s built. They care what changes on Monday morning when they deploy it.</p><blockquote><strong><em>The 3-sentence pitch formula:</em></strong></blockquote><ul><li><strong>Pain:</strong> [persona] spends [time/cost] on [problem]</li><li><strong>Fix:</strong> Our tool [mechanism] that solves it</li><li><strong>Proof:</strong> [customer/metric/result] shows it works</li></ul><h3>Case Study : The Developer Who Almost Shipped It Wrong</h3><p>Here’s what all 8 questions look like applied to one real scenario.</p><p>A developer built an AI-powered code review tool over a weekend: GitHub integration, Semgrep for static analysis, an LLM to turn findings into plain English that developers actually act on. It worked. They were about to post on LinkedIn. “Launching tomorrow.”</p><p>Then they answered these 8 questions. Almost everything changed.</p><p>Their first prospect — before even seeing a demo — asked one question: <em>“Where is our code stored when it goes through your tool?”</em></p><p>They couldn’t answer. The conversation ended there.</p><p>Here’s what they fixed:</p><p><strong>The why was sharp:</strong> Junior devs were merging insecure code because long SAST reports went unread. Specific problem, specific persona.</p><p><strong>The moat was real:</strong> Not “AI summaries” — findings prioritized by exploitability, mapped to the team’s specific stack, with one-click fix suggestions. The prompt engineering and workflow UX took weeks to tune. That’s not copyable in a weekend.</p><p><strong>The business model solved an objection:</strong> Per-repo SaaS for SMBs. Companies gets self-hosted BYOK — code never leaves their infra. That one decision eliminated the most common blocker before it was ever raised.</p><p><strong>The security gap they almost shipped:</strong> GitHub OAuth tokens were being logged in plaintext. Caught pre-launch. Fixed with encrypted storage and token rotation. Would have been critical in production.</p><p><strong>Third-party risk cleared:</strong> Semgrep OSS — actively maintained, clean commercial license. OpenAI API — DPA reviewed and signed. Documented.</p><p><strong>Compliance path defined:</strong> SOC 2 Type I roadmap started before the first call. GDPR DPA templated. No customer code retained beyond the PR review window.</p><p><strong>The outcome:</strong> What started as a weekend project became a fundable product with a clear ICP, a defensible moat, a security story, and a compliance path. Nothing about the code changed. Only the thinking around it did.</p><h3>The Ship-Ready Checklist</h3><p>Before you post “Launching tomorrow” — run through this:</p><ul><li>I can name the exact person this solves a problem for</li><li>My differentiation survives removing every open-source component</li><li>I know who pays, how much, and why they won’t churn</li><li>No secrets exposed, auth is real, deps are audited</li><li>Every integrated tool has been vetted for maintenance and risk</li><li>I can answer basic compliance questions for my target market</li><li>I have a maintenance plan and know what breaks at scale</li><li>I can pitch the outcome in 3 sentences</li></ul><h3>Build with Intent. Not Just Vibes.</h3><p>The tools that matter aren’t the ones built in a weekend. They’re the ones <em>designed</em> with purpose, shipped with security, and sold with a clear story.</p><p>The weekend sprint is just how you start. The 8-Question Ship-Ready Test is how you make it real.</p><p><strong><em>AI can write your code. It cannot own your system. That part still has to live in you</em></strong></p><p><strong>Next time you open an AI assistant to build something — open a notes app first. Answer these 8 questions. <em>Then</em> code.</strong></p><p><em>Which of these 8 questions can you not answer today? Drop it in the comments — let’s work through it.</em></p><p>#ProductBuilding #VibeCoding #SecurityByDesign #BuildInPublic #AITools #Devoloper #ProductDevoloper #Architect #systemdesign #CISO #Cybersecurity</p><h3>Connect Me :)</h3><p>If you have any suggestions for improvement or need help regarding this topic, feel free to reach out to me on <a href="https://www.linkedin.com/in/mariskarthickm/">Mariskarthick M | LinkedIn</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=75c484d54aaf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Scale Your SOC: Integrating Wazuh with ClickHouse for Long-Term Storage]]></title>
            <link>https://medium.com/@mariskarthickm/scale-your-soc-integrating-wazuh-with-clickhouse-for-long-term-storage-83094eba5667?source=rss-82eafcc2a231------2</link>
            <guid isPermaLink="false">https://medium.com/p/83094eba5667</guid>
            <dc:creator><![CDATA[Mariskarthickm]]></dc:creator>
            <pubDate>Sat, 27 Dec 2025 04:03:51 GMT</pubDate>
            <atom:updated>2026-01-01T05:28:32.548Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oDHiENz0a1GJPD0sUKfixw.png" /></figure><h3>🔎 Introduction</h3><p>Wazuh is a powerful open-source security monitoring platform with real-time alerting, threat detection, and compliance reporting.However, when you need <strong>long-term storage</strong>, handling <strong>months to years</strong> of data efficiently becomes challenging and expensive with full-text search engines.</p><p>This is where <strong>ClickHouse</strong> shines — a columnar analytics database designed for storing large volumes of data with excellent query performance and low storage cost.</p><p>In this post, we will walk through integrating Wazuh with ClickHouse to offload and store alert data for long-term retention.</p><h3>🧠 Why ClickHouse?</h3><p>ClickHouse is a column-oriented database designed for fast analytical queries on large datasets, which makes it a strong fit for long-term retention and reporting use cases.</p><h3>🏗️ Architecture Overview</h3><p>Here’s the flow we are building:</p><pre>Wazuh Manager<br>  └── /var/ossec/logs/alerts/alerts.json<br>        └── Vector (log shipper)<br>            └── ClickHouse (long-term storage)</pre><p>We parse and ship only essential fields for fast search, while still retaining the <strong>full event JSON</strong> for deep inspection.</p><h3>🧪 Step-by-Step — Implementation</h3><h3>🔹 Step 1 — Install ClickHouse</h3><p>Create key-rings and add the official ClickHouse repo on Ubuntu:</p><pre>sudo mkdir -p /usr/share/keyrings<br>curl -fsSL &#39;https://packages.clickhouse.com/rpm/lts/repodata/repomd.xml.key&#39; \<br>  | sudo gpg --dearmor -o /usr/share/keyrings/clickhouse-keyring.gpg<br>ARCH=$(dpkg --print-architecture)<br>echo &quot;deb [signed-by=/usr/share/keyrings/clickhouse-keyring.gpg arch=${ARCH}] https://packages.clickhouse.com/deb stable main&quot; \<br>  | sudo tee /etc/apt/sources.list.d/clickhouse.list<br>sudo apt-get update<br>sudo apt-get install -y clickhouse-server clickhouse-client<br>sudo systemctl enable --now clickhouse-server<br>sudo service clickhouse-server start</pre><h3>🔹 Step 2 — Create Database and Table</h3><p>Login to <strong>ClickHouse </strong>and set up the schema:</p><pre>clickhouse-client</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1VD_yz-SZxAAdyHDHjO76A.png" /></figure><pre>CREATE DATABASE IF NOT EXISTS wazuh;<br><br>CREATE TABLE IF NOT EXISTS wazuh.alerts<br>(<br>  ts DateTime,<br>  agent_id String,<br>  agent_name String,<br>  rule_id UInt32,<br>  rule_level UInt8,<br>  location String,<br>  full_log String,<br>  raw String<br>)<br>ENGINE = MergeTree<br>PARTITION BY toDate(ts)<br>ORDER BY (ts, rule_level, rule_id, agent_id);sThis table stores parsed columns for fast querying, plus a raw column to keep the original JSON intact.</pre><p>This table stores parsed columns for fast querying, plus a raw column to keep the original JSON intact.</p><h3>🔹 Step 3 — Create a Limited ClickHouse User</h3><pre>CREATE USER IF NOT EXISTS vector IDENTIFIED BY &#39;Vector@123!ChangeMe&#39;;<br>GRANT INSERT, SELECT ON wazuh.alerts TO vector;</pre><p>We avoid giving ALTER, DROP, or other maintenance privileges to the ingestion user.</p><h3>🔹 Step 4 — Install Vector Log Shipper</h3><p>Vector will read the alerts.json file and ship it to ClickHouse.</p><pre>curl -1sLf https://repositories.timber.io/public/vector/cfg/setup/bash.deb.sh \<br>  | sudo -E bash<br>sudo apt-get update<br>sudo apt-get install -y vector<br>sudo systemctl enable --now vector</pre><p>Ensure Vector can read logs:</p><pre>sudo usermod -aG wazuh vector<br>sudo systemctl restart vector</pre><h3>🔹 Step 5 — Vector Configuration</h3><p>Edit /etc/vector/vector.yaml:</p><pre>sources:<br>  wazuh_alerts:<br>    type: file<br>    include:<br>      - /var/ossec/logs/alerts/alerts.json<br>    read_from: end<br><br>transforms:<br>  parse:<br>    type: remap<br>    inputs: [wazuh_alerts]<br>    source: |<br>      raw_line = .message<br>      event = parse_json!(raw_line)<br><br>      ts_obj = parse_timestamp(event.timestamp, &quot;%Y-%m-%dT%H:%M:%S%.f%z&quot;) ?? now()<br>      ts_str = format_timestamp!(ts_obj, &quot;%F %T&quot;)<br><br>      . = {<br>        &quot;ts&quot;: ts_str,<br>        &quot;agent_id&quot;: to_string(event.agent.id) ?? &quot;&quot;,<br>        &quot;agent_name&quot;: to_string(event.agent.name) ?? &quot;&quot;,<br>        &quot;rule_id&quot;: to_int(event.rule.id) ?? 0,<br>        &quot;rule_level&quot;: to_int(event.rule.level) ?? 0,<br>        &quot;location&quot;: to_string(event.location) ?? &quot;&quot;,<br>        &quot;full_log&quot;: to_string(event.full_log) ?? &quot;&quot;,<br>        &quot;raw&quot;: raw_line<br>      }<br><br>sinks:<br>  ch:<br>    type: clickhouse<br>    inputs: [parse]<br>    endpoint: &quot;http://127.0.0.1:8123&quot;<br>    database: wazuh<br>    table: alerts<br>    auth:<br>      strategy: basic<br>      user: vector<br>      password: &quot;Vector@123!ChangeMe&quot;</pre><p>Save and:</p><pre>sudo vector validate<br>sudo systemctl restart vector</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SR8Ox9VVWB7isWzJGvBB0g.png" /></figure><h3>🧪 Step 6 — Verify Data Ingestion</h3><p>Login to Client House client and verify</p><p>Check counts:</p><pre>#login to Clickhouse client<br>clickhouse-client<br><br>#verify the Alerts count using the below command<br>SELECT count() FROM wazuh.alerts;<br><br>#Raw JSON view:<br>SELECT raw FROM wazuh.alerts ORDER BY ts DESC LIMIT 1;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Yj_z9rEQpgIl7tNV8Dd30w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GlhruBPGwzdrXHAM_7TrbQ.png" /></figure><h3>🕐 Step 7 — Enable Retention (TTL)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ZmRXx3FHzfh2mx4r.png" /></figure><p>Login as admin:</p><pre>clickhouse-client --password</pre><p>Apply TTL:</p><pre>ALTER TABLE wazuh.alerts MODIFY TTL ts + INTERVAL 180 DAY;</pre><p>Confirm:</p><pre>SHOW CREATE TABLE wazuh.alerts\G</pre><h3>🧠 What You Achieved</h3><p>✅ Long-term storage of Wazuh alerts<br> ✅ ClickHouse as analytical backend<br> ✅ Fast filtered queries<br> ✅ Full raw JSON retained<br> ✅ Easy future expansion for logs/archives</p><p>So far, we have successfully integrated <strong>Wazuh alerts</strong> into <strong>ClickHouse</strong> using <strong>Vector</strong>.<br> This gives us long-term storage for <strong>security-relevant events</strong>.</p><p>But in real SOC environments, <strong>alerts alone are not enough</strong>.</p><p>We also need:</p><ul><li>🔍 <strong>Raw logs (archives)</strong> for investigations</li></ul><p>Let’s see how to extend this setup.</p><h3>🔍 What Are Wazuh Archives Logs?</h3><p>Wazuh stores <strong>all raw events</strong> (not just alerts) in:</p><pre>/var/ossec/logs/archives/archives.json</pre><p>📌 <strong>Why archives matter</strong></p><ul><li>Threat hunting</li><li>Incident investigations</li><li>Forensics &amp; compliance</li><li>Re-running detection logic later</li></ul><p><strong>Pipeline flow:</strong></p><pre>Wazuh Manager<br> ├─ alerts.json   ──▶ Vector ──▶ ClickHouse (alerts table)<br> └─ archives.json ─▶ Vector ──▶ ClickHouse (archives table)</pre><h3>🛠️ Adding Archives Logs to ClickHouse</h3><h3>Step 1️⃣ Create a ClickHouse Table for Archives</h3><p>Archives are <strong>large and unstructured</strong>, so we store them mostly as raw JSON.</p><pre>CREATE TABLE wazuh.archives<br>(<br>    ts          DateTime,<br>    agent_id    String,<br>    agent_name  String,<br>    location    String,<br>    raw         String<br>)<br>ENGINE = MergeTree<br>PARTITION BY toDate(ts)<br>ORDER BY ts;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uMKuJIygjoo3I0Rmq6p-eg.png" /></figure><p>This keeps ingestion <strong>fast and flexible</strong>.</p><h3>Step 2️⃣ Add Archives Source in Vector</h3><p>In /etc/vector/vector.yaml:</p><pre>sources:<br>  wazuh_alerts:<br>    type: file<br>    include:<br>      - /var/ossec/logs/alerts/alerts.json<br>    read_from: end<br><br>  wazuh_archives:<br>    type: file<br>    include:<br>      - /var/ossec/logs/archives/archives.json<br>    read_from: end<br><br>transforms:<br>  parse_alerts:<br>    type: remap<br>    inputs: [wazuh_alerts]<br>    source: |<br>      raw_line = .message<br>      event = parse_json!(raw_line)<br><br>      ts_obj = parse_timestamp(event.timestamp, &quot;%Y-%m-%dT%H:%M:%S%.f%z&quot;) ?? now()<br>      ts_str = format_timestamp!(ts_obj, &quot;%F %T&quot;)<br><br>      . = {<br>        &quot;ts&quot;: ts_str,<br>        &quot;agent_id&quot;: to_string(event.agent.id) ?? &quot;&quot;,<br>        &quot;agent_name&quot;: to_string(event.agent.name) ?? &quot;&quot;,<br>        &quot;rule_id&quot;: to_int(event.rule.id) ?? 0,<br>        &quot;rule_level&quot;: to_int(event.rule.level) ?? 0,<br>        &quot;location&quot;: to_string(event.location) ?? &quot;&quot;,<br>        &quot;full_log&quot;: to_string(event.full_log) ?? &quot;&quot;,<br>        &quot;raw&quot;: raw_line<br>      }<br><br>  parse_archives:<br>    type: remap<br>    inputs: [wazuh_archives]<br>    source: |<br>      raw_line = .message<br>      event = parse_json!(raw_line)<br><br>      ts_obj = parse_timestamp(event.timestamp, &quot;%Y-%m-%dT%H:%M:%S%.f%z&quot;) ?? now()<br>      ts_str = format_timestamp!(ts_obj, &quot;%F %T&quot;)<br><br>      . = {<br>        &quot;ts&quot;: ts_str,<br>        &quot;agent_id&quot;: to_string(event.agent.id) ?? &quot;&quot;,<br>        &quot;agent_name&quot;: to_string(event.agent.name) ?? &quot;&quot;,<br>        &quot;location&quot;: to_string(event.location) ?? &quot;&quot;,<br>        &quot;raw&quot;: raw_line<br>      }<br><br>sinks:<br>  ch_alerts:<br>    type: clickhouse<br>    inputs: [parse_alerts]<br>    endpoint: http://127.0.0.1:8123<br>    database: wazuh<br>    table: alerts<br>    auth:<br>      strategy: basic<br>      user: vector<br>      password: &quot;Vector@123!ChangeMe&quot;<br><br>  ch_archives:<br>    type: clickhouse<br>    inputs: [parse_archives]<br>    endpoint: http://127.0.0.1:8123<br>    database: wazuh<br>    table: archives<br>    auth:<br>      strategy: basic<br>      user: vector<br>      password: &quot;Vector@123!ChangeMe&quot;</pre><p>✅ Validate &amp; Restart</p><pre>sudo vector validate<br>sudo systemctl restart vector<br>sudo systemctl status vector</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ldl7qDxqRqsKmviUFb33tA.png" /></figure><h3>🔎 Verify Data</h3><h3>Archives</h3><pre>#verify the archives event count<br>SELECT count() FROM wazuh.archives;<br>#Raw JSON (important)<br>SELECT raw FROM wazuh.archives ORDER BY ts DESC LIMIT 1;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*amugGWqE_xPVmKPlabu81A.png" /><figcaption>Verifying the archives event count and raw logs</figcaption></figure><p>You want <strong>ClickHouse queries using a keyword search</strong>, especially <strong>containing a string / phrase</strong> (like quotes, substrings, etc).</p><h3>1️⃣ Search keyword inside full_log (most common)</h3><blockquote><strong>Example: find logs containing sudo</strong></blockquote><pre>SELECT<br>  ts,<br>  agent_name,<br>  rule_id,<br>  rule_level,<br>  full_log<br>FROM wazuh.alerts<br>WHERE full_log LIKE &#39;%sudo%&#39;<br>ORDER BY ts DESC<br>LIMIT 20;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gxy4bjGLgIlF_Q08vnHBng.png" /></figure><h3>2️⃣ Search keyword inside raw JSON (powerful)</h3><p>This is the <strong>most flexible</strong> because raw contains the full Wazuh event.</p><blockquote>Example: find logs containing pam_unix</blockquote><pre>SELECT<br>  ts,<br>  agent_name,<br>  raw<br>FROM wazuh.alerts<br>WHERE raw LIKE &#39;%pam_unix%&#39;<br>ORDER BY ts DESC<br>LIMIT 10;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I1Js-sE38nK_Ia5vJ2F6IA.png" /></figure><blockquote>✅ Works even if the field is <strong>not parsed</strong>.</blockquote><h3>3️⃣Regex search (VERY powerful)</h3><blockquote>Example: match sudo OR su OR pkexec</blockquote><pre>SELECT<br>  ts,<br>  agent_name,<br>  full_log<br>FROM wazuh.alerts<br>WHERE match(full_log, &#39;(sudo|su|pkexec)&#39;)<br>ORDER BY ts DESC<br>LIMIT 20;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5AKo8bkCQE5SlrNaU7y5qw.png" /></figure><h3>4️⃣Time-bounded keyword search</h3><pre>SELECT<br>  ts,<br>  agent_name,<br>  full_log<br>FROM wazuh.alerts<br>WHERE ts &gt;= now() - INTERVAL 1 DAY<br>  AND raw LIKE &#39;%authentication%&#39;<br>ORDER BY ts DESC<br>LIMIT 50;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z0WwNKf9IF88KPorbqqByA.png" /></figure><h4>Why this works well in your design</h4><p>Because you stored:</p><ul><li>✅ Parsed core fields</li><li>✅ <strong>Full raw JSON</strong></li></ul><p>You can:</p><ul><li>Search anything <strong>without re-parsing</strong></li><li>Add parsed fields later <strong>only if needed</strong></li><li>Build a <strong>SIEM-like UI</strong> easily</li></ul><h4><em>🚀 Visualize Your Data</em></h4><p>Now that your logs are in ClickHouse, you aren’t limited to the command line. You can connect Grafana directly to ClickHouse to build custom, high-performance SOC dashboards. This allows you to visualize alert trends, top failing agents, and MITRE ATT&amp;CK patterns without the heavy resource cost of OpenSearch Dashboards.</p><h3>🧠 Why This Config Is Best Practice</h3><ul><li>Long-term storage of Wazuh alerts.</li><li>Full Archives retention for forensics.</li><li>Fast SQL queries for threat hunting.</li><li>Raw JSON preserved for deep inspection.</li></ul><h3>Connect Me :)</h3><p>If you have any suggestions for improvement or need help regarding this topic, feel free to reach out to me on <a href="https://www.linkedin.com/in/mariskarthickm/">Mariskarthick M | LinkedIn</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=83094eba5667" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Strengthening Endpoint Security: A Deliberate Approach to Malware Execution and Detection]]></title>
            <link>https://medium.com/@mariskarthickm/strengthening-endpoint-security-a-deliberate-approach-to-malware-execution-and-detection-b9ebdd15ea9d?source=rss-82eafcc2a231------2</link>
            <guid isPermaLink="false">https://medium.com/p/b9ebdd15ea9d</guid>
            <category><![CDATA[detection-and-prevention]]></category>
            <category><![CDATA[soc-analyst]]></category>
            <category><![CDATA[endpoint-detection]]></category>
            <category><![CDATA[endpoint-security]]></category>
            <category><![CDATA[elastic-siem]]></category>
            <dc:creator><![CDATA[Mariskarthickm]]></dc:creator>
            <pubDate>Thu, 14 Mar 2024 14:17:22 GMT</pubDate>
            <atom:updated>2024-03-14T14:17:22.348Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*EYP2KEtjXDMrKGZn" /></figure><p>Hello All,</p><p>In this blog post, we explore a deliberate approach to cybersecurity by executing malware on endpoints, leveraging Elastic Security’s Endpoint Detection and Response (EDR) capabilities for comprehensive protection. By intentionally deploying malware within a controlled environment, security professionals can gain valuable insights into detection and response mechanisms, enhancing their ability to thwart real-world cyber threats effectively.</p><p><strong>Objective:</strong></p><ul><li>Installing Agent on Windows Machine, and confirming the logs are successfully forwarded to Elastic SIEM Solution.</li><li>EDR Solution and Windows logs should be integrated to windows agent.</li><li>Executing the BloodHound tool and confirming whether the EDR solution are able to detect/Prevent it.</li></ul><p><strong>About Blood Hound:</strong></p><blockquote>BloodHound is an open-source tool designed to uncover attack paths and connections within an Active Directory (AD) infrastructure.</blockquote><blockquote>Its inclusion in our top 10 threat rankings stems from its significant presence in both testing exercises and actual adversary operations.</blockquote><blockquote>BloodHound is favored by adversaries and security testers alike due to its ability to provide insights into AD environments, facilitating lateral movement within networks.</blockquote><p><strong>Techniques and Tactics</strong>:</p><p>• In MITRE Attack Framework, the Techniques &amp; Tactics of Bloodhound are highlighted below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-uV81ScVRrTzhjA0cuyQqQ.png" /></figure><p>In order to execute and detect the BloodHound Software. I have integrated Windows logs and EDR Solution in the Agent Policies.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ffl6OjAFyOA6_iWoZqhyPg.png" /></figure><p>I‘ve set up a Windows machine in VirtualBox and effectively directed its logs to the Elastic SIEM solution. Please refer to the snapshot below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-CMNJ5oMr2yizkJRu5JGAw.png" /></figure><p>Upon confirming the successful integration of logs, I ran the BloodHound software, which was detected by Elastic EDR. The Malware was not prevented since the policies configured only to detect.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ITIK7PPYBEKzSVxNZ4X0eQ.png" /></figure><p>While checking the Elastic SIEM solution, we have observed two critical Malware detection alerts has been detected.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IHrvDoH8H-OGShGf5LxqUw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J42xFBqSFxjinifFwjKCzg.png" /></figure><ul><li>During the timeline analysis, it was found that a malicious file named Sharp hound executable had been executed by the user “Maris,” which was successfully detected.</li><li>While checking the detected file hash in multiple threat intel, the threat verdict seems to be : “Highly Malicious”.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Kwv8ydN_JfLl1jV2rAAYfw.png" /></figure><p><strong>Conclusion:</strong></p><ul><li>Windows agent has been successful installed on the windows machine with the Integration of windows logs &amp; EDR Solutions.</li><li>We have successfully confirmed that logs have been forwarded to the Elastic Siem solutions.</li><li>Based on the MITRE framework, we have tried to execute the Bloodhound Software on the Windows Machine which has been successfully detected by Elastic Siem Solution Since the EDR Agent Policies set only to Detect and not to Prevent it.</li><li>While analysis, we could confirm that Elastic has been successfully detect that the user: “Maris” have executed the Malicious file, and the detected file hash seems to be Malicious.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b9ebdd15ea9d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>