<?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 Yash Patel on Medium]]></title>
        <description><![CDATA[Stories by Yash Patel on Medium]]></description>
        <link>https://medium.com/@yashpateld22d?source=rss-0ab7e254ae3d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*QrW5Jjr8FN4fEp_q</url>
            <title>Stories by Yash Patel on Medium</title>
            <link>https://medium.com/@yashpateld22d?source=rss-0ab7e254ae3d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 17:42:44 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@yashpateld22d/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[IndexSphere: One Console to Run Elasticsearch, OpenSearch and ClickHouse — and Know When They’re…]]></title>
            <link>https://yashpateld22d.medium.com/indexsphere-one-console-to-run-elasticsearch-opensearch-and-clickhouse-and-know-when-theyre-ad8e6e3167cb?source=rss-0ab7e254ae3d------2</link>
            <guid isPermaLink="false">https://medium.com/p/ad8e6e3167cb</guid>
            <category><![CDATA[elasticsearch]]></category>
            <category><![CDATA[opensearch]]></category>
            <category><![CDATA[troubleshooting]]></category>
            <category><![CDATA[one-console]]></category>
            <category><![CDATA[clickhouse]]></category>
            <dc:creator><![CDATA[Yash Patel]]></dc:creator>
            <pubDate>Sun, 11 Oct 2026 08:36:01 GMT</pubDate>
            <atom:updated>2026-10-11T08:36:01.611Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>IndexSphere: One Console to Run Elasticsearch, OpenSearch and ClickHouse — and Know When They’re Misconfigured</strong></h3><p>A self-hosted, open-source operations console that monitors your search clusters and analytical databases, grades their configuration against vendor best practices, finds the CVEs in the exact versions you run, and tells you how to fix every problem it finds.</p><p>Yash · 12 min read · <a href="https://github.com/yash22091/indexsphere">github.com/yash22091/indexsphere</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/945/1*Td99752fgl7v9IWu-UqOtA.png" /><figcaption><em>The Best practices review: every server graded against the vendor’s production recommendations.</em></figcaption></figure><h3>The 3 a.m. problem</h3><p>If you run Elasticsearch or OpenSearch next to ClickHouse — a very common pairing for logs, security analytics and product analytics — you probably know the routine. Kibana or OpenSearch Dashboards for one engine, curl against _cat APIs for the details Dashboards doesn’t show, clickhouse-client and a folder of saved system.* queries for the other, a spreadsheet of versions to check against CVE feeds, and tribal knowledge about which settings matter.</p><p>Most outages I have seen in these stacks were not exotic bugs. They were configuration that drifted away from the documented recommendations: a heap above 31 GB, swap left on, a disk past its watermark, a ClickHouse table receiving thousands of tiny inserts until it hit <strong>TOO_MANY_PARTS</strong>, system log tables with no TTL quietly filling a disk, or a version that stopped receiving security fixes months ago.</p><blockquote><strong><em>Every one of those problems was visible in advance. Nobody was looking in the right place.</em></strong></blockquote><p>IndexSphere is my answer to that: <strong>one console for Elasticsearch, OpenSearch and ClickHouse</strong> that shows you what is happening, tells you whether the setup follows best practice, and gives you the exact command to fix what doesn’t.</p><h3>What is IndexSphere?</h3><p>IndexSphere is a web application you deploy next to your clusters. You add your servers as saved connections, and every user gets a personal, server-side session to each engine. Nothing is installed on the clusters themselves — IndexSphere talks to the standard HTTP APIs (port 9200 for Elasticsearch/OpenSearch, 8123/8443 for ClickHouse).</p><h3>At a glance</h3><p>· <strong>Three engines, one UI</strong> — Elasticsearch, OpenSearch and ClickHouse side by side (tested on Elasticsearch 8.19 and 9.x, OpenSearch 3.x and ClickHouse 25.x), with every page tagged ES or CH.</p><p>· <strong>Monitoring</strong> — overviews, live metrics, nodes, indices, shards, merges, replication, ingestion, server logs.</p><p>· <strong>Advisors</strong> — an Index advisor, a ClickHouse Table advisor, and a cross-engine <strong>Best practices</strong> review with a grade, the current value, the recommended value and the fix for every check.</p><p>· <strong>Security</strong> — a posture audit, CVE lookups for the exact versions you run (NVD, OSV, CISA KEV, EPSS), configuration drift history and a full audit trail.</p><p>· <strong>Safe operations</strong> — reindex, bulk operations, delete-by-query with dry run, partition management, mutation and query kill — all role-gated and audited.</p><p>· <strong>Elasticsearch → ClickHouse migration</strong> — turns an index mapping into a ClickHouse table that follows ClickHouse’s own best-practice rules, then copies the data.</p><p>· <strong>Self-hosted and MIT-licensed</strong> — one application container (optionally behind NGINX for HTTPS) with a small SQLite database. It only talks to your clusters and, if you enable them, vulnerability feeds, SMTP and your AI provider.</p><p>Under the hood it is a Next.js application with a server-side API layer. Cluster credentials are encrypted at rest (AES-256-GCM) and never reach the browser; every request to a cluster goes through an SSRF guard, a timeout and a response-size cap; and a background scheduler handles alert evaluation, scheduled reports, vulnerability feed refreshes and nightly configuration snapshots.</p><h3>A tour of the console</h3><h3>Sign in and find your way around</h3><p>Sign-in uses IndexSphere’s own accounts with three roles — <strong>Admin</strong>, <strong>Operator</strong> and <strong>Read-only</strong> — plus lockout after repeated failures and an optional strong-password policy. The first sign-in forces a password change.</p><p>The sidebar is organised by engine: an <strong>Elasticsearch / OpenSearch</strong> section, a <strong>ClickHouse</strong> section, a <strong>Cross-engine</strong> section for features that work with both, and <strong>Administration</strong>. The dot next to each engine shows whether you are connected, and cross-engine pages carry small ES / CH tags so you always know what a page covers. Press ⌘K / Ctrl+K anywhere to jump to any page.</p><h3>Elasticsearch and OpenSearch</h3><p>The <strong>Overview</strong> answers “is the cluster OK?” in one screen: status, shards, nodes, quick resilience checks, a vulnerability banner for the running version and the best-practice grade with the top issues.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/945/1*EmxFdrPcP0CsTMTYrxqh3w.png" /><figcaption><em>Overview of an Elasticsearch 9 cluster, including the best-practice summary.</em></figcaption></figure><p><strong>Cluster health</strong> goes deeper — per-node heap, CPU and disk with automatically detected issues and recommendations — and <strong>Live monitoring</strong> streams metrics every five seconds with warning and critical thresholds that alert rules use.</p><p><strong>Nodes</strong>, <strong>Indices</strong> and <strong>Shards</strong> give you the inventory, and Shards explains *why* a shard is unassigned using the allocation-explain API — the single most useful thing when a cluster turns yellow.</p><p>The <strong>Index advisor</strong> grades every index from A to F — shard sizing, replicas, deleted documents, mapping size — and every finding includes the command that fixes it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/945/1*C-5ikZv4u6dYVJjfGROL_g.png" /><figcaption><em>Index advisor: graded indices with the fix for each finding.</em></figcaption></figure><p>For querying there is a <strong>Query workbench</strong> with profile trees, score explanations, history and saved queries, plus an optional <strong>AI query</strong> builder that turns plain language into query DSL. Before anything is sent to the AI provider, e-mails, IPs, tokens and keys are stripped from the prompt, and the API key stays in the user’s browser.</p><p><strong>Search analytics</strong> shows real query and indexing rates and latency, and <strong>Config &amp; policies</strong> lists aliases, index and component templates, ILM/ISM policies, snapshot repositories and cluster settings.</p><h3>Data operations — with guard rails</h3><p>Changing data is where consoles get dangerous, so every operation here is role-checked, previewed and audited. The <strong>Reindex</strong> wizard walks through source, destination, filter and confirmation with live task progress; <strong>Bulk operations</strong> require typing delete for deletions; <strong>Delete by query</strong> shows the match count and sample documents first and keeps the delete button disabled while dry run is on.</p><p><strong>Reports</strong> produce a PDF or JSON snapshot of a cluster on demand, and <strong>Scheduled reports</strong> e-mail CSV or JSON reports on a cron schedule.</p><h3>ClickHouse</h3><p>ClickHouse is phenomenal at what it does, but day-to-day operations mean querying a long list of system.* tables. IndexSphere turns those into pages.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/945/1*bQ48ECOUytgMtvfoTYS6bg.png" /><figcaption><em>ClickHouse overview: storage, compression, activity, memory, disks and live charts.</em></figcaption></figure><p>The <strong>Explorer</strong> browses databases, tables and columns with sort-key and partition-key flags, codecs, the CREATE TABLE statement, partitions, skip indices and sample rows. <strong>Query activity</strong> lists running, slowest and failed queries and the heaviest query patterns from system.query_log, each with “Open in SQL”.</p><p>The <strong>SQL workbench</strong> applies safety limits to every query — execution time, result rows and a scan cap — and read-only users run with ClickHouse’s own readonly=2, so the server itself refuses writes. Table functions that reach outside the server (url(), s3(), file(), remote()…) are admin-only. EXPLAIN (indexes) and EXPLAIN ESTIMATE are one click away.</p><p>The <strong>Table advisor</strong> grades every table against the rules of the official ClickHouse best-practices skill: sort-key cardinality order, partition key, Nullable overuse, native types, LowCardinality, integer bit-widths, mutations and more. Each finding names its rule and includes a suggested fix in SQL.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/945/1*72XKMKntiqp57YLCnstJ-Q.png" /><figcaption><em>Every finding cites the ClickHouse best-practice rule it is based on.</em></figcaption></figure><h3>Operations pages</h3><p>These are the pages I wished I had every time a ClickHouse server misbehaved:</p><p>· <strong>Merges &amp; mutations</strong> — running merges with progress, pending and failing mutations (admins can kill them), and the partitions closest to the “too many parts” insert limits.</p><p>· <strong>Storage</strong> — disks, storage policies, TTL per table, detached parts, recently dropped tables (with the UNDROP statement) and dictionaries. Partitions can be merged with OPTIMIZE … FINAL or dropped after typing the partition ID.</p><p>· <strong>Ingestion</strong> — inserts per table, detection of too-small inserts, async-insert buffers, failed INSERTs, materialized views (source → target) and Kafka consumers.</p><p>· <strong>Replication &amp; cluster</strong> — replica lag and queue, cluster topology, ClickHouse Keeper, ON CLUSTER DDL and Distributed send queues.</p><p>· <strong>Server &amp; logs</strong> — ClickHouse’s own warnings, a searchable server log, errors by type, crashes, settings changed from defaults, every metric, and backup history.</p><p>· <strong>Users &amp; access</strong> — users, grants, roles, quotas, settings profiles, row policies and failed logins.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/945/1*HuYFDER4j9tLUNgKIHQrFQ.png" /><figcaption><em>Merges &amp; mutations: parts per partition against the insert limits.</em></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/945/1*oQ-T8qR3Wn7R9XHrvYLFuA.png" /><figcaption><em>Storage → Partitions: optimize or drop a partition, with typed confirmation.</em></figcaption></figure><h3>Cross-engine: the part no other tool does</h3><h3>Best practices</h3><p>This is the feature I am most proud of. <strong>Best practices</strong> reviews each server against the vendor’s production recommendations and grades it A to F. Instead of a vague score, every check shows three things: the <strong>current value</strong>, the <strong>recommended value</strong>, and — when they differ — why it matters and a copyable fix.</p><p>· <strong>Elasticsearch / OpenSearch (24 checks, 25 on Elasticsearch)</strong> — Release support and mixed versions · cluster status and pending tasks · master quorum and dedicated masters · heap ≤ 31 GB, ≤ 50% of RAM, Xms = Xmx, heap pressure · swap / memory lock and file descriptors · disk watermarks, allocation, disk usage, read-only blocks · shard size, over-sharding, shard limit · replicas · ILM/ISM coverage · snapshots and destructive-action protection · rejections and circuit breakers · deprecations</p><p>· <strong>ClickHouse (27 checks)</strong> — Release support (LTS vs stable) · server memory limit, per-query memory limit, cache sizes, GROUP BY spilling · concurrency and merge pool · DROP guards and backups · parts per partition, too-many-parts thresholds, partition count, stuck mutations, broken detached parts · insert batching · schema grades from Table advisor · disk space and compression · replication · query log, part log, TTL on system logs · time limits and time zone · ClickHouse’s own system.warnings</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/945/1*cxMmS-_lWN0qGScCvO657w.png" /><figcaption><em>A ClickHouse review with “Show issues only”: grade, scorecard and expanded fix.</em></figcaption></figure><blockquote><strong><em>A check that cannot be evaluated is reported as “skipped” — never silently passed.</em></strong></blockquote><p>When I ran it against a real ClickHouse server it graded the server C and found eight issues in under two seconds: caches configured for 168% of RAM, a 9.3 GiB trace_log (plus a 1.2 GiB scheduler log) with no TTL, 248 broken detached parts, no recorded backups, a release out of its support window, no per-query memory limit, no query time limit, and one of ClickHouse’s own server warnings — plus an informational note that nothing was replicated. The grade and the top three issues also appear on both overview pages.</p><h3>Security posture and vulnerabilities</h3><p><strong>Security posture</strong> is a read-only audit — authentication, TLS (including detection of public demo certificates), privileges, logging and backups. It never guesses passwords. <strong>Vulnerabilities</strong> matches the exact versions you run against NVD and OSV, flags anything in CISA’s Known Exploited Vulnerabilities catalogue, adds EPSS exploit probability, and tells you the smallest safe upgrade. You can also check a version before you upgrade to it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/945/1*sL2Q-0Izmo5IgkX8Iu8Afg.png" /><figcaption><em>Security posture for ClickHouse: findings ordered by severity.</em></figcaption></figure><h3>Configuration drift and cluster compare</h3><p><strong>Configuration drift</strong> snapshots templates, policies, settings, users and grants (automatically every night, or on demand) and shows exactly what changed between snapshots. <strong>Cluster compare</strong> diffs two servers side by side — indices, templates and settings for Elasticsearch/OpenSearch; table schemas, dictionaries, settings, table sizes and access control for ClickHouse. It is the fastest way to answer “why does staging behave differently from production?”.</p><h3>Alerts</h3><p>Alert rules compare a metric with a threshold and notify by e-mail, Slack or webhook with a cooldown. Search-cluster metrics (CPU, heap, GC pressure, unassigned shards, indexing rate) and ClickHouse metrics (memory, parts per partition, replica delay, failed queries, pending and failed mutations, read-only replicas, disk usage) are both supported.</p><h3>Elasticsearch → ClickHouse migration</h3><p>Moving log or event data from Elasticsearch to ClickHouse is common — and getting the table design right is the hard part. IndexSphere reads the index mapping, measures real field cardinality, and proposes a table that follows ClickHouse’s rules: native types, LowCardinality where it pays off, no Nullable, an ORDER BY chosen from measured cardinality and a monthly partition key. Every column decision cites its rule. One click creates the table; another streams the data in 10K–100K-row batches, verifies row counts and compares storage.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/945/1*k_4deFEBxHGG4EpSxH-IGw.png" /><figcaption><em>From an index mapping to a ClickHouse table — with the reasoning for every column.</em></figcaption></figure><h3>Administration</h3><p><strong>Connections</strong> holds saved servers with encrypted passwords and per-role access. <strong>Users</strong> manages accounts and roles, <strong>Authentication</strong> sets session length, lockout and password policy, <strong>Settings</strong> holds SMTP, and the <strong>Audit trail</strong> records every cluster operation — who, what, when and the result — exportable to CSV.</p><p>There is also a dark theme, and the layout works on a phone — handy when the page you are looking at is an incident.</p><p>• • •</p><h3>How to install it</h3><p>You need Docker 20.10+ with Compose v2 (or Node.js 20+ for a source install), about 1 GB of memory for the container, and network access from IndexSphere to your clusters. Users only need to reach IndexSphere itself.</p><p>· <strong>Elasticsearch / OpenSearch</strong> — 9200 — Cluster management</p><p>· <strong>ClickHouse</strong> — 8123 (HTTP) or 8443 (HTTPS) — ClickHouse management</p><p>· <strong>NVD, OSV, CISA, FIRST</strong> — 443 — Vulnerability lookups (optional; can be disabled for air-gapped sites)</p><p>· <strong>SMTP server</strong> — 25 / 465 / 587 — Alert and report e-mails (optional)</p><p>· <strong>AI provider</strong> — 443 / 11434 — AI query builder (optional)</p><h3>Option A — Docker with HTTPS (recommended)</h3><pre>git clone https://github.com/yash22091/indexsphere.git indexsphere &amp;&amp; cd indexsphere<br><br># A strong secret signs sessions and encrypts saved connection passwords<br>echo &quot;JWT_SECRET=$(openssl rand -hex 32)&quot; &gt; .env<br><br># Starts IndexSphere behind NGINX with TLS (a self-signed certificate is generated on first run)<br>docker compose -f docker-compose.nginx.yml --env-file .env up -d<br></pre><p>Open https://&lt;your-server&gt;. To use your own certificate, put fullchain.pem and privkey.pem in certs/ before starting.</p><h3>Option B — Docker over plain HTTP (internal networks)</h3><pre>echo &quot;JWT_SECRET=$(openssl rand -hex 32)&quot; &gt; .env<br>echo &quot;COOKIE_SECURE=false&quot; &gt;&gt; .env     # only for HTTP; browsers drop Secure cookies on http://<br>docker compose -f docker-compose.production.yml --env-file .env up -d<br># open http://&lt;your-server&gt;:3000</pre><h3>Option D — from source</h3><pre>sudo apt-get install -y build-essential python3     # native modules<br>git clone https://github.com/yash22091/indexsphere.git indexsphere &amp;&amp; cd indexsphere<br>npm ci &amp;&amp; npm run build<br>export JWT_SECRET=&quot;$(openssl rand -hex 32)&quot; NODE_ENV=production<br>npm start                                           # listens on :3000</pre><h3>First sign-in</h3><p>1. Open IndexSphere and sign in as admin / admin.</p><p>2. Choose a new password — the change is mandatory.</p><p>3. Check that the service is healthy: curl -s https://&lt;your-server&gt;/api/health returns {“status”:”healthy”}.</p><h3>How to configure it</h3><p>Configuration is a handful of environment variables; everything else (SMTP, sign-in policy, AI defaults) is edited in the UI. The essentials:</p><p>· JWT_SECRET — (required) — 32+ characters. Signs sessions and encrypts saved connection passwords. Changing it signs everyone out.</p><p>· COOKIE_SECURE — true — Set false only when serving over plain HTTP on an internal network.</p><p>· CLUSTER_HOST_ALLOWLIST — Restrict which hosts connections may target, e.g. *.search.corp,clickhouse.corp.</p><p>· NVD_API_KEY — Optional; raises NVD rate limits for vulnerability lookups.</p><p>· VULN_INTEL_DISABLED — false — true for air-gapped installs.</p><p>· SMTP_HOST / SMTP_PORT / SMTP_USER / SMTP_PASS / SMTP_FROM — E-mail for alerts and scheduled reports (can also be set in the UI).</p><p>· AI_BASE_URL / AI_MODEL — Default OpenAI-compatible endpoint for the AI query builder.</p><h3>Connect your servers</h3><p>1. Go to <strong>Administration → Connections → Add connection</strong>.</p><p>2. Pick the engine — Elasticsearch, OpenSearch or ClickHouse — and enter the URL, user and password.</p><p>3. Keep <strong>Verify TLS certificate</strong> on for CA-signed certificates; turn it off only for self-signed ones.</p><p>4. Choose which IndexSphere roles may use the connection, then <strong>Test</strong> and <strong>Connect</strong>.</p><p><em>Give IndexSphere a dedicated monitoring account with only the privileges it needs — and let the server enforce limits too.</em></p><p>For Elasticsearch/OpenSearch a monitor / view_index_metadata style role is enough for everything read-only; add write privileges only if operators should run reindex or bulk operations. For ClickHouse, create a dedicated user with a settings profile that limits execution time and memory — the Best practices page will tell you if you forget.</p><p>Three roles keep it safe to hand out: <strong>Admin</strong> (everything), <strong>Operator</strong> (day-to-day changes such as reindex, bulk operations and OPTIMIZE) and <strong>Read-only</strong> (look, don’t touch — enforced by ClickHouse itself with readonly=2).</p><h3>How to use it: five everyday workflows</h3><h3>1. The five-minute morning check</h3><p>Open the <strong>Overview</strong> for each engine. Green status, no vulnerability banner, and a Best-practices grade of A or B means you can get a coffee. Anything else links straight to the page that explains it.</p><h3>2. “Why is the cluster yellow?”</h3><p><strong>Overview</strong> shows the count of unassigned shards → <strong>Shards</strong> shows each one with the allocation explanation (disk watermark, allocation filter, missing node…) → fix the cause → <strong>Retry failed allocations</strong>.</p><h3>3. “Is this ClickHouse server production-ready?”</h3><p>Open <strong>Best practices → ClickHouse</strong>, switch on <strong>Show issues only</strong>, and work from the top. Each issue has the exact setting, statement or config snippet to apply. Re-run the review until the grade is A or B, then add the Table advisor findings for the schemas.</p><h3>4. “Inserts are failing with TOO_MANY_PARTS”</h3><p><strong>Merges &amp; mutations → Parts pressure</strong> shows which partition is near the limit. <strong>Ingestion</strong> shows which table receives small, frequent inserts. The fix is almost always batching (10K–100K rows per INSERT) or async_insert = 1.</p><h3>5. Plan an upgrade safely</h3><p>Take a <strong>drift snapshot</strong>, use <strong>Vulnerabilities → Check a version</strong> to confirm the target version is clean, review <strong>Best practices → Deprecations</strong> on Elasticsearch, upgrade, then take another snapshot and let drift show what changed.</p><h3>How it helps</h3><p>· <strong>An SRE or platform engineer</strong> — One place to see the health of every search cluster and ClickHouse server, alerts on both, and a graded checklist of what to fix before it pages you.</p><p>· <strong>A security / SOC team running a SIEM on Elasticsearch, OpenSearch or ClickHouse</strong> — Posture audits, CVEs for the exact versions you run (with KEV and EPSS), configuration drift and a complete audit trail of who changed what.</p><p>· <strong>A data engineer moving logs to ClickHouse</strong> — An Elasticsearch → ClickHouse migration that designs the table correctly, plus ingestion and table-design advisors for what comes after.</p><p>· <strong>A team lead or auditor</strong> — Evidence: downloadable best-practice and posture reviews, drift history and an exportable audit log.</p><p>· <strong>A smaller team without a dedicated DBA</strong> — The knowledge of the vendor documentation turned into checks with fixes — explained in plain language.</p><h3>What makes it different</h3><p>· <strong>Multi-engine by design</strong> — Elasticsearch, OpenSearch and ClickHouse in one console, with the same grading model across all three.</p><p>· <strong>Explains instead of just showing</strong> — every advisor finding comes with the reason, the documented rule and the fix.</p><p>· <strong>Best practices as a product feature</strong> — current value vs recommended value for 50+ checks, not a static PDF checklist.</p><p>· <strong>Security built in</strong> — CVE intelligence with KEV and EPSS, posture audits that never guess passwords, drift history and audit trail.</p><p>· <strong>Safe by default</strong> — read-only reviews, dry runs, typed confirmations, server-enforced read-only for ClickHouse, SSRF protection, encrypted credentials.</p><p>· <strong>Yours to run</strong> — self-hosted, MIT-licensed, one application container; your data and credentials stay on your network.</p><h3>Security by design</h3><p>Sessions are per user and held on the server; cluster passwords are encrypted at rest and never reach the browser. Roles are enforced on every API route, ClickHouse read-only users run with readonly=2, every outbound request is SSRF-checked with DNS re-validation, cluster traffic has timeouts and size caps, sign-ins lock out after repeated failures, and AI prompts are redacted before they leave the server.</p><h3>Get started</h3><p>The code, Docker files and full documentation are on GitHub: <a href="https://github.com/yash22091/indexsphere"><strong>github.com/yash22091/indexsphere</strong></a></p><p>· <a href="https://github.com/yash22091/indexsphere/tree/main/docs/01-installation.md">Installation guide</a> — every deployment option, upgrades and uninstalling.</p><p>· <a href="https://github.com/yash22091/indexsphere/tree/main/docs/02-configuration.md">Configuration</a> — all environment variables with defaults.</p><p>· <a href="https://github.com/yash22091/indexsphere/tree/main/docs/03-user-guide.md">User guide</a> — every page and the common workflows.</p><p>· <a href="https://github.com/yash22091/indexsphere/tree/main/docs/04-clickhouse.md">ClickHouse guide</a> — pages, SQL safety, advisor rules and migration.</p><p>· <a href="https://github.com/yash22091/indexsphere/tree/main/docs/06-security.md">Security</a> and <a href="https://github.com/yash22091/indexsphere/tree/main/docs/08-troubleshooting.md">Troubleshooting</a>.</p><p>If you run Elasticsearch, OpenSearch or ClickHouse, deploy it next to a staging cluster, open <strong>Best practices</strong>, and see what it finds. I would love to hear what it catches for you — issues and pull requests are welcome.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ad8e6e3167cb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Query Historical Data Directly From Amazon S3 Without Rehydration]]></title>
            <link>https://yashpateld22d.medium.com/query-historical-data-directly-from-amazon-s3-without-rehydration-59957ab09135?source=rss-0ab7e254ae3d------2</link>
            <guid isPermaLink="false">https://medium.com/p/59957ab09135</guid>
            <category><![CDATA[aws-s3]]></category>
            <category><![CDATA[opensearch]]></category>
            <category><![CDATA[query-s3-data]]></category>
            <dc:creator><![CDATA[Yash Patel]]></dc:creator>
            <pubDate>Tue, 02 Jun 2026 14:45:37 GMT</pubDate>
            <atom:updated>2026-06-02T15:00:00.247Z</atom:updated>
            <content:encoded><![CDATA[<h3>Building a Production-Ready Rust Query Engine for Archived Security Investigations</h3><h3>Introduction</h3><p>Most organizations have solved log retention.</p><p>Very few have solved historical investigations.</p><p>Security teams routinely archive:</p><ul><li>Wazuh alerts</li><li>CloudTrail logs</li><li>Firewall telemetry</li><li>VPN logs</li><li>Kubernetes audit events</li><li>EDR telemetry</li><li>Authentication logs</li><li>Application logs</li></ul><p>to Amazon S3 after hot retention expires.</p><p>Months later, when a compliance request, incident response activity, threat hunt, or audit requires access to those logs, teams often discover that archived data is difficult to investigate efficiently.</p><p>Traditional approaches usually involve:</p><ul><li>Restoring OpenSearch snapshots</li><li>Rehydrating old indices</li><li>Provisioning temporary clusters</li><li>Writing ad-hoc scripts</li><li>Running Athena queries</li><li>Granting direct S3 access</li></ul><p>These workflows increase cost, complexity, and investigation time.</p><p>Live Query Engine was built specifically to solve this problem.</p><h3>The Problem</h3><p>Historical retention and historical investigation are completely different problems.</p><p>Storage is cheap.</p><p>Search is expensive.</p><p>Most organizations only need to investigate a small percentage of retained data, yet they maintain costly workflows just to access archived logs.</p><p>Typical investigation workflow:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9GiGq51U6ilaRR3xHvyKdQ.png" /></figure><ol><li>Restore snapshot</li><li>Provision infrastructure</li><li>Wait for recovery</li><li>Run investigation</li><li>Export evidence</li><li>Remove infrastructure</li></ol><p>Live Query Engine removes most of that operational overhead.</p><h3>What Is Live Query Engine?</h3><p>Live Query Engine is a Rust-based investigation platform that provides:</p><ul><li>Browser UI</li><li>REST APIs</li><li>SQL Query Interface</li><li>Fast Search</li><li>CSV Export</li><li>Schema Discovery</li><li>OpenSearch Snapshot Investigation</li></ul><p>Supported formats:</p><ul><li>JSON</li><li>JSON.gz</li><li>CSV</li><li>Parquet</li></ul><p>The platform is intentionally not:</p><ul><li>SIEM</li><li>XDR</li><li>Detection Platform</li><li>SOAR</li><li>Case Management System</li></ul><p>Instead it acts as:</p><p>“A lightweight forensic query layer for archived security data.”</p><h3>Architecture Overview</h3><p>The architecture separates:</p><ol><li>Direct S3 File Querying</li><li>OpenSearch Snapshot Investigation</li></ol><pre>                           +----------------------+<br>                           | Browser UI / API     |<br>                           | SQL, Search, Export  |<br>                           +----------+-----------+<br>                                      |<br>                                      v<br>                           +----------------------+<br>                           | Live Query Engine    |<br>                           | Rust HTTP Service    |<br>                           +----------+-----------+<br>                                      |<br>                +---------------------+---------------------+<br>                |                                           |<br>                v                                           v<br><br>    +----------------------+              +------------------------+<br>    | S3 File SQL Backend  |              | Snapshot Backend       |<br>    | Apache DataFusion    |              | OpenSearch APIs        |<br>    | object_store S3      |              | Searchable Snapshots   |<br>    +----------+-----------+              +-----------+------------+<br>               |                                      |<br>               v                                      v<br><br>    +----------------------+              +------------------------+<br>    | S3 Retained Logs     |              | Cold Query OpenSearch  |<br>    | JSON                |              | repository-s3 Plugin   |<br>    | JSON.gz             |              +-----------+------------+<br>    | CSV                 |                          |<br>    | Parquet             |                          |<br>    +----------------------+                          v<br><br>                                         +------------------------+<br>                                         | S3 Snapshot Repository |<br>                                         | OpenSearch Segments    |<br>                                         +------------------------+</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CFyLUnhoGBDnuTeW_f9MgA.png" /></figure><p>Core technologies:</p><ul><li>Rust</li><li>Apache Arrow</li><li>Apache DataFusion</li><li>object_store S3 backend</li><li>Async execution</li><li>Streaming query engine</li></ul><p>Major components:</p><ul><li>Browser UI</li><li>Query APIs</li><li>Schema Engine</li><li>DataFusion Query Layer</li><li>S3 Backend</li><li>Snapshot Orchestration Layer</li></ul><h3>Runtime Components</h3><h3>HTTP Layer</h3><p>Provides:</p><ul><li>Browser access</li><li>Query APIs</li><li>Authentication</li><li>CSV export</li><li>Snapshot operations</li></ul><h3>S3 Query Layer</h3><p>Responsible for:</p><ul><li>Prefix discovery</li><li>Schema inference</li><li>Hive partition detection</li><li>Schema merging</li></ul><h3>DataFusion Layer</h3><p>Responsible for:</p><ul><li>SQL parsing</li><li>Query planning</li><li>Partition pruning</li><li>Streaming execution</li></ul><h3>Snapshot Layer</h3><p>Responsible for:</p><ul><li>Snapshot listing</li><li>Repository registration</li><li>Searchable snapshot mounting</li><li>Historical investigations</li></ul><h3>Production Deployment Model</h3><p>Supported deployments:</p><ul><li>EC2</li><li>ECS</li><li>EKS</li><li>Bare Metal</li><li>Linux systemd</li></ul><p>The platform ships as:</p><ul><li>Prebuilt binary</li><li>Installation script</li><li>TOML configuration</li><li>Systemd service</li></ul><p>No production Rust toolchain is required.</p><h3>How To Get Live Query Engine</h3><h3>Source Code</h3><p>Project repository:</p><p><a href="https://github.com/yash22091/live-query-engine">https://github.com/yash22091/live-query-engine</a></p><p><strong>Clone the repository:</strong></p><pre>git clone https://github.com/yash22091/live-query-engine.git<br><br>cd live-query-engine</pre><h3>Option 1: Prebuilt Binary</h3><p>Verify package:</p><pre>wget -O live-query-engine-v0.1.0-linux-x86_64.zip https://raw.githubusercontent.com/yash22091/live-query-engine/main/dist/live-query-engine-v0.1.0-linux-x86_64.zip<br><br>wget -O live-query-engine-v0.1.0-linux-x86_64.zip.sha256 https://raw.githubusercontent.com/yash22091/live-query-engine/main/dist/live-query-engine-v0.1.0-linux-x86_64.zip.sha256<br><br>sha256sum -c live-query-engine-v0.1.0-linux-x86_64.zip.sha256</pre><p>Extract:</p><pre>unzip live-query-engine.zip</pre><p>Install:</p><pre>sudo SETUP_ENV_FILE=/root/live-query-engine/live-query-engine.setup.env \<br>scripts/setup-live-query-engine.sh</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dnrOD07j53JGzybklzPZiA.png" /><figcaption>Login Screen</figcaption></figure><h3>Option 2: Build From Source</h3><h3>Prerequisites for Building From Source</h3><p>If you want to build Live Query Engine from source, Rust must be installed on the build machine.</p><p>Supported platforms:</p><ul><li>Ubuntu 22.04+</li><li>Ubuntu 24.04+</li><li>RHEL 8+</li><li>Rocky Linux 8+</li><li>Amazon Linux 2023</li><li>Debian 12+</li></ul><h3>Install Build Dependencies</h3><h4>Ubuntu / Debian</h4><pre>sudo apt update<br><br>sudo apt install -y build-essential pkg-config curl git ca-certificates openssl libssl-dev</pre><p><strong>RHEL / Rocky Linux</strong></p><pre>sudo dnf install -y gcc gcc-c++ make pkg-config git curl openssl-devel</pre><h3>Install Rust Toolchain</h3><p>Install Rust using rustup:</p><pre>curl --proto &#39;=https&#39; --tlsv1.2 -sSf https://sh.rustup.rs | sh<br><br>source $HOME/.cargo/env<br><br>rustc --version<br><br>cargo --version</pre><p><strong>Clone Repository:</strong></p><pre>git clone https://github.com/yash22091/live-query-engine.git<br><br>cd live-query-engine<br><br>cargo build --release</pre><p><strong>Build output:</strong></p><pre>target/release/live-query-engine<br><br>ls -lh target/release/live-query-engine</pre><p><strong>Install:</strong></p><pre>sudo SETUP_ENV_FILE=/root/live-query-engine/live-query-engine.setup.env \<br>scripts/setup-live-query-engine.sh</pre><h3>Option 3: Local Run</h3><pre>LIVE_QUERY_CONFIG=config/live-query-engine.toml ./target/release/live-query-engine</pre><h3>Configuration</h3><p>Example:</p><pre>[s3]<br>bucket = &quot;file-log-bucket&quot;<br>region = &quot;us-east-1&quot;<br>prefix = &quot;&quot;</pre><pre>[aws]<br>credential_mode = &quot;default_chain&quot;</pre><p>Configuration files:</p><pre>/etc/live-query-engine.toml<br><br>/etc/live-query-engine.env</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VrIYuq-KUKqXJHa_fhJwPw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i9U6BLu4EfZg0cm3qRPifQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uYwKGVgEZPbcMBAHMZnB5A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-pM43O3tZMDVjn05bqF-Ow.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QhBEXZZxmNoq5ikx1f27DA.png" /></figure><h3>Prerequisites</h3><p>Minimum requirements:</p><ul><li>Linux Server</li><li>AWS IAM Access</li><li>S3 Bucket</li><li>Network Connectivity</li><li>systemd Compatible OS</li></ul><p>Optional:</p><ul><li>OpenSearch</li><li>Wazuh Indexer</li><li>repository-s3 plugin</li></ul><h3>Recommended Server Requirements</h3><p>Baseline:</p><pre>+-----------+------------------------+<br>| Component | Recommendation         |<br>+-----------+------------------------+<br>| CPU       | 4 vCPU                 |<br>| Memory    | 8 GB                   |<br>| Storage   | SSD Preferred          |<br>| OS        | Ubuntu / RHEL          |<br>+-----------+------------------------+</pre><p>Heavy Snapshot Usage:</p><pre>+--------------+------------------------+<br>| Component    | Recommendation         |<br>+--------------+------------------------+<br>| CPU          | 8+ vCPU                |<br>| Memory       | 16 - 32 GB             |<br>| SSD Storage  | Recommended            |<br>+--------------+------------------------+</pre><h3>Recommended S3 Layout</h3><pre>retention/wazuh-alerts/year=2026/month=05/date=08/file.json.gz</pre><pre>retention/wazuh-archives/year=2026/month=05/date=08/file.json.gz</pre><pre>retention/opensearch-export/year=2026/month=05/date=08/file.parquet</pre><p>Recommended partition columns:</p><ul><li>source</li><li>year</li><li>month</li><li>date</li></ul><h3>Query Flow</h3><pre>User<br> -&gt; Browser<br> -&gt; Query API<br> -&gt; SQL Validation<br> -&gt; DataFusion<br> -&gt; S3 Reads<br> -&gt; Result Stream<br> -&gt; Browser</pre><h3>Query Examples</h3><pre>SELECT source,time,severity,message<br>FROM logs<br>WHERE source=&#39;wazuh-alerts&#39;<br>AND year=&#39;2026&#39;<br>AND month=&#39;05&#39;<br>AND date=&#39;08&#39;<br>LIMIT 100;</pre><p>Always use partition filters.</p><p>Avoid broad scans.</p><h3>Fast Search</h3><p>Fast Search supports:</p><ul><li>IOC hunting</li><li>Keyword investigation</li><li>Rapid triage</li></ul><p>Guardrails include:</p><ul><li>Timeouts</li><li>Row limits</li><li>File limits</li><li>Concurrency controls</li></ul><h3>OpenSearch Snapshot Investigation</h3><p>Snapshots require OpenSearch.</p><p>Workflow:</p><ol><li>Register repository</li><li>List snapshots</li><li>Mount searchable snapshot</li><li>Search mounted index</li><li>Export evidence</li><li>Cleanup</li></ol><p>[SNAPSHOT-5]<br>Snapshot investigation workflow</p><p>This avoids restoring large historical clusters.</p><h3>Security Controls</h3><p>The platform enforces:</p><ul><li>Read-only SQL</li><li>Query limits</li><li>Authentication</li><li>Audit logging</li><li>Export controls</li><li>Snapshot restrictions</li></ul><p>This is particularly important for:</p><ul><li>MSSPs</li><li>Compliance teams</li><li>Multi-tenant environments</li></ul><h3>Service Operations</h3><p>Check status:</p><pre>systemctl status live-query-engine</pre><p>Logs:</p><pre>journalctl -u live-query-engine -f</pre><p>Restart:</p><pre>systemctl restart live-query-engine</pre><h3>Uninstall</h3><pre>sudo scripts/uninstall-live-query-engine.sh</pre><h3>Example Investigation Scenario</h3><p>An analyst receives an IOC tied to SSH activity from eight months ago.</p><p>The production OpenSearch cluster retains only 30 days.</p><p>Archived Wazuh logs already exist in S3.</p><p>Traditional approach:</p><ul><li>Restore snapshots</li><li>Build infrastructure</li><li>Wait hours</li></ul><p>With Live Query Engine:</p><ul><li>Refresh schem</li><li>Filter by date</li><li>Run query</li><li>Export evidence</li></ul><p>Investigation completes in minutes.</p><h3>Conclusion</h3><p>Historical security data is easy to store.</p><p>The difficult part is investigating it efficiently later.</p><p>Live Query Engine focuses on a very specific operational problem:</p><p>Providing controlled, low-overhead access to archived security data without requiring full infrastructure restoration.</p><p>For organizations managing large-scale retention in S3, that capability can significantly reduce investigation time, operational complexity, and infrastructure cost.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=59957ab09135" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Wazuh 4.x vs Wazuh 5.0 Beta: Architecture and Backend Changes]]></title>
            <link>https://yashpateld22d.medium.com/wazuh-4-x-vs-wazuh-5-0-beta-architecture-and-backend-changes-454b82fced1f?source=rss-0ab7e254ae3d------2</link>
            <guid isPermaLink="false">https://medium.com/p/454b82fced1f</guid>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[architecture-change]]></category>
            <category><![CDATA[wazuh]]></category>
            <category><![CDATA[difference]]></category>
            <category><![CDATA[siem]]></category>
            <dc:creator><![CDATA[Yash Patel]]></dc:creator>
            <pubDate>Tue, 28 Apr 2026 13:56:01 GMT</pubDate>
            <atom:updated>2026-04-28T13:56:01.399Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Simple comparison based only on official Wazuh documentation and observed backend files/directories from a Wazuh 5.0 beta environment.</em></p><h3>Introduction</h3><p>Wazuh 4.x is the current stable architecture used in many production environments.</p><p>Wazuh 5.0 beta introduces visible changes in documentation, backend paths, configuration files, event-processing terminology, indexer structure, and dashboard plugins.</p><p>This blog compares Wazuh 4.x and Wazuh 5.0 beta using only:</p><ul><li>Official Wazuh documentation</li><li>Observed backend files and directories from the beta environment</li></ul><p>This blog is only for understanding architectural and backend differences.</p><h3>High-Level Difference</h3><pre>+---------------------+------------------+------------------------+<br>| Area                | Wazuh 4.x        | Wazuh 5.0 Beta         |<br>+---------------------+------------------+------------------------+<br>| Central Component   | Wazuh Server     | Wazuh Manager          |<br>| Processing Model    | Analysis Engine  | Normalization Engine   |<br>| Data Forwarding     | Filebeat         | Indexer Connector      |<br>| Data Format         | Alerts / Events  | Wazuh Common Schema    |<br>| Architecture Style  | Traditional flow | Staged processing flow |<br>+---------------------+------------------+------------------------+</pre><h3>1. Central Component Naming</h3><h3>Wazuh 4.x</h3><p>In the current Wazuh documentation, the central components are described as:</p><ul><li>Wazuh server</li><li>Wazuh indexer</li><li>Wazuh dashboard</li></ul><p>The Wazuh server receives security data from agents and performs analysis.</p><h3>Wazuh 5.0 Beta</h3><p>In the Wazuh 5.0 beta documentation and backend paths, the central component is referred to as:</p><ul><li>Wazuh manager</li></ul><p>Observed backend path:</p><pre>/var/wazuh-manager/</pre><p>Observed content:</p><pre>VERSION.json<br>api<br>backup<br>bin<br>data<br>etc<br>framework<br>inventory_sync<br>lib<br>logs<br>queue<br>tmp<br>var</pre><h3>Practical Difference</h3><p>The visible naming and filesystem layout changed from the traditional /var/ossec style used in 4.x environments to /var/wazuh-manager in the observed 5.0 beta environment.</p><h3>2. Event Processing Model</h3><h3>Wazuh 4.x</h3><p>The Wazuh 4.x documentation describes the Wazuh server as decoding and matching rules against received events using the Wazuh Analysis engine.</p><p>Typical flow:</p><pre>Agent -&gt; Wazuh Server -&gt; Analysis Engine -&gt; Alerts / Events</pre><h3>Wazuh 5.0 Beta</h3><p>The Wazuh 5.0 beta documentation describes a normalization engine with staged processing.</p><p>The documented stages are:</p><ol><li>Pre-filter</li><li>Decoding</li><li>Enrichment</li><li>Post-filter</li><li>Outputs</li></ol><p>Typical documented flow:</p><pre>Input -&gt; Pre-filter -&gt; Decoding -&gt; Enrichment -&gt; Post-filter -&gt; Outputs</pre><h3>Practical Difference</h3><p>Wazuh 4.x documentation focuses on analysis using the Analysis engine.</p><p>Wazuh 5.0 beta documentation describes a staged normalization pipeline.</p><h3>3. Data Forwarding to the Indexer</h3><h3>Wazuh 4.x</h3><p>The Wazuh 4.x documentation states that the Wazuh server uses Filebeat to send alert and event data to the Wazuh indexer.</p><p>Documented flow:</p><pre>Wazuh Server -&gt; Filebeat -&gt; Wazuh Indexer</pre><h3>Wazuh 5.0 Beta</h3><p>The Wazuh 5.0 beta documentation describes an indexer connector that reads manager output data and sends it to the Wazuh indexer.</p><p>Documented flow:</p><pre>Wazuh Manager -&gt; Indexer Connector -&gt; Wazuh Indexer</pre><h3>Practical Difference</h3><p>The documented forwarding component changes:</p><ul><li>Wazuh 4.x: Filebeat</li><li>Wazuh 5.0 beta: Indexer connector</li></ul><p>This is a documentation-backed change in the event forwarding path.</p><h3>4. Wazuh Common Schema</h3><h3>Wazuh 4.x</h3><p>Wazuh 4.x documentation describes events being analyzed and alerts/events being forwarded to the indexer.</p><h3>Wazuh 5.0 Beta</h3><p>Wazuh 5.0 beta documentation describes raw data being transformed into standardized schema documents using the Wazuh Common Schema.</p><h3>Practical Difference</h3><p>The 5.0 beta documentation gives more explicit focus to standardized schema-based event representation.</p><h3>5. Manager Configuration Path</h3><h3>Wazuh 4.x</h3><p>Wazuh 4.x environments commonly use manager configuration under the traditional Wazuh configuration layout.</p><h3>Wazuh 5.0 Beta</h3><p>Observed configuration file:</p><pre>/var/wazuh-manager/etc/wazuh-manager.conf</pre><p>Observed sections include:</p><pre>&lt;remote&gt;<br>  &lt;port&gt;1514&lt;/port&gt;<br>  &lt;protocol&gt;tcp&lt;/protocol&gt;<br>  &lt;queue_size&gt;131072&lt;/queue_size&gt;<br>&lt;/remote&gt;<br><br>&lt;vulnerability-detection&gt;<br>  &lt;enabled&gt;yes&lt;/enabled&gt;<br>  &lt;feed-update-interval&gt;60m&lt;/feed-update-interval&gt;<br>&lt;/vulnerability-detection&gt;<br><br>&lt;indexer&gt;<br>  &lt;hosts&gt;<br>    &lt;host&gt;https://127.0.0.1:9200&lt;/host&gt;<br>  &lt;/hosts&gt;<br>&lt;/indexer&gt;<br><br>&lt;auth&gt;<br>  &lt;disabled&gt;no&lt;/disabled&gt;<br>  &lt;port&gt;1515&lt;/port&gt;<br>&lt;/auth&gt;<br><br>&lt;cluster&gt;<br>  &lt;name&gt;wazuh&lt;/name&gt;<br>  &lt;node_name&gt;node01&lt;/node_name&gt;<br>  &lt;node_type&gt;master&lt;/node_type&gt;<br>  &lt;port&gt;1516&lt;/port&gt;<br>&lt;/cluster&gt;</pre><h3>Practical Difference</h3><p>The observed 5.0 beta environment uses wazuh-manager.conf under /var/wazuh-manager/etc/.</p><h3>6. Manager Log Path</h3><h3>Wazuh 5.0 Beta Observed Backend</h3><p>Observed log path:</p><pre>/var/wazuh-manager/logs/</pre><p>Observed content:</p><pre>api<br>api.log<br>cluster<br>cluster.log<br>wazuh<br>wazuh-manager.log</pre><h3>Practical Difference</h3><p>For troubleshooting in the observed beta environment, manager logs are available under /var/wazuh-manager/logs/.</p><h3>7. Indexer Directory Structure</h3><h3>Wazuh 5.0 Beta Observed Backend</h3><p>Observed indexer path:</p><pre>/usr/share/wazuh-indexer/</pre><p>Observed content:</p><pre>NOTICE.txt<br>README.md<br>VERSION.json<br>agent<br>bin<br>engine<br>jdk<br>lib<br>modules<br>plugins</pre><h3>Practical Difference</h3><p>The observed 5.0 beta indexer installation includes an engine directory and a plugins directory under /usr/share/wazuh-indexer/.</p><h3>8. Engine Directory in Wazuh 5.0 Beta</h3><p>Observed engine path:</p><pre>/usr/share/wazuh-indexer/engine/</pre><p>Observed content:</p><pre>README.md<br>bin<br>data<br>logs<br>run_engine.sh<br>schemas<br>sockets</pre><p>Observed binary path:</p><pre>/usr/share/wazuh-indexer/engine/bin/wazuh-engine</pre><p>Observed schema files:</p><pre>/usr/share/wazuh-indexer/engine/schemas/wazuh-decoders.json<br>/usr/share/wazuh-indexer/engine/schemas/wazuh-filters.json</pre><h3>Practical Difference</h3><p>The observed 5.0 beta backend includes a Wazuh engine directory with binary, schema, log, data, and socket paths.</p><h3>9. Indexer Plugins in Wazuh 5.0 Beta</h3><p>Observed plugin path:</p><pre>/usr/share/wazuh-indexer/plugins/</pre><p>Observed plugins include:</p><pre>opensearch-alerting<br>opensearch-anomaly-detection<br>opensearch-asynchronous-search<br>opensearch-cross-cluster-replication<br>opensearch-geospatial<br>opensearch-index-management<br>opensearch-job-scheduler<br>opensearch-knn<br>opensearch-ml<br>opensearch-neural-search<br>opensearch-observability<br>opensearch-security<br>opensearch-sql<br>wazuh-indexer-content-manager<br>wazuh-indexer-notifications<br>wazuh-indexer-notifications-core<br>wazuh-indexer-reports-scheduler<br>wazuh-indexer-security-analytics<br>wazuh-indexer-setup</pre><h3>Practical Difference</h3><p>The observed Wazuh 5.0 beta indexer includes OpenSearch plugins and Wazuh-specific plugins such as:</p><ul><li>wazuh-indexer-content-manager</li><li>wazuh-indexer-notifications</li><li>wazuh-indexer-reports-scheduler</li><li>wazuh-indexer-security-analytics</li><li>wazuh-indexer-setup</li></ul><h3>10. Dashboard Configuration in Wazuh 5.0 Beta</h3><p>Observed dashboard path:</p><pre>/usr/share/wazuh-dashboard/</pre><p>Observed configuration path:</p><pre>/etc/wazuh-dashboard/opensearch_dashboards.yml</pre><p>Observed indexer connection:</p><pre>opensearch.hosts: https://127.0.0.1:9200</pre><p>Observed manager API connection:</p><pre>wazuh_core.hosts:<br>  default:<br>    url: https://127.0.0.1<br>    port: 55000<br>    username: wazuh-wui<br>    password: wazuh-wui<br>    run_as: true</pre><h3>Practical Difference</h3><p>The observed dashboard configuration connects to:</p><ul><li>Wazuh indexer on port 9200</li><li>Wazuh manager API on port 55000</li></ul><h3>11. Dashboard Plugins in Wazuh 5.0 Beta</h3><p>Observed dashboard plugin path:</p><pre>/usr/share/wazuh-dashboard/plugins/</pre><p>Observed plugins:</p><pre>alertingDashboards<br>anomalyDetectionDashboards<br>customImportMapDashboards<br>indexManagementDashboards<br>notificationsDashboards<br>reportsDashboards<br>securityAnalyticsDashboards<br>securityDashboards<br>wazuh<br>wazuhCheckUpdates<br>wazuhCore</pre><h3>Practical Difference</h3><p>The observed Wazuh 5.0 beta dashboard includes plugins for alerting, anomaly detection, index management, notifications, reports, security analytics, security dashboards, and Wazuh-specific dashboard functionality.</p><h3>Port Usage Comparison</h3><pre>+-----------------------+------------+-----------------------+<br>| Purpose               | Wazuh 4.x  | Wazuh 5.0 Beta        |<br>+-----------------------+------------+-----------------------+<br>| Agent Connection      | 1514       | 1514                  |<br>| Agent Enrollment      | 1515       | 1515                  |<br>| Cluster Communication | 1516       | 1516                  |<br>| Wazuh API             | 55000      | 55000                 |<br>| Indexer API           | 9200       | 9200                  |<br>| Dashboard             | 443        | 443                   |<br>| Syslog Collector      | 514        | Not listed in beta    |<br>+-----------------------+------------+-----------------------+</pre><h3>Note on Syslog Port</h3><p>The current Wazuh 4.x architecture documentation lists the Syslog collector on port 514.</p><p>The Wazuh 5.0 beta architecture page does not list port 514 in the required ports table.</p><p>That does not necessarily mean Syslog collection is removed. It only means it is not shown in that beta architecture required-ports table.</p><h3>Summary Comparison</h3><pre>+--------------------------+---------------------------+--------------------------------+<br>| Area                     | Wazuh 4.x                 | Wazuh 5.0 Beta                 |<br>+--------------------------+---------------------------+--------------------------------+<br>| Central naming           | Wazuh server              | Wazuh manager                  |<br>| Event processing         | Wazuh Analysis engine     | Normalization engine           |<br>| Forwarding to indexer    | Filebeat                  | Indexer connector              |<br>| Schema terminology       | Alerts / events           | Wazuh Common Schema            |<br>| Manager base path        | Traditional 4.x layout    | /var/wazuh-manager             |<br>| Manager config observed  | ossec-style config        | wazuh-manager.conf             |<br>| Manager logs observed    | Traditional 4.x logs      | /var/wazuh-manager/logs        |<br>| Indexer engine observed  | Not shown in this form    | /usr/share/wazuh-indexer/engine|<br>| Dashboard API target     | Server API 55000          | Manager API 55000              |<br>| Indexer API              | 9200                      | 9200                           |<br>+--------------------------+---------------------------+--------------------------------+</pre><h3>What These Changes Mean Practically</h3><p>From the official documentation and observed backend structure, Wazuh 5.0 beta shows changes in:</p><ul><li>Component naming</li><li>Event processing terminology</li><li>Forwarding path to the indexer</li><li>Manager filesystem layout</li><li>Manager configuration path</li><li>Manager log path</li><li>Indexer engine files</li><li>Indexer plugins</li><li>Dashboard plugins</li></ul><p>This means administrators testing Wazuh 5.0 beta should avoid assuming that all Wazuh 4.x paths, service references, and troubleshooting habits will look the same.</p><h3>Conclusion</h3><p>Wazuh 4.x and Wazuh 5.0 beta share familiar concepts such as agents, manager/server communication, indexer, dashboard, API, and common ports.</p><p>However, Wazuh 5.0 beta introduces visible architecture and backend changes, especially around:</p><ul><li>Wazuh manager naming</li><li>Normalization engine</li><li>Indexer connector</li><li>Wazuh Common Schema</li><li>/var/wazuh-manager/</li><li>/usr/share/wazuh-indexer/engine/</li><li>Wazuh-specific indexer and dashboard plugins</li></ul><p>This comparison is based only on official documentation and observed backend files from the beta environment.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=454b82fced1f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Wazuh Health Checkup : Automating Health Reporting for Wazuh 4.x Environments]]></title>
            <link>https://yashpateld22d.medium.com/wazuh-health-checkup-automating-health-reporting-for-wazuh-4-x-environments-d1290e8393fc?source=rss-0ab7e254ae3d------2</link>
            <guid isPermaLink="false">https://medium.com/p/d1290e8393fc</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[troubleshooting]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[wazuh-manager]]></category>
            <category><![CDATA[siem]]></category>
            <dc:creator><![CDATA[Yash Patel]]></dc:creator>
            <pubDate>Mon, 27 Apr 2026 12:36:01 GMT</pubDate>
            <atom:updated>2026-04-27T12:36:01.242Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>How a Bash-based health check script helps Wazuh administrators understand the health of their 4.x deployment .</strong></p><p><strong>Note: Run this Script in Wazuh-Manager Server.</strong></p><h3>Introduction</h3><p>Running Wazuh in production is not just about collecting logs and generating alerts.</p><p>A healthy Wazuh environment depends on many moving parts working together: manager services, agents, Filebeat, indexer health, dashboard availability, certificates, disk usage, JVM memory, API access, and configuration validity.</p><p>If one of these areas fails silently, your visibility can be affected.</p><p>That is the exact problem this project tries to solve:</p><p><strong>Project:</strong> <a href="https://github.com/yash22091/wazuh-healthcheck">https://github.com/yash22091/wazuh-healthcheck</a></p><p>This repository provides a Bash-based health check script for Wazuh 4.x environments. It generates a clean operational health report so administrators can quickly understand the current state of their Wazuh stack.</p><p>The script is focused on Wazuh 4.x only.</p><p>It is not designed as a Wazuh 5.0 beta compatibility tool.</p><p>This blog covers :</p><ul><li>How the Wazuh Health Checkup script helps in Wazuh 4.x environments</li></ul><h3>What This Project Does</h3><p>This project is a Wazuh 4.x health check and reporting utility.</p><p>It checks important Wazuh services, APIs, indexer status, agent status, system resources, certificates, and configuration files, then generates reports in two formats:</p><ul><li>HTML report</li><li>JSON report</li></ul><p>The goal is simple:</p><blockquote><em>Give Wazuh administrators a fast, readable, and shareable health report for their Wazuh 4.x deployment.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e5IAatqKg4JM2MQR4Ec16w.png" /><figcaption>Overview</figcaption></figure><h3>Why a Wazuh Health Check Report Is Useful</h3><p>In real environments, Wazuh has several dependencies.</p><p>A dashboard may be reachable, but Filebeat may be down.</p><p>Agents may be installed, but many may be disconnected.</p><p>The indexer may be running, but disk usage may be close to dangerous limits.</p><p>The manager may be active, but some internal services may not be healthy.</p><p>A health check report helps answer important operational questions:</p><ul><li>Is the Wazuh manager reachable?</li><li>Are core services running?</li><li>Is the Wazuh API responding?</li><li>Is Filebeat working?</li><li>Is the indexer cluster healthy?</li><li>Are certificates valid?</li><li>Are agents connected?</li><li>Are there outdated agents?</li><li>Is disk usage safe?</li><li>Are there configuration errors?</li></ul><p>Instead of checking each area manually, this script puts the results into one report.</p><h3>Repository Overview</h3><p>The repository contains:</p><ul><li>healthcheck.sh — main Bash script</li><li>client.cfg.example — sample configuration file</li><li>README.md — usage details and feature overview</li></ul><p>You can run it interactively:</p><pre>./healthcheck.sh</pre><p>Or you can run it using a configuration file:</p><pre>./healthcheck.sh --config client.cfg</pre><p>Using a config file is better when you want repeatable checks or scheduled reporting.</p><h3>Example Configuration</h3><pre>CLIENTNAME=&quot;Production-Wazuh&quot;<br>HOST=&quot;10.0.0.10&quot;<br>PORT=&quot;9200&quot;<br>USERNAME=&quot;admin&quot;<br>PASSWORD=&quot;your-indexer-password&quot;<br>MANAGER=&quot;10.0.0.20&quot;<br>API_USERNAME=&quot;wazuh-wui&quot;<br>API_PASSWORD=&quot;your-api-password&quot;<br>RESTART_SERVICE=&quot;&quot;<br>REPORT_DIR=&quot;/tmp&quot;<br>EMAIL_RECIPIENT=&quot;soc-team@example.com&quot;</pre><h3>Executive Summary</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e5IAatqKg4JM2MQR4Ec16w.png" /><figcaption>Executive Summary</figcaption></figure><h3>Actionable Recommendations</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T4DhSVKtFmm2jg2Wa3-KoQ.png" /><figcaption>Recommendations section</figcaption></figure><h3>What the Script Checks in Wazuh 4.x</h3><h3>Network Connectivity &amp; SSL Certificate Expiry</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iD121uymd4XT7pUvD55d3A.png" /><figcaption>Network connectivity section &amp; SSL certificate expiry section</figcaption></figure><h3>Wazuh Indexer Cluster Health</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o7cHwnG3CO2sF0-2jsKb7Q.png" /><figcaption>Indexer cluster health section</figcaption></figure><h3>Disk Usage and Watermarks</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZXnoB0bVpTNuDsWoaYaywA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ABAuNyTIaVyfntH976xUlw.png" /><figcaption>Disk usage / watermark section</figcaption></figure><h3>Filebeat and Event Queue</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zEfrVGvSncvaMAjwC-oiqg.png" /></figure><h3>Cluster-Level Stats</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LLfsizU2-9UqhVg-m1DziA.png" /></figure><h3>JVM, CPU, Memory, and Swap</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Pf1EbfVtOe886XyP0bjb2w.png" /><figcaption>JVM / CPU / memory section</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ABAuNyTIaVyfntH976xUlw.png" /><figcaption>JVM / CPU / memory section</figcaption></figure><h3>Wazuh Manager Services</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RUkhrtRUqO3R0WjKzYxq9w.png" /><figcaption>Wazuh manager services table</figcaption></figure><h3>Wazuh Agents</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FxCkofeszMm02HC9g1UCoQ.png" /><figcaption>Agent overview section</figcaption></figure><h3>Unassigned Shards</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6Ed0dmZW9uApyMzaQKRPqg.png" /></figure><h3>Configuration and Logs</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wrak_eSUHkOc3Ikky495mQ.png" /><figcaption>Configuration validation section</figcaption></figure><h3>Indexer Indices</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GtULGo6_vyAOixceCLcoQA.png" /><figcaption>Indices</figcaption></figure><h3>Analysisd Statistics</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p--BzuRkxI7pBGXmf6MBfQ.png" /></figure><h3>NTP and Inotify</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ynn3vKTNUOyx8lAjE1PpHQ.png" /><figcaption>NTP and inotify section</figcaption></figure><h3>Vulnerability Detection Health</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9G4lWq7TAEhXFdBm6BGQvQ.png" /><figcaption>Vulnerability detection section</figcaption></figure><h3>Practical Benefits</h3><p>This script helps Wazuh administrators by providing:</p><ul><li>Faster troubleshooting</li><li>Better visibility into Wazuh 4.x health</li><li>Clear reporting for clients or internal teams</li><li>Early warning for disk, certificate, service, and agent problems</li><li>One place to review manager, indexer, dashboard, and agent health</li></ul><h3>Conclusion</h3><p>Wazuh is powerful, but running it properly requires visibility into the platform itself.</p><p>This project provides a practical health check report for Wazuh 4.x environments.</p><h3>Project Link</h3><p><a href="https://github.com/yash22091/wazuh-healthcheck">https://github.com/yash22091/wazuh-healthcheck</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d1290e8393fc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Lightweight Wazuh Pipeline Using OCSF and ClickHouse]]></title>
            <link>https://yashpateld22d.medium.com/a-lightweight-wazuh-pipeline-using-ocsf-and-clickhouse-dca937c83fe6?source=rss-0ab7e254ae3d------2</link>
            <guid isPermaLink="false">https://medium.com/p/dca937c83fe6</guid>
            <category><![CDATA[wazuh]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[ocsf]]></category>
            <category><![CDATA[etl-pipeline]]></category>
            <category><![CDATA[clickhouse]]></category>
            <dc:creator><![CDATA[Yash Patel]]></dc:creator>
            <pubDate>Thu, 19 Mar 2026 19:16:06 GMT</pubDate>
            <atom:updated>2026-04-20T09:21:50.322Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Simplifying Wazuh data pipelines with a single Rust binary, standardized schema, and high-performance analytics</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O8fXLGBg76apTWVEl-MkmQ.png" /></figure><h3>Introduction</h3><p>As security teams scale their environments, they often face challenges related to handling increasing volumes of log data. Traditional pipelines can struggle with query performance, storage efficiency, and overall infrastructure cost when dealing with large datasets.</p><p>This article presents a lightweight and scalable pipeline that extends Wazuh by integrating OCSF (Open Cybersecurity Schema Framework) for normalization and ClickHouse for high-performance storage and analytics.</p><p>This approach introduces a lightweight and efficient pipeline that enhances Wazuh by integrating OCSF normalization and ClickHouse for high-performance storage and analytics. The primary goal of this architecture is to address challenges related to scalability, query performance, and cost optimization when handling large volumes of security data.</p><h3>Key Components</h3><h3>1. Wazuh (Detection Engine)</h3><p>Wazuh continues to serve as the central component responsible for:</p><ul><li>Log collection</li><li>Threat detection</li><li>Rule-based analysis</li><li>Alert generation</li></ul><p>It remains unchanged and operates as the foundation of the pipeline.</p><h3>2. OCSF Normalization Layer</h3><p>OCSF (Open Cybersecurity Schema Framework) is used to standardize security data into a consistent format.</p><p>Benefits:</p><ul><li>Vendor-agnostic schema</li><li>Improved interoperability</li><li>Easier correlation across data sources</li></ul><p>This layer ensures that all incoming Wazuh alerts and logs are transformed into a structured and unified format before being stored.</p><h3>3. ClickHouse (Analytics &amp; Storage)</h3><p>ClickHouse is used as the primary analytics database for storing normalized data.</p><p>Why ClickHouse?</p><ul><li>High-performance columnar storage</li><li>Fast analytical queries</li><li>Efficient compression</li><li>Cost-effective for large-scale datasets</li></ul><p>This makes it particularly well-suited for handling high-volume security telemetry.</p><h3>When Should You Use This?</h3><p>This architecture is particularly useful in scenarios where:</p><ul><li>You are dealing with large-scale log ingestion</li><li>Traditional storage/query layers are becoming slow or expensive</li><li>You need faster analytical capabilities for security investigations</li><li>You want standardized data across multiple sources</li></ul><h3>TL;DR</h3><p>If you are running Wazuh, the default pipeline typically looks like this:</p><pre>Wazuh Manager → Filebeat → Wazuh Indexer → Wazuh Dashboard</pre><p>This works well, but comes with trade-offs:</p><ul><li>Multiple components to manage</li><li>High memory usage (JVM-based indexer)</li><li>Schema inconsistencies</li><li>Limited flexibility for deep analytics</li></ul><p>I built <strong>wazuh-ocsf-etl</strong>, a lightweight Rust-based pipeline that:</p><ul><li>Normalizes alerts into <strong>OCSF (standard schema)</strong></li><li>Stores data in <strong>ClickHouse</strong></li><li>Visualizes data using <strong>Grafana</strong></li><li>Replaces multiple components with a <strong>single 4.2 MB binary</strong></li></ul><p><strong>Result: lower cost, better performance, and unified analytics.</strong></p><h3>Architecture Comparison</h3><h3>Default Wazuh Pipeline</h3><pre>Wazuh → Filebeat → Wazuh Indexer → Wazuh Dashboard</pre><h3>New Pipeline</h3><pre>Wazuh → wazuh-ocsf-etl → ClickHouse → Grafana</pre><h3>Visual Architecture Diagram</h3><pre>                ┌────────────────────┐<br>                │   Wazuh Manager    │<br>                │ alerts.json / ZMQ  │<br>                └─────────┬──────────┘<br>                          │<br>                          ▼<br>               ┌──────────────────────┐<br>               │ wazuh-ocsf-etl (Rust)│<br>               │ - Tail / Stream      │<br>               │ - Transform → OCSF   │<br>               │ - Batch + Insert     │<br>               └─────────┬────────────┘<br>                          │<br>                          ▼<br>                 ┌──────────────────┐<br>                 │   ClickHouse     │<br>                 │ Columnar Storage │<br>                 └─────────┬────────┘<br>                          │<br>                          ▼<br>                 ┌──────────────────┐<br>                 │     Grafana      │<br>                 │ Dashboards &amp; Viz │<br>                 └──────────────────┘</pre><h3>Why This Matters</h3><p>This approach solves multiple long-standing challenges in Wazuh environments:</p><h3>1. Removes Pipeline Complexity</h3><ul><li>No Filebeat tuning</li><li>No JVM-heavy stack</li></ul><h3>2. Standardizes Schema Using OCSF</h3><p>All logs — regardless of source — follow the same structure.</p><h3>3. Enables Real Analytics</h3><p>ClickHouse allows:</p><ul><li>Fast aggregations</li><li>Large-scale queries</li><li>Efficient storage</li></ul><h3>4. Unified Visualization with Grafana</h3><ul><li>Native ClickHouse integration</li><li>Real-time dashboards</li><li>Cross-source visual correlation</li></ul><h3>Benchmark: Real Test Results</h3><p>Test environment:</p><ul><li>Input: ~500 MB alerts.json</li><li>Total events: ~568,000 logs</li></ul><h3>Results</h3><ul><li>Full ingestion completed in <strong>~2 minutes</strong></li><li>All logs successfully <strong>parsed and normalized to OCSF</strong></li><li>After ingestion → <strong>real-time streaming started immediately</strong></li></ul><h3>What this shows</h3><ul><li>High throughput ingestion</li><li>Efficient parsing pipeline</li><li>Smooth transition from batch → real-time</li></ul><h3>Schema Standardization (Core Value)</h3><p>Wazuh produces different structures per source.</p><p>This pipeline maps all of them into OCSF.</p><h3>Example</h3><pre>| Source   | Original Field     | OCSF Field |<br>|----------|--------------------|------------|<br>| AWS      | sourceIPAddress    | src_ip     |<br>| Windows  | IpAddress          | src_ip     |<br>| Linux    | srcip              | src_ip     |</pre><p>Result: <strong>one query works everywhere</strong></p><h3>Prerequisites</h3><p>Before starting, ensure you have:</p><ul><li>Wazuh Manager installed and running (alerts.json enabled)</li><li>ClickHouse 22.x+ installed and reachable</li><li>Grafana installed (for visualization)</li><li>Linux OS (tested on Ubuntu 22.04 / RHEL 9)</li><li>Root or sudo access</li></ul><h3>Step-by-Step Installation</h3><h3>1. Download Binary</h3><pre>wget https://github.com/yash22091/wazuh-ocsf-etl/releases/download/latest/wazuh-ocsf-etl<br>chmod +x wazuh-ocsf-etl</pre><h3>2. Run Installer</h3><pre>wget -q  https://github.com/yash22091/wazuh-ocsf-etl/releases/download/latest/install.sh<br>chmod +x install.sh<br>sudo ./install.sh wazuh-ocsf-etl</pre><p>This will:</p><ul><li>Install binary to /usr/local/bin</li><li>Create system user</li><li>Setup /opt/wazuh-ocsf directory</li><li>Create config + state files</li><li>Register systemd service</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bxkxb2EGhYT1sIiayS5MRQ.png" /></figure><h3>3. Configure</h3><pre>nano /opt/wazuh-ocsf/.env</pre><h3>4. Start Service</h3><pre>systemctl start wazuh-ocsf-etl<br>systemctl status wazuh-ocsf-etl<br>journalctl -u wazuh-ocsf-etl -f</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-e_kbRU7g0Yrb8iFE_HpxA.png" /></figure><h3>Common Errors</h3><ul><li>Permission denied → ensure user has access to alerts.json</li><li>ClickHouse refused → verify URL and port</li></ul><h3>ClickHouse Table Schema</h3><p>Example table created automatically:</p><pre>CREATE TABLE ocsf_agent<br>(<br>    class_uid UInt16,<br>    time UInt32,<br>    severity_id UInt8,<br>    src_ip String,<br>    dst_ip String,<br>    actor_user String,<br>    event_data String,<br>    raw_data String<br>)<br>ENGINE = MergeTree<br>ORDER BY (class_uid, time);</pre><h3>Grafana Setup</h3><h3>1. Install Plugin</h3><ul><li>ClickHouse plugin (Grafana Labs)</li></ul><h3>2. Add Data Source</h3><ul><li>URL: <a href="http://clickhouse:8123/">http://clickhouse:8123</a></li><li>Database: wazuh_ocsf</li></ul><h3>3. Sample Query</h3><pre>SELECT src_ip, count()<br>FROM ocsf_agent<br>GROUP BY src_ip<br>ORDER BY count() DESC</pre><h3>ZeroMQ Mode</h3><p>Two input modes are supported:</p><pre>| Mode    | Description                                      |<br>|---------|--------------------------------------------------|<br>| file    | Reads alerts.json (default, reliable)            |<br>| zeromq  | Subscribes directly to Wazuh event stream        |</pre><h3>Important Note (Very Critical)</h3><p>ZeroMQ support is <strong>NOT enabled in default Wazuh binary packages</strong> (.deb/.rpm).</p><p>To use ZeroMQ mode:</p><ul><li>Wazuh must be <strong>built from source</strong></li><li>Enable with:</li></ul><pre>make TARGET=server USE_ZEROMQ=yes</pre><p>Why this matters:</p><ul><li>Default installations will <strong>not publish ZeroMQ events</strong></li><li>Configuration options will be ignored if not compiled with ZeroMQ</li></ul><h3>When to use ZeroMQ</h3><ul><li>High event volume (EPS)</li><li>Need lower latency</li><li>Remote ingestion setup</li></ul><h3>Recommendation</h3><ul><li>Use <strong>file mode</strong> for most deployments (reliable, at-least-once)</li><li>Use <strong>ZeroMQ mode only when needed</strong> and properly compiled</li></ul><h3>OCSF Transformation Example</h3><p>Before (Wazuh):</p><pre>{ &quot;data.srcip&quot;: &quot;1.2.3.4&quot; }</pre><p>After (OCSF):</p><pre>{ &quot;src_ip&quot;: &quot;1.2.3.4&quot;, &quot;class_uid&quot;: 4001 }</pre><h3>Resource Usage Comparison</h3><pre>| Metric       | Default Stack | This Pipeline        |<br>|--------------|---------------|----------------------|<br>| RAM          | 16–64 GB      | ~50 MB               |<br>| Storage      | 1×            | 10–20× better        |<br>| Query Speed  | Baseline      | 10–100× faster       |</pre><h3>OCSF Classes (Example)</h3><pre>| class_uid | Meaning             |<br>|-----------|---------------------|<br>| 3002      | Authentication      |<br>| 4001      | Network Activity    |<br>| 2002      | Vulnerability       |</pre><h3>Hot Reload Example</h3><ol><li>Edit field_mappings.toml</li><li>Wait ~10 seconds</li><li>New field appears in ClickHouse</li></ol><h3>Troubleshooting</h3><ul><li>No ingestion → check ALERTS_FILE path</li><li>ClickHouse errors → verify connection</li><li>Missing fields → check unmapped_fields.json</li></ul><h3>Security Considerations</h3><ul><li>Run as non-root user</li><li>Protect .env credentials</li><li>Restrict network access</li></ul><h3>Configuration (Important for Users)</h3><p>One important part of the deployment is the runtime .env file created by install.sh at:</p><p>/opt/wazuh-ocsf/.env</p><p>This is the file you edit after installation.</p><h3>Example .env</h3><pre># ══════════════════════════════════════════════════════════════════<br>#  wazuh-ocsf-etl  —  Runtime configuration<br>#  Edit this file, then run:  systemctl restart wazuh-ocsf-etl<br># ══════════════════════════════════════════════════════════════════<br><br># ── ClickHouse connection ─────────────────────────────────────────<br>CLICKHOUSE_URL=http://IP:8123<br>CLICKHOUSE_DATABASE=wazuh_ocsf<br>CLICKHOUSE_USER=default<br>CLICKHOUSE_PASSWORD=<br><br># ── Input source ──────────────────────────────────────────────────<br># file   — read alerts.json from disk (default)<br># zeromq — subscribe to wazuh-analysisd ZeroMQ PUB socket (no disk I/O)<br>INPUT_MODE=file<br><br># Path to Wazuh alerts JSON (FILE mode only)<br>ALERTS_FILE=/var/ossec/logs/alerts/alerts.json<br><br># ZeroMQ URI (ZEROMQ mode only)<br># ZEROMQ_URI=tcp://localhost:11111<br><br># ── State / config ────────────────────────────────────────────────<br>STATE_FILE=/opt/wazuh-ocsf/state/alerts.pos<br>UNMAPPED_FIELDS_FILE=/opt/wazuh-ocsf/state/unmapped_fields.json<br>FIELD_MAPPINGS_FILE=/opt/wazuh-ocsf/config/field_mappings.toml<br><br># ── First-run behaviour ───────────────────────────────────────────<br># true  = start from current end of file (skip historical data)<br># false = process entire alerts.json from the beginning<br>SEEK_TO_END_ON_FIRST_RUN=true<br><br># ── Throughput tuning ─────────────────────────────────────────────<br>BATCH_SIZE=5000<br>FLUSH_INTERVAL_SECS=5<br>CHANNEL_CAP=50000<br><br># ── Data retention ────────────────────────────────────────────────<br># Delete rows older than N days (leave empty to keep forever)<br>DATA_TTL_DAYS=90<br><br># ── OCSF schema validation ────────────────────────────────────────<br># Set false during load testing to skip per-event validation<br>OCSF_VALIDATE=true<br><br># ── Logging ───────────────────────────────────────────────────────<br># Levels: error | warn | info | debug | trace<br>RUST_LOG=info<br><br># ── Special locations (optional) ─────────────────────────────────<br># Comma-separated location names routed to shared tables instead<br># of per-agent tables.  Example:<br># SPECIAL_LOCATIONS=aws_cloudtrail,okta,azure_ad</pre><h3>What each setting is used for</h3><h4>ClickHouse connection</h4><ul><li>CLICKHOUSE_URL → ClickHouse HTTP endpoint</li><li>CLICKHOUSE_DATABASE → database name where OCSF tables are created</li><li>CLICKHOUSE_USER / CLICKHOUSE_PASSWORD → credentials used by the ETL service</li></ul><h4>Input source</h4><ul><li>INPUT_MODE=file → reads /var/ossec/logs/alerts/alerts.json</li><li>INPUT_MODE=zeromq → subscribes directly to Wazuh ZeroMQ stream</li><li>ALERTS_FILE is used only in file mode</li><li>ZEROMQ_URI is used only in zeromq mode</li></ul><h4>State and config</h4><ul><li>STATE_FILE stores inode + byte offset so the pipeline can resume safely after restart</li><li>UNMAPPED_FIELDS_FILE stores all fields that were seen but not yet mapped to typed OCSF columns</li><li>FIELD_MAPPINGS_FILE points to the hot-reloaded TOML mapping file</li></ul><h4>First-run behaviour</h4><ul><li>SEEK_TO_END_ON_FIRST_RUN=true → best for production systems where you want to skip old alerts and start tailing immediately</li><li>SEEK_TO_END_ON_FIRST_RUN=false → best for initial historical backfill, where you want to ingest the full existing alerts.json</li></ul><p>This is especially useful when you already have a large file on disk, such as your first-run test with ~500 MB and ~568k alerts.</p><h4>Throughput tuning</h4><ul><li>BATCH_SIZE controls how many events are grouped into one insert</li><li>FLUSH_INTERVAL_SECS ensures low-volume streams still flush regularly</li><li>CHANNEL_CAP controls the size of the async in-memory queue between reader and writer</li></ul><h4>Data retention</h4><ul><li>DATA_TTL_DAYS=90 means ClickHouse can automatically delete data older than 90 days</li><li>Leave it empty if you want to retain data indefinitely</li></ul><h4>Validation and logging</h4><ul><li>OCSF_VALIDATE=true validates transformed events against the OCSF schema</li><li>RUST_LOG=info controls runtime verbosity</li></ul><h3>Special locations: when and why to use them</h3><p>One very useful option is:</p><p>SPECIAL_LOCATIONS=Wazuh-AWS,office365</p><p>By default, the pipeline creates tables based on the Wazuh agent name, which works well for host-based logs such as Linux servers, Windows endpoints, or firewalls collected from a specific device.</p><p>However, some sources are <strong>shared platform logs</strong>, not host-specific logs.</p><p>Examples:</p><ul><li>AWS</li><li>Office 365</li><li>Okta</li><li>Azure AD</li><li>GCP</li></ul><p>For those, creating per-agent tables is usually not ideal.</p><p>Instead, by adding those source locations to SPECIAL_LOCATIONS, the ETL can route them into fixed shared tables such as:</p><ul><li>ocsf_Wazuh_AWS</li><li>ocsf_office365</li><li>ocsf_okta</li><li>ocsf_azure_ad</li></ul><p>This makes dashboards and queries much cleaner.</p><h3>Example use case</h3><p>If AWS logs are coming into Wazuh, and the Wazuh location or source label is something like Wazuh-AWS, then you should add the corresponding location name in SPECIAL_LOCATIONS so those logs are grouped into a shared AWS table instead of being mixed into a host-style table.</p><p>Likewise, if Office 365 logs are coming into Wazuh, adding office365 to SPECIAL_LOCATIONS ensures they are stored in a dedicated Office 365 table.</p><p>For device-specific logs such as firewall logs, router logs, or server logs, per-agent/per-device tables still make sense, because those logs are naturally tied to a specific host, device name, or IP-based source.</p><p>In short:</p><ul><li><strong>Shared cloud/SaaS sources</strong> → add them to SPECIAL_LOCATIONS</li><li><strong>Host/device-specific sources</strong> → keep normal per-agent table routing</li></ul><h3>Visualization with Grafana</h3><p>Grafana is used for dashboards:</p><ul><li>Connects directly to ClickHouse</li><li>Displays real-time alerts</li></ul><p>Supports filtering by:</p><ul><li>severity</li><li>class_uid</li><li>src_ip</li><li>user</li></ul><h3>Example dashboards</h3><ul><li>Alert trends over time</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WE8vglSFkS5ebD0LC5nsfA.png" /></figure><ul><li>Top attackers</li><li>Authentication failures</li><li>MITRE ATT&amp;CK mapping</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jK8A3vKtZ1iMVSUcHkKC6w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RUVnU7TxYor9q40hX9q8OQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g1eu_4FVhRyoasPARWq5-Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gNdMcYEwk7a2NQgCQB5XMg.png" /></figure><h3>Advanced Features</h3><h3>Hot Reload Config</h3><ul><li>Update mappings without restart</li></ul><h3>Unmapped Field Detection</h3><ul><li>Automatically identifies missing schema mappings</li></ul><h3>Reliable Ingestion</h3><ul><li>Offset tracking</li><li>Backpressure control</li></ul><h3>Multi-Source Support</h3><ul><li>AWS, Azure, Okta, GCP, Windows, Linux, Many more</li></ul><h3>Impact on Wazuh Ecosystem</h3><p>This approach introduces:</p><ul><li>Unified schema across all sources</li><li>Reduced infrastructure cost</li><li>Faster analytics</li><li>Simplified deployment</li></ul><p>It lowers the barrier for teams who want:</p><ul><li>SIEM-like capabilities</li><li>Without heavy infrastructure</li></ul><h3>What Gets Installed (Important)</h3><p>When you run the <a href="https://github.com/yash22091/wazuh-ocsf-etl/releases/download/latest/install.sh">install.sh</a> script, the pipeline sets up a structured environment on the system.</p><h3>Directory Structure</h3><pre>/opt/wazuh-ocsf/<br>├── .env<br>├── config/<br>│   └── field_mappings.toml<br>└── state/<br>    ├── alerts.pos<br>    └── unmapped_fields.json</pre><h3>1. .env (Configuration File)</h3><p>This file controls the runtime behavior of the pipeline.</p><p>It defines:</p><ul><li>ClickHouse connection</li><li>Input mode (file / zeromq)</li><li>Performance tuning (batch size, flush interval)</li><li>Logging level</li></ul><p>This is the <strong>main configuration file</strong> you will edit after installation.</p><h3>2. config/field_mappings.toml</h3><p>This is one of the most important files.</p><p>It allows you to map custom Wazuh fields into OCSF columns.</p><p>Example:</p><pre>[field_mappings]<br>&quot;data.custom.ip&quot; = &quot;src_ip&quot;<br>&quot;data.user.name&quot; = &quot;actor_user&quot;</pre><p>Why it matters:</p><ul><li>Handles <strong>custom decoders</strong></li><li>Extends schema without code changes</li><li>Hot-reloads every ~10 seconds (no restart required)</li></ul><h3>3. state/alerts.pos</h3><p>This file stores:</p><ul><li>File inode</li><li>Byte offset</li></ul><p>Example:</p><pre>inode=123456<br>offset=987654321</pre><p>Why it matters:</p><ul><li>Ensures <strong>no data loss on restart</strong></li><li>Allows pipeline to resume exactly where it stopped</li><li>Handles <strong>log rotation safely</strong></li></ul><h3>4. state/unmapped_fields.json</h3><p>This file tracks fields that are not yet mapped to OCSF.</p><p>Example:</p><pre>{<br>  &quot;data.custom.transaction_id&quot;: {<br>    &quot;count&quot;: 4821,<br>    &quot;example&quot;: &quot;txn-123&quot;,<br>    &quot;suggested_toml&quot;: &quot;\&quot;data.custom.transaction_id\&quot; = \&quot;finding_uid\&quot;&quot;<br>  }<br>}</pre><p>Why it matters:</p><ul><li>Shows <strong>what you are missing</strong></li><li>Helps improve schema coverage</li><li>Provides ready-to-use mapping suggestions</li></ul><h3>Why This Design Is Important</h3><p>Most pipelines hide internal state and mappings.</p><p>This pipeline makes everything explicit:</p><ul><li>Config is editable</li><li>State is transparent</li><li>Schema evolution is guided</li></ul><p>This gives operators <strong>full control and visibility</strong>.</p><h3>Deployment</h3><pre>wget https://github.com/yash22091/wazuh-ocsf-etl/releases/download/latest/wazuh-ocsf-etl<br>chmod +x wazuh-ocsf-etl<br><br>wget -q  https://github.com/yash22091/wazuh-ocsf-etl/releases/download/latest/install.sh<br>chmod +x install.sh<br><br>sudo ./install.sh wazuh-ocsf-etl</pre><p>Edit .env and start service.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ycFKZyeIZ6JdHusxFNQW9w.png" /></figure><h3>Conclusion</h3><p>This pipeline transforms Wazuh from a detection engine into a full analytics platform.</p><p>By combining:</p><ul><li>OCSF → schema</li><li>ClickHouse → performance</li><li>Grafana → visualization</li></ul><p>You get a scalable, efficient, and modern security data pipeline.</p><h3>Try It</h3><p>GitHub: <a href="https://github.com/yash22091/wazuh-ocsf-etl">https://github.com/yash22091/wazuh-ocsf-etl</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dca937c83fe6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Wazuh Performance Tuning Guide: How Poor Rule Design Causes analysisd CPU Spikes (and How to Fix…]]></title>
            <link>https://yashpateld22d.medium.com/wazuh-performance-tuning-guide-how-poor-rule-design-causes-analysisd-cpu-spikes-and-how-to-fix-a2c7be9670f1?source=rss-0ab7e254ae3d------2</link>
            <guid isPermaLink="false">https://medium.com/p/a2c7be9670f1</guid>
            <category><![CDATA[troubleshooting]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[wazuh]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[wazuh-manager]]></category>
            <dc:creator><![CDATA[Yash Patel]]></dc:creator>
            <pubDate>Thu, 12 Mar 2026 17:16:00 GMT</pubDate>
            <atom:updated>2026-03-12T17:16:00.664Z</atom:updated>
            <content:encoded><![CDATA[<h3>Wazuh Performance Tuning Guide: How Poor Rule Design Causes analysisd CPU Spikes (and How to Fix It)</h3><p>Most organizations deploy Wazuh to improve visibility across endpoints, infrastructure, and applications. The platform is powerful, flexible, and capable of processing massive volumes of security events. But there is a problem many teams discover only after months of operation:</p><p><strong>Wazuh performance problems are often caused not by infrastructure limits, but by rule design.</strong></p><p>In many environments, custom detection rules grow organically over time. One team adds rules for a new log source, another adds rules for threat intelligence, and a third introduces exceptions or allowlists. Eventually the ruleset becomes complex enough that it starts affecting the SIEM’s performance.</p><p>This article explains a real‑world issue I encountered where poorly structured rules created unexpected load on the Wazuh analysis engine. It also introduces two scripts I built to diagnose and solve the problem in production environments.</p><h3>Understanding How Wazuh Processes Events</h3><p>To understand why rule design affects performance, it is important to understand how Wazuh actually evaluates logs internally.</p><p>Every event received by the Wazuh manager passes through several stages before an alert is generated. Most of this work is handled by the <strong>wazuh‑analysisd</strong> daemon.</p><p>The simplified pipeline looks like this:</p><ol><li>Event ingestion</li><li>Log decoding</li><li>Rule evaluation</li><li>Dependency checks (parent rules or groups)</li><li>Optional CDB list lookups</li><li>Alert generation</li></ol><p>This sequence happens <strong>for every single event processed by the manager</strong>.</p><p>In large environments processing thousands of events per second, even small inefficiencies in rule design can multiply into serious CPU consumption.</p><h3>Step 1 — Event Ingestion</h3><p>Logs arrive to the Wazuh manager from several sources:</p><ul><li>Wazuh agents</li><li>Syslog integrations</li><li>Cloud services</li><li>Application logs</li><li>Network device logs</li></ul><p>These events are forwarded to the analysis engine for processing.</p><h3>Step 2 — Decoder Processing</h3><p>Before rules are evaluated, Wazuh attempts to extract structured fields from the log using <strong>decoders</strong>.</p><p>Example raw log:</p><pre>Failed password for root from 192.168.1.20 port 22 ssh2</pre><p>Decoder output may extract fields such as:</p><pre>user=root<br>srcip=192.168.1.20<br>action=failed_login<br>service=ssh</pre><p>These extracted fields are then used during rule evaluation.</p><h3>Step 3 — Rule Evaluation</h3><p>After decoding, Wazuh evaluates rules sequentially.</p><p>A rule contains conditions such as:</p><ul><li>regex matches</li><li>field comparisons</li><li>rule dependencies</li><li>group references</li><li>list lookups</li></ul><p>Example rule:</p><pre>&lt;rule id=&quot;100001&quot; level=&quot;5&quot;&gt;<br>  &lt;if_sid&gt;5716&lt;/if_sid&gt;<br>  &lt;field name=&quot;srcip&quot;&gt;192.168.1.0/24&lt;/field&gt;<br>&lt;/rule&gt;</pre><p>This rule only triggers if:</p><ol><li>Rule <strong>5716</strong> matched earlier</li><li>The decoded field <strong>srcip</strong> matches the condition</li></ol><p>Rules that depend on other rules are extremely common in Wazuh.</p><h3>Step 4 — Parent and Child Rule Chains</h3><p>Many Wazuh detections rely on chained rule logic.</p><p>Example chain:</p><pre>Rule A → detects SSH login<br>Rule B → detects failed login<br>Rule C → detects brute force attack</pre><p>Dependency structure:</p><pre>Rule A<br> └─ Rule B (if_sid A)<br>     └─ Rule C (if_sid B)</pre><p>During event processing:</p><ol><li>Rule A is evaluated</li><li>If Rule A matches, Rule B becomes eligible</li><li>If Rule B matches, Rule C becomes eligible</li></ol><p>This chaining mechanism improves detection accuracy but also increases processing complexity.</p><p>Large dependency chains can significantly increase the number of rule evaluations per event.</p><h3>Step 5 — Rule Groups</h3><p>Wazuh rules can also belong to <strong>groups</strong>.</p><p>Example:</p><pre>&lt;group name=&quot;authentication&quot;&gt;</pre><p>Other rules may reference this group using:</p><pre>&lt;if_group&gt;authentication&lt;/if_group&gt;</pre><p>This means the rule will trigger if <strong>any rule from that group matched previously</strong>.</p><p>If the group contains a large number of rules, the dependency scope becomes much broader.</p><p>This is one of the areas where rule design mistakes can introduce unexpected processing overhead.</p><h3>Step 6 — CDB List Lookups</h3><p>Wazuh also supports <strong>CDB (Constant Database) lists</strong>.</p><p>These lists are commonly used to store:</p><ul><li>IP addresses</li><li>usernames</li><li>domains</li><li>file hashes</li><li>commands</li></ul><p>Example rule usage:</p><pre>&lt;list field=&quot;srcip&quot; lookup=&quot;match_key&quot;&gt;etc/lists/blocked_ips&lt;/list&gt;</pre><p>During evaluation, Wazuh checks whether the value extracted from the log exists in the list.</p><p>CDB lists are optimized for fast lookup, but attaching them to broad rule logic or high‑volume rules can still increase the number of evaluations performed by the analysis engine.</p><h3>The Misleading Rule Count Problem</h3><p>One of the first things administrators check is the total number of rules in the environment.</p><p>Example:</p><pre>Total rules: ~4516</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F8xyYwf2Cj0sJcOA_MjW3g.png" /><figcaption>Gui Rule Count</figcaption></figure><p>A ruleset with 4516 rules may behave very differently depending on how those rules are structured.</p><p>At first glance this appears manageable.</p><p>However, this number <strong>does not reflect runtime complexity</strong>.</p><p>The rule count does not show:</p><ul><li>rule chains</li><li>rule group relationships</li><li>list dependencies</li><li>cross‑file rule relationships</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1004/1*FFum_jN5jF2XSxfPZRkFig.png" /><figcaption>In Backend Rules Count</figcaption></figure><p>In practice, rule dependencies can create what feels like <strong>rule amplification</strong>, where a single event causes many rule evaluations internally.</p><h3>The Real Issue We Faced</h3><p>In the environment I analyzed, the GUI showed roughly <strong>5000 rules</strong>, which seemed reasonable.</p><p>However we observed:</p><ul><li>high CPU consumption from analysisd</li><li>frequent CPU spikes</li><li>delayed alert processing</li></ul><p>The root cause turned out to be rule design.</p><p>Several custom rules used a pattern like this:</p><ol><li>match a rule group</li><li>apply a CDB list</li><li>trigger additional rules</li></ol><p>The rule groups contained many rules, and the lists contained many entries.</p><p>This significantly increased the amount of work the analysis engine had to perform during event processing.</p><p>Although the rules looked simple in configuration files, their runtime impact was much larger.</p><h3>Why This Happens in Many Organizations</h3><p>In many Wazuh deployments, custom rules grow over time without a formal engineering standard.</p><p>Typical rule development looks like this:</p><ul><li>one team adds rules for a new log source</li><li>another team adds threat intelligence rules</li><li>another team creates exceptions or allowlists</li></ul><p>Over time this results in:</p><ul><li>duplicated rules</li><li>large rule groups</li><li>deep dependency chains</li><li>excessive CDB list usage</li></ul><p>Eventually the ruleset becomes difficult to maintain and begins affecting system performance.</p><h3>Investigating the Problem</h3><p>To properly understand what was happening, I built two scripts.</p><p>The goal was to analyze both:</p><ol><li><strong>ruleset complexity</strong></li><li><strong>system performance behavior</strong></li></ol><h3>Script 1 — Wazuh Rule Count Diagnostic (diagnose_wazuh_rules.sh)</h3><p>The first script analyzes what is causing high rule counts and CDB list bloat in your Wazuh environment.</p><p>It scans both:</p><pre>/var/ossec/etc/rules<br>/var/ossec/ruleset/rules</pre><p>The script identifies:</p><ul><li>current total rule count vs XML rule count</li><li>custom vs default rule breakdown</li><li>CDB lists loaded in ossec.conf with entry counts</li><li>rule count multiplication caused by large CDB lists</li><li>problematic CDB lists (&gt;1000 entries) with exact rule references</li><li>estimated memory impact of each list</li><li>unused CDB lists still loaded in configuration</li></ul><p>It also provides:</p><ul><li>severity-coded output (healthy / warning / critical)</li><li>actionable recommendations based on findings</li><li>complete per-list usage report</li></ul><p>This provides visibility into rule complexity that is normally difficult to quantify manually.</p><p>By measuring CDB list sizes and their references, engineers can quickly identify which configurations are inflating the runtime rule count and driving analysisd CPU usage.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-m0rjjoCUpTiJPx1ja1I1Q.png" /><figcaption>Output</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d8Ulk8ME6blyopgkwFlGdw.png" /><figcaption>Output</figcaption></figure><h3>Script 2–24 Hour Wazuh Performance Monitor</h3><p>The second script monitors the SIEM server over a 24‑hour period.</p><p>It collects metrics such as:</p><ul><li>CPU usage</li><li>memory usage</li><li>swap consumption</li><li>load averages</li><li>I/O wait</li><li>top CPU consuming processes</li></ul><p>When CPU usage exceeds a defined threshold, the script captures a snapshot containing:</p><ul><li>top CPU consuming processes</li><li>Wazuh processes</li><li>memory status</li><li>system load</li><li>active connections</li></ul><p>Running the monitor for 24 hours helps capture patterns that short monitoring sessions often miss.</p><p>This includes:</p><ul><li>business‑hour traffic spikes</li><li>vulnerability scans</li><li>scheduled jobs</li><li>ingestion bursts</li></ul><h3>Why These Two Scripts Work Well Together</h3><p>Each script answers a different question.</p><p>The dependency mapper answers:</p><p><strong>Where does ruleset complexity exist?</strong></p><p>The performance monitor answers:</p><p><strong>Is that complexity affecting system performance?</strong></p><p>Together they provide a structured troubleshooting workflow:</p><ol><li>Map rule dependencies</li><li>Identify high‑risk rule patterns</li><li>Monitor the system over time</li><li>correlate spikes with rule activity</li><li>optimize the ruleset</li></ol><h3>Common Rule Design Mistakes</h3><p>During analysis several patterns appeared repeatedly.</p><p>These patterns commonly lead to performance problems:</p><p><strong>1. Overusing rule groups</strong></p><p>Using if_group with large groups expands the evaluation scope.</p><p><strong>2. Deep rule chains</strong></p><p>Long parent‑child rule chains increase rule evaluations.</p><p><strong>3. Large CDB lists on high‑volume rules</strong></p><p>Attaching large lists to frequently triggered rules increases lookup operations.</p><p><strong>4. Cross‑file dependencies</strong></p><p>Rules referencing parents from different files make debugging and optimization harder.</p><p><strong>5. Duplicate detection logic</strong></p><p>Multiple rules evaluating the same condition increase unnecessary processing.</p><h3>Why analysisd CPU Spikes in Real Environments</h3><p>During troubleshooting, the component that consistently showed the highest resource usage was <strong>wazuh-analysisd</strong>. Understanding why this happens requires looking at how the analysis engine processes events.</p><p>analysisd is responsible for:</p><ul><li>decoding events</li><li>evaluating rules</li><li>tracking rule dependencies</li><li>performing list lookups</li><li>generating alerts</li></ul><p>This means <strong>every incoming log must be evaluated against the ruleset</strong>. In environments with thousands of events per second, even small inefficiencies multiply quickly.</p><p>Several specific patterns tend to cause CPU spikes:</p><p><strong>1. Large rule chains</strong></p><p>When many rules depend on each other using if_sid or if_matched_sid, the engine must repeatedly evaluate additional rules after a parent rule matches. Long chains increase evaluation depth.</p><p><strong>2. Broad </strong><strong>if_group dependencies</strong></p><p>Rules referencing large groups expand the number of candidate rules that must be evaluated for a single event.</p><p><strong>3. Heavy CDB list usage on high‑volume detections</strong></p><p>List lookups are efficient, but attaching large lists to rules triggered by very common events increases the number of lookups performed by analysisd.</p><p><strong>4. Duplicate rule logic</strong></p><p>When multiple rules evaluate similar conditions, the engine performs redundant comparisons.</p><p><strong>5. Cross‑file rule dependencies</strong></p><p>Rules referencing parents across multiple rule files increase the complexity of dependency tracking and evaluation.</p><p>When these patterns accumulate, the result is typically visible as:</p><ul><li>sustained high CPU usage from analysisd</li><li>periodic CPU spikes during ingestion bursts</li><li>delayed alert processing</li><li>event queue pressure</li></ul><p>This is why analyzing rule structure is just as important as monitoring system resources.</p><h3>Lessons Learned</h3><p>The biggest lesson from this investigation was simple:</p><p><strong>More rules do not necessarily mean better detection.</strong></p><p>A poorly designed ruleset can degrade SIEM performance even when infrastructure resources are sufficient.</p><p>Effective rule engineering requires attention to:</p><ul><li>dependency structure</li><li>evaluation cost</li><li>maintainability</li><li>scalability</li></ul><p>Detection logic must balance accuracy with processing efficiency.</p><h3>Final Thoughts</h3><p>Wazuh is an extremely capable security platform, but like any detection engine it relies on well‑designed rules.</p><p>A ruleset may look small or manageable in the dashboard while still creating heavy processing load in the backend.</p><p>If your Wazuh environment experiences:</p><ul><li>unexplained CPU spikes</li><li>delayed alerts</li><li>queue backlogs</li></ul><p>then the first place to investigate may not be infrastructure.</p><p>It may be the rules.</p><p>By analyzing rule dependencies and monitoring system behavior over time, organizations can gain visibility into how their SIEM actually operates and ensure that detection capabilities scale without sacrificing performance.</p><h3>Get the Scripts</h3><p>Both scripts used in this article are available on GitHub:</p><p><strong>https://github.com/yash22091/wazuh-diagnostics</strong></p><ul><li>diagnose_wazuh_rules.sh — Rule count and CDB list diagnostic</li><li>wazuh_monitor.sh — 24-hour performance monitor</li></ul><p>Usage instructions and workflow guidance are in the repository README.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a2c7be9670f1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From Alerts to Cases with MCP, TheHive, and Wazuh]]></title>
            <link>https://yashpateld22d.medium.com/from-alerts-to-cases-with-mcp-thehive-and-wazuh-1b618b5d8ad2?source=rss-0ab7e254ae3d------2</link>
            <guid isPermaLink="false">https://medium.com/p/1b618b5d8ad2</guid>
            <category><![CDATA[wazuh]]></category>
            <category><![CDATA[mcp-server]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[the-hive]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Yash Patel]]></dc:creator>
            <pubDate>Tue, 06 Jan 2026 15:38:11 GMT</pubDate>
            <atom:updated>2026-01-06T15:38:11.621Z</atom:updated>
            <content:encoded><![CDATA[<p>Bridge detection and response with Rust-based MCP servers for TheHive and Wazuh — promote alerts to cases, enrich investigations with host context, and keep automation safe using read-only and write-enabled phases.</p><p>Security Operations Centers (SOCs) rely on multiple platforms to do their job well: detection systems generate alerts, case management tools track investigations, and analysts continuously move context from one place to another.</p><p><strong>Model Context Protocol (MCP)</strong> provides a clean way to reduce this friction by exposing security platforms as structured, well-defined <em>tools</em> that large language models (LLMs) and agents can safely use.</p><p>In an earlier post, we explored this pattern using MISP. In this blog, we extend the <strong>same MCP design</strong> to two core SOC platforms — <strong>TheHive</strong> and <strong>Wazuh</strong> — focusing on practical, testable workflows that move <strong>from alerts to cases</strong>.</p><p>Both MCP servers are:</p><ul><li>Implemented in <strong>Rust</strong></li><li>Support <strong>multiple transport modes</strong> (e.g., stdio)</li><li>Designed with <strong>read-only and write-enabled phases</strong></li><li>Built for real SOC usage, not demos</li></ul><h3>Why TheHive and Wazuh?</h3><ul><li><strong>Wazuh</strong> focuses on <em>detection and telemetry</em>: host-based intrusion detection, file integrity monitoring, vulnerabilities, compliance, and alerting.</li><li><strong>TheHive</strong> focuses on <em>response and investigation</em>: alerts, cases, tasks, observables, timelines, and analyst collaboration.</li></ul><p>Together, they represent the core SOC loop:</p><blockquote><strong><em>Detect → Investigate → Document</em></strong></blockquote><p>By exposing both platforms through MCP, we can stitch them together without custom glue code, brittle scripts, or unsafe automation.</p><h3>What Wazuh + TheHive MCP Enables</h3><p>When both platforms are available as MCP toolsets:</p><ul><li>Analysts can <strong>pull host context from Wazuh</strong> and document it directly in TheHive</li><li>Alert-to-case workflows become <strong>consistent and repeatable</strong></li><li>Teams can start safely in <strong>read-only mode</strong> and progressively enable writes</li><li>LLMs assist investigations without bypassing platform controls</li></ul><h3>MCP Architecture Overview</h3><p>All MCP servers follow the same high-level pattern:</p><ul><li>A <strong>Rust-based MCP server</strong> exposes platform capabilities as tools</li><li>An <strong>MCP client</strong> (Claude Desktop, agent, or custom app) invokes those tools</li><li>The platform APIs remain isolated behind the MCP boundary</li></ul><pre>LLM / Agent<br>   │<br>   ▼<br>MCP Client<br>   │<br>   ▼<br>Rust MCP Server (TheHive / Wazuh)<br>   │<br>   ▼<br>Platform APIs</pre><p>This keeps automation explicit, auditable, and safe.</p><h3><strong>Downloading MCP Server Binaries</strong></h3><p>Prebuilt binaries for both MCP servers are available for Linux and Windows.</p><p><strong>TheHive MCP Server</strong></p><blockquote><strong><em>Linux</em></strong>: <a href="https://github.com/yash22091/mcp-release/releases/download/latest/mcp-server-thehive">https://github.com/yash22091/mcp-release/releases/download/latest/mcp-server-thehive</a></blockquote><blockquote><strong><em>Windows</em></strong>: <a href="https://github.com/yash22091/mcp-release/releases/download/latest/mcp-server-thehive.exe">https://github.com/yash22091/mcp-release/releases/download/latest/mcp-server-thehive.exe</a></blockquote><p><strong>Wazuh MCP Server</strong></p><blockquote><strong><em>Linux</em></strong>: <a href="https://github.com/yash22091/mcp-release/releases/download/latest/mcp-server-wazuh">https://github.com/yash22091/mcp-release/releases/download/latest/mcp-server-wazuh</a></blockquote><blockquote><strong><em>Windows</em></strong>: <a href="https://github.com/yash22091/mcp-release/releases/download/latest/mcp-server-wazuh.exe">https://github.com/yash22091/mcp-release/releases/download/latest/mcp-server-wazuh.exe</a></blockquote><p>On Linux, remember to make the binaries executable:</p><p><strong>chmod +x mcp-server-thehive mcp-server-wazuh</strong></p><h3>Read-Only vs Write-Enabled Phases</h3><p>Both MCP servers are designed to support <strong>progressive trust</strong>.</p><p><strong>Read-only phase</strong></p><ul><li>Safe exploration</li><li>Ideal for demos, testing, and screenshots</li><li>No state-changing actions</li></ul><p><strong>Write-enabled phase</strong></p><ul><li>Case creation and updates</li><li>Controlled, explicit modifications</li><li>Suitable once workflows are validated</li></ul><p>This model maps naturally to how SOC teams adopt automation.</p><h3>Example 1: Create and Promote an Alert to a Case (TheHive)</h3><p><strong>Platform:</strong> TheHive<br><strong>Phase:</strong> Write-enabled<br><strong>Goal:</strong> Create a sample alert and promote it to a case.</p><p><strong>Workflow</strong></p><ol><li>Create a new alert</li><li>Review it in the Alerts view</li><li>Promote it to a case</li><li>Verify the linked alert in the Cases dashboard</li></ol><p><strong>Tools involved</strong></p><ul><li>create_thehive_alert</li><li>promote_alert_to_case</li><li>get_thehive_cases</li></ul><p>This example demonstrates a fully deterministic alert → case workflow driven entirely through MCP while mapping cleanly to the native TheHive UI.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LOLv4xNtj8q_5AisbX9pyg.png" /><figcaption>Prompt</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u7BFXKG3jIVPQ5D5bKmFuw.png" /><figcaption>Output</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BCHIqff4IWo4wByUeN7Obw.png" /><figcaption>Alert In Thehive</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ke21P__QGidZG-86xeXJEw.png" /><figcaption>Case In TheHive</figcaption></figure><h3>Example 2: Review and Triage Alerts by Severity (TheHive)</h3><p><strong>Platform:</strong> TheHive<br><strong>Phase:</strong> Read-only<br><strong>Goal:</strong> Triage alerts without modifying state.</p><p><strong>Workflow</strong></p><ol><li>List recent alerts</li><li>Filter by severity</li><li>Identify alerts already linked to cases</li></ol><p><strong>Tools involved</strong></p><ul><li>get_thehive_alerts</li><li>search_alerts</li></ul><p>This example shows how MCP supports safe, repeatable alert triage while preserving the same mental model analysts expect from the UI.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hwhnjjqO-Bomx9Av1qB1xA.png" /><figcaption>Prompt</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NXLciJ_MO8_CJ-oBzayjNQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mMlLrEXW2qrO-hv5VDg4KA.png" /><figcaption>Output</figcaption></figure><h3>Example 3: Basic Host Context from Wazuh</h3><p><strong>Platform:</strong> Wazuh<br><strong>Phase:</strong> Read-only<br><strong>Goal:</strong> Add host-level context to an investigation.</p><p><strong>Workflow</strong></p><ol><li>List active agents</li><li>Select one agent</li><li>Fetch OS details and running processes</li></ol><p><strong>Tools involved</strong></p><ul><li>get_wazuh_agents</li><li>get_agent_os_info</li><li>get_wazuh_agent_processes</li></ul><p>This enrichment workflow is intentionally read-only and safe, making it ideal for investigation support and documentation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3J_9VXPhJxouPwJ_EYCplg.png" /><figcaption>Prompt</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nE-wVKGH0JLuM0I0LJUCng.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zup1eWMYPa5lsbGk7EXA4Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UDBZeIwBetqadxHDuDUVFw.png" /><figcaption>Output</figcaption></figure><h3>Testing with Claude (MCP Configuration)</h3><p>When testing with <strong>Claude Desktop</strong>, MCP servers are configured locally.</p><blockquote><em>Always use placeholders. Never commit real tokens or credentials.</em></blockquote><pre>{<br>  &quot;mcpServers&quot;: {<br>    &quot;thehive-testing&quot;: {<br>      &quot;command&quot;: &quot;&lt;path-to&gt;/mcp-server-thehive&quot;,<br>      &quot;args&quot;: [&quot;--transport&quot;, &quot;stdio&quot;],<br>      &quot;env&quot;: {<br>        &quot;THEHIVE_URL&quot;: &quot;https://&lt;THEHIVE_HOST&gt;/api&quot;,<br>        &quot;THEHIVE_API_TOKEN&quot;: &quot;&lt;API_TOKEN&gt;&quot;,<br>        &quot;VERIFY_SSL&quot;: &quot;false&quot;,<br>        &quot;RUST_LOG&quot;: &quot;info&quot;<br>      }<br>    },<br>    &quot;wazuh-testing&quot;: {<br>      &quot;command&quot;: &quot;&lt;path-to&gt;/mcp-server-wazuh&quot;,<br>      &quot;args&quot;: [&quot;--transport&quot;, &quot;stdio&quot;],<br>      &quot;env&quot;: {<br>        &quot;WAZUH_API_HOST&quot;: &quot;&lt;WAZUH_API_HOST&gt;&quot;,<br>        &quot;WAZUH_API_PORT&quot;: &quot;55000&quot;,<br>        &quot;WAZUH_API_USERNAME&quot;: &quot;&lt;WAZUH_API_USERNAME&gt;&quot;,<br>        &quot;WAZUH_API_PASSWORD&quot;: &quot;&lt;WAZUH_API_PASSWORD&gt;&quot;,<br>        &quot;WAZUH_INDEXER_HOST&quot;: &quot;&lt;WAZUH_INDEXER_HOST&gt;&quot;,<br>        &quot;WAZUH_INDEXER_PORT&quot;: &quot;9200&quot;,<br>        &quot;WAZUH_INDEXER_USERNAME&quot;: &quot;&lt;WAZUH_INDEXER_USERNAME&gt;&quot;,<br>        &quot;WAZUH_INDEXER_PASSWORD&quot;: &quot;&lt;WAZUH_INDEXER_PASSWORD&gt;&quot;,<br>        &quot;WAZUH_VERIFY_SSL&quot;: &quot;false&quot;,<br>        &quot;READ_ONLY&quot;: &quot;true&quot;,<br>        &quot;NO_COLOR&quot;: &quot;1&quot;,<br>        &quot;RUST_LOG_STYLE&quot;: &quot;never&quot;,<br>        &quot;RUST_LOG&quot;: &quot;info&quot;,<br>        &quot;WAZUH_ALERTS_INDEX_PATTERN&quot;: &quot;wazuh-alerts-4.x-*&quot;,<br>        &quot;WAZUH_ARCHIVES_INDEX_PATTERN&quot;: &quot;wazuh-archives-4.x-*&quot;<br>      }<br>    }<br>  }<br>}</pre><h3>Related: MCP for Threat Intelligence with MISP</h3><p>In an earlier post, we applied the same MCP design to <strong>MISP</strong> for threat-intelligence enrichment.</p><p>If you want to extend these workflows further (e.g., enrich observables in TheHive with MISP context, add intel-backed notes, or standardize enrichment steps), the MISP MCP article is the natural companion to this post.</p><h3>Key Takeaway</h3><p>TheHive and Wazuh MCP servers show that MCP is not limited to threat intelligence.</p><p>By turning SOC platforms into <strong>composable tools</strong>, MCP enables:</p><ul><li>Faster investigations</li><li>Safer experimentation via read-only mode</li><li>Cleaner alert-to-case workflows</li><li>Human-in-the-loop automation</li></ul><p><strong>MCP doesn’t replace analysts — it gives them leverage.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1b618b5d8ad2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Bringing MISP Threat Intel into Claude Desktop with an MCP Server]]></title>
            <link>https://yashpateld22d.medium.com/bringing-misp-threat-intel-into-claude-desktop-with-an-mcp-server-ecad756922b4?source=rss-0ab7e254ae3d------2</link>
            <guid isPermaLink="false">https://medium.com/p/ecad756922b4</guid>
            <category><![CDATA[claude-desktop]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[misp]]></category>
            <category><![CDATA[threat-intelligence]]></category>
            <category><![CDATA[mcp-server]]></category>
            <dc:creator><![CDATA[Yash Patel]]></dc:creator>
            <pubDate>Tue, 30 Dec 2025 18:03:35 GMT</pubDate>
            <atom:updated>2026-05-14T07:04:45.343Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*chFJDhOxWgYc6bozDfkCJw.png" /></figure><p>Most SOC work is not hard because answers do not exist.</p><p>It is hard because the answers are scattered.</p><p>An alert fires. You grab an IP. You open MISP. You search. You click into an event. You try to interpret tags, galaxies, sightings, relationships, and then decide whether the indicator is even meaningful. Finally, you write a summary for the team — after switching context five times.</p><p>I wanted something simpler.</p><p>I wanted something simpler.</p><p>So I built a <strong>MISP MCP Server in Rust</strong> that runs on Windows and Linux, supports both stdio and HTTP modes, and allows an AI client (I am testing with Claude Desktop) to query MISP through a small, well-defined set of tools.</p><p>This post is intentionally focused on <strong>MISP</strong> — what problem it solves in day-to-day SOC work, and why exposing it through MCP makes threat intelligence easier to use during triage and hunting.</p><p>No hype. No future promises. Just one platform, used better.</p><h3>What MCP Actually Changes</h3><p>MCP (Model Context Protocol) is just a way for an AI client to talk to external tools.</p><p>What matters is the workflow shift.</p><p>Instead of analysts jumping between portals, dashboards, and tabs:</p><ul><li>The client calls a tool</li><li>The tool pulls data from your system</li><li>The client focuses on summarizing, correlating, and explaining</li></ul><p>MCP does <strong>not</strong> replace your tools.</p><p>It gives your assistant controlled access to them.</p><p>If you have ever thought:</p><ul><li>“I wish this assistant could search MISP and pull full context”</li><li>“I wish it could tell me if this IOC is probably noise”</li><li>“I wish I could ask for recent ransomware indicators without clicking around”</li></ul><p>That is exactly where MCP fits.</p><h3>Why MISP Is Still Worth the Effort</h3><p>MISP is one of the best places to store and share threat intelligence — when it is used properly.</p><p>It is not just an IOC repository.</p><p>A healthy MISP instance includes:</p><ul><li>Attributes: IPs, domains, URLs, hashes, emails</li><li>Events: curated indicators with narrative context</li><li>Tags: TLP, malware family, campaign intent</li><li>Galaxies: mappings to actors and malware clusters</li><li>Sightings: evidence of real-world observation</li><li>Warninglists: known noisy or common values</li></ul><p>The problem is not MISP.</p><p>The problem is how much time it takes to extract <em>useful</em> context during triage. That is the gap this MCP server is meant to close.</p><h3>Why Connect MISP to an AI Client?</h3><p>Because searching is rarely the hard part.</p><p>The hard parts are:</p><ul><li>Pulling the right surrounding context</li><li>Deciding what actually matters</li><li>Explaining it clearly to other humans</li><li>Turning it into something shareable</li></ul><p>AI tools are good at that — <strong>if</strong> they can safely access your real data.</p><p>MCP provides a controlled way to do exactly that.</p><h3>What I Built</h3><p>The MISP MCP Server is written in Rust and supports:</p><ul><li>Windows and Linux</li><li>stdio mode for desktop clients</li><li>HTTP mode for service-style deployments</li></ul><h3>Two Modes, Two Real Use Cases</h3><p><strong>stdio mode</strong></p><p>This is what I use with Claude Desktop.</p><ul><li>The client launches the server as a local process</li><li>Communication happens over stdin/stdout</li><li>Simple, transparent, easy to test</li></ul><p><strong>HTTP mode</strong></p><ul><li>Run the same server as a local or remote service</li><li>Useful for shared SOC infrastructure</li><li>Easy to place behind internal controls</li></ul><p>Same codebase. Different deployment styles.</p><h3>The Tooling (Focused on Real Work)</h3><p>I intentionally kept the tool set practical.</p><p>This is not about exposing every MISP API endpoint. It is about covering what analysts actually do.</p><h3>Enrichment and Triage</h3><ul><li>search_misp_ioc</li><li>get_misp_event_context</li><li>get_misp_sightings</li><li>check_misp_warninglist</li><li>search_misp</li><li>get_misp_stats</li></ul><h3>Hunting and Reporting</h3><ul><li>search_misp_by_tag</li><li>get_misp_recent_iocs</li><li>get_misp_iocs_by_type</li><li>get_misp_threat_actor_iocs</li><li>get_platform_malware</li><li>advanced_search</li><li>generate_threat_report</li></ul><p>IOC submission exists, but it is deliberately gated.</p><h3>Downloading the MCP Server</h3><p>Prebuilt binaries are available, so you do not need to compile anything.</p><p><strong>Windows (exe):</strong><br><a href="https://github.com/yash22091/mcp-release/releases/download/latest/mcp-server-misp.exe">https://github.com/yash22091/mcp-release/releases/download/latest/mcp-server-misp.exe</a></p><p><strong>Linux (binary):</strong><br><a href="https://github.com/yash22091/mcp-release/releases/download/latest/mcp-server-misp">https://github.com/yash22091/mcp-release/releases/download/latest/mcp-server-misp</a></p><p>Download the appropriate binary for your system and place it in a directory you can easily reference.</p><h3>Setting Up Claude Desktop</h3><ol><li>Install <strong>Claude Desktop</strong></li><li>Open Claude Desktop and enable <strong>Developer Mode</strong></li><li>Locate your Claude config file:</li></ol><ul><li><strong>Windows:</strong> claude_desktop_config.json</li><li><strong>Linux:</strong> claude_desktop_config.json</li></ul><p>Add an MCP server entry that points to the downloaded binary.</p><p>Here is a working example (Windows) you can copy-paste and edit:</p><pre>{<br>  &quot;mcpServers&quot;: {<br>    &quot;misp-testing&quot;: {<br>      &quot;command&quot;: &quot;D:\System Profile\userprofile\Downloads\mcp-server-misp.exe&quot;,<br>      &quot;args&quot;: [&quot;--transport&quot;, &quot;stdio&quot;],<br>      &quot;env&quot;: {<br>        &quot;MISP_URL&quot;: &quot;https://IP/URL&quot;,<br>        &quot;MISP_API_KEY&quot;: &quot;API-KEY&quot;,<br>        &quot;VERIFY_SSL&quot;: &quot;true&quot;,<br>        &quot;RUST_LOG&quot;: &quot;info&quot;<br>      }<br>    }<br>  }<br>}</pre><p>Notes:</p><ul><li>Update command to the path where you downloaded the binary.</li><li>Replace MISP_URL and MISP_API_KEY with your own.</li><li>If your MISP uses an internal or self-signed certificate, you may need to set VERIFY_SSL accordingly.</li></ul><p>Restart Claude Desktop after updating the config so it loads the MCP server.</p><h3>Providing MISP Configuration</h3><p>The server needs access to your MISP instance.</p><p>The recommended approach is to use environment variables:</p><ul><li>MISP_URL</li><li>MISP_API_KEY</li><li>VERIFY_SSL</li></ul><p>This keeps credentials out of client configuration files.</p><p>Once set, restart Claude Desktop so the variables are picked up by the MCP process.</p><h3>Testing with Claude Desktop (Free, Developer Mode)</h3><p>You do not need a paid Claude plan or any special access to test this.</p><p>The MCP server can be used with <strong>Claude Desktop (free)</strong> by enabling developer mode and running the server in stdio mode.</p><h3>MCP Server Loaded in Claude Desktop</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4a1h3h4Z7CXoWHoAb0r0DQ.png" /></figure><p><em>Claude Desktop main chat view with the </em><em>misp-testing MCP connector enabled.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mEoZF-YOuXwvJwXTc1jYOw.png" /></figure><p><em>Connectors page showing </em><em>misp-testing running as a local MCP server.</em></p><h3>Tool-Level Control and Approval</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*37G0Q3LPuimRREy5KMhDjQ.png" /></figure><p><em>Each MISP capability is exposed as an individual tool with explicit approval controls.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*semKa4V5KWp9kAursrPvGg.png" /></figure><p><em>Tool permissions allow fine-grained control over when Claude can invoke each MISP tool.</em></p><h3>Verifying It Works</h3><p>After Claude launches the MCP server, you can immediately start testing workflows.</p><p>For example:</p><p>“Check this IOC in MISP: 45.133.1.10 and return related events, tags, galaxies, sightings, and warninglist status.”</p><p>Claude will call the MCP tools, receive structured responses from MISP, and summarise the results.</p><p>There is no browser automation, scraping, or manual interaction with the MISP UI. Everything happens through explicit tool calls.</p><p>If a tool returns inconsistent or unexpected data, you will see it immediately — which makes debugging and trust validation straightforward.</p><h3>Workflows You Can Actually Use</h3><p>Below are a few workflows that mirror how SOC teams work in real life. These are not demos — they are the kinds of questions analysts already ask, just without the tab-switching.</p><h3>1) Fast IOC Triage</h3><p><strong>Prompt:</strong><br>“Check this IOC in MISP: 45.133.1.10. Return match status, related events, tags, galaxies, and sightings. Also check warninglists and tell me if it might be a false positive.”</p><p><strong>Tools involved:</strong></p><ul><li>search_misp_ioc</li><li>get_misp_event_context</li><li>get_misp_sightings</li><li>check_misp_warninglist</li></ul><p>This replaces the common flow of manually searching an IOC, opening multiple events, and deciding whether the indicator is actionable or just noise.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5EaEEaGEy708JXGcNUSdVg.png" /></figure><p>Claude requesting approval before calling the MISP IOC search tool, showing the exact input payload.</p><h3>2) Domain Investigation with Context</h3><p><strong>Prompt:</strong><br>“Investigate domain example-suspicious.com using MISP. Summarise linked malware families, threat actors, and any related IPs or URLs.”</p><p><strong>Tools involved:</strong></p><ul><li>search_misp_ioc</li><li>get_misp_event_context</li></ul><p>This is useful when a domain appears in alerts but you need fast context before escalating or dismissing it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gHMURk50Di7orRzGL00uXg.png" /></figure><p>A domain investigation where MISP returns no current intelligence, avoiding false assumptions.</p><h3>3) Threat Actor Package</h3><p><strong>Prompt:</strong><br>“Pull all IOCs associated with threat actor APT29. Summarise common indicator types and the most frequent related malware families. Then generate a short report I can share internally.”</p><p><strong>Tools involved:</strong></p><ul><li>get_misp_threat_actor_iocs</li><li>generate_threat_report</li></ul><p>This is the kind of request that usually turns into manual export, copy-paste, and cleanup. Here, it stays structured and repeatable.</p><p>These workflows are intentionally simple. The value comes from reducing friction, not inventing new analyst behaviour.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qPnnR8WGJjh5QoP_D603XA.png" /></figure><h3>Security Guardrails Matter</h3><p>Connecting AI tooling to intelligence platforms needs discipline.</p><p>What works well:</p><ul><li>Read-only API keys by default</li><li>Submission disabled unless explicitly needed</li><li>Separate privileged keys for write actions</li><li>Tool usage logging without sensitive payloads</li></ul><p>Warninglists deserve special attention.</p><p>Many indicators are technically correct but operationally useless. Treating warninglist checks as first-class prevents wasted time.</p><h3>Why Rust</h3><p>Rust makes this kind of integration boring — in a good way.</p><ul><li>Single binaries</li><li>Predictable performance</li><li>One codebase for stdio and HTTP</li></ul><p>For something that might evolve into shared SOC infrastructure, boring is a feature.</p><h3>Where This Is Going Next</h3><p>This post stays deliberately focused on <strong>MISP</strong>.</p><p>Once threat intelligence becomes easier to query and reason about, the next bottleneck shows up immediately: what happens <em>after</em> the intel is understood.</p><p>That is where the rest of the series goes.</p><ul><li><strong>Part 2:</strong> Extending the same MCP pattern to <strong>TheHive and Wazuh</strong> — taking alerts, adding context, and reducing friction in case creation and investigation</li><li><strong>Part 3:</strong> A single, end-to-end use case that ties <strong>Wazuh alerts</strong>, <strong>MISP intelligence</strong>, and <strong>TheHive cases</strong> together in one realistic SOC workflow</li></ul><p>Each post builds on the previous one, but each is also meant to stand on its own.</p><p>The common theme is not AI.</p><p>It is making the tools SOC teams already run work together with less manual effort.</p><h3>Closing</h3><p>MCP is not a buzzword when applied to real SOC work.</p><p>It is simply a controlled way to let existing systems talk to each other, with clear boundaries and predictable behaviour.</p><p>If you already run MISP, this is a practical first step toward reducing triage friction and making threat intelligence easier to use when it actually matters.</p><p>Start read-only. Keep control. Let value prove itself before scaling.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ecad756922b4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Monitoring Keycloak Events in Wazuh — A Complete, Working Integration Guide]]></title>
            <link>https://yashpateld22d.medium.com/monitoring-keycloak-events-in-wazuh-a-complete-working-integration-guide-a669817dc018?source=rss-0ab7e254ae3d------2</link>
            <guid isPermaLink="false">https://medium.com/p/a669817dc018</guid>
            <category><![CDATA[monitoring]]></category>
            <category><![CDATA[keycloak]]></category>
            <category><![CDATA[integration]]></category>
            <category><![CDATA[wazuh]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Yash Patel]]></dc:creator>
            <pubDate>Tue, 18 Nov 2025 16:56:27 GMT</pubDate>
            <atom:updated>2025-11-18T16:56:27.012Z</atom:updated>
            <content:encoded><![CDATA[<h3>Monitoring Keycloak Events in Wazuh — A Complete, Working Integration Guide</h3><p>Integrating <strong>Keycloak</strong> with <strong>Wazuh</strong> transforms how identity and access management events are monitored. This integration not only provides visibility into authentication and administrative activity but also strengthens your organization’s security posture through real-time alerting, auditing, and compliance tracking.</p><h3>Why Integrate Keycloak with Wazuh?</h3><p>Modern enterprises rely on Keycloak for user authentication, authorization, and federation. But out-of-the-box, Keycloak doesn’t provide centralized security analytics. Integrating it with <strong>Wazuh SIEM</strong> offers:</p><ul><li><strong>Centralized event monitoring:</strong> All Keycloak authentication and admin logs in one place.</li><li><strong>Real-time detection:</strong> Catch failed logins, user creation, or configuration changes immediately.</li><li><strong>Audit &amp; compliance:</strong> Meet ISO, SOC2, and GDPR auditing needs by logging identity-related changes.</li><li><strong>Behavioral insight:</strong> Visualize usage patterns, login times, and user distribution.</li></ul><p>This integration bridges identity security with operational observability.</p><h3>Prerequisites</h3><p>Before you begin, ensure you have:</p><ul><li><strong>Wazuh Manager</strong> running and configured to receive logs (TCP port 514 open)</li><li><strong>Docker</strong> installed to run Keycloak</li><li><strong>Keycloak Admin CLI (</strong><strong>kcadm.sh)</strong> available for configuring event listeners</li><li>Proper network connectivity between the Keycloak container and Wazuh</li></ul><blockquote><em>Start the Wazuh syslog listener </em><strong><em>before</em></strong><em> running the Keycloak container, or Keycloak will fail to send logs.</em></blockquote><h3>Step 0 — Configure Wazuh Manager to Receive Syslog (Listener)</h3><p>On the <strong>Wazuh manager</strong>, add a remote syslog listener so it can accept Keycloak logs. Edit /var/ossec/etc/ossec.conf and add this block (adjust the IP to the <strong>host where the Keycloak Docker</strong> is running):</p><pre>&lt;remote&gt;<br>  &lt;connection&gt;syslog&lt;/connection&gt;<br>  &lt;port&gt;514&lt;/port&gt;<br>  &lt;protocol&gt;tcp&lt;/protocol&gt;<br>  &lt;allowed-ips&gt;&lt;KEYCLOAK_HOST_IP&gt;&lt;/allowed-ips&gt;<br>&lt;/remote&gt;</pre><blockquote><em>Replace </em><em>&lt;KEYCLOAK_HOST_IP&gt; with the IP of the machine that runs the Keycloak container. Keep TCP/514 open on the Wazuh manager.</em></blockquote><p>Restart Wazuh to apply:</p><pre>sudo systemctl restart wazuh-manager</pre><h3>Quick wire check (packets arriving?)</h3><p>From the Wazuh manager, you can verify traffic is reaching port 514 before/while Keycloak is running:</p><pre>sudo tcpdump -i any -nn src &lt;KEYCLOAK_HOST_IP&gt; and tcp port 514 -vvv</pre><blockquote><em>You should see TCP packets flowing from </em><em>&lt;KEYCLOAK_HOST_IP&gt; to the Wazuh manager on port 514 once Keycloak starts.</em></blockquote><h3>Step 1 — Run Keycloak with Syslog Forwarding</h3><p>This step configures Keycloak to send logs to Wazuh over TCP Syslog in JSON ECS format.</p><pre>docker run --name keycloak --rm -p 8080:8080 \<br>  -e KEYCLOAK_ADMIN=admin \<br>  -e KEYCLOAK_ADMIN_PASSWORD=admin \<br>  -e KC_FEATURES=log-mdc \<br>  -e KC_LOG=syslog \<br>  -e KC_LOG_SYSLOG_ENDPOINT=&lt;WAZUH_IP&gt;:514 \<br>  -e KC_LOG_SYSLOG_PROTOCOL=tcp \<br>  -e KC_LOG_SYSLOG_TYPE=rfc5424 \<br>  -e KC_LOG_SYSLOG_OUTPUT=json \<br>  -e KC_LOG_SYSLOG_JSON_FORMAT=ecs \<br>  -e KC_LOG_MDC_ENABLED=true \<br>  -e KC_LOG_MDC_KEYS=realmName,clientId,userId,ipAddress,org,sessionId,authenticationSessionId,authenticationTabId \<br>  -e KC_LOG_LEVEL=info \<br>  -e KC_SPI_EVENTS_LISTENER_JBOSS_LOGGING_SUCCESS_LEVEL=info \<br>  -e KC_SPI_EVENTS_LISTENER_JBOSS_LOGGING_ERROR_LEVEL=warn \<br>  quay.io/keycloak/keycloak:26.4.2 start-dev --http-enabled=true --proxy-headers=xforwarded</pre><p><strong>Explanation:</strong></p><ul><li>Uses <strong>RFC5424 TCP Syslog</strong> protocol for reliable delivery.</li><li>Log format: <strong>JSON ECS</strong>, easy for Wazuh to parse.</li><li>MDC keys (realmName, userId, ipAddress, etc.) enrich event context.</li></ul><h3>Step 2 — Authenticate to Keycloak CLI</h3><p>Connect to the Keycloak admin interface with your credentials:</p><pre>./kcadm.sh config credentials \<br>  --server http://&lt;KEYCLOAK_HOST_IP&gt;:8080 \<br>  --realm master \<br>  --user admin \<br>  --password &#39;admin&#39;</pre><p>Once logged in, you’ll use this CLI session to enable event generation.</p><h3>Step 3 — Enable Event Logging for All Realms</h3><p>Enable user and admin events globally:</p><pre>./kcadm.sh get realms --fields realm --format csv \<br>| sed &#39;1{/^&quot;realm&quot;$/d;}&#39; \<br>| tr -d &#39;&quot;&#39; \<br>| tr -d &#39;\r&#39; \<br>| sed &#39;/^[[:space:]]*$/d&#39; \<br>| while IFS= read -r r; do<br>    echo &quot;Configuring realm: $r&quot;<br>    ./kcadm.sh update events/config -r &quot;$r&quot; \<br>      -s &#39;eventsEnabled=true&#39; \<br>      -s &#39;adminEventsEnabled=true&#39; \<br>      -s &#39;adminEventsDetailsEnabled=true&#39; \<br>      -s &#39;eventsListeners=[&quot;jboss-logging&quot;]&#39;<br>  done</pre><p>This ensures <strong>all realms emit events</strong> like user logins, logouts, and admin actions to syslog.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TitBQHMCVKDQGDphYT4dSA.png" /><figcaption>Before Enabling</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oCXdU4XVYWa68xZnBbKbRg.png" /><figcaption>After Enabling</figcaption></figure><h3>Step 4 — Create Decoder in Wazuh</h3><p>The decoder translates Keycloak JSON logs into structured data that Wazuh can understand.</p><blockquote><em>File: </em><em>/var/ossec/etc/decoders/keycloak.xml</em></blockquote><pre>&lt;decoder name=&quot;keycloak&quot;&gt;<br>    &lt;prematch&gt;org.keycloak.events - &lt;/prematch&gt;<br>    &lt;plugin_decoder offset=&quot;after_prematch&quot;&gt;JSON_Decoder&lt;/plugin_decoder&gt;<br>&lt;/decoder&gt;</pre><p>This decoder isolates Keycloak events (matching org.keycloak.events) and hands them to Wazuh’s built-in JSON parser.</p><h3>Step 5 — Create Wazuh Rules for Keycloak</h3><p>Rules assign meaning and severity to specific types of Keycloak actions.</p><blockquote><em>File: </em><em>/var/ossec/etc/rules/keycloak.xml</em></blockquote><pre>&lt;group name=&quot;keycloak&quot;&gt;<br>  &lt;rule id=&quot;100500&quot; level=&quot;3&quot;&gt;<br>    &lt;description&gt;Keycloak Event in Realm $(mdc.kc.realmName)&lt;/description&gt;<br>    &lt;field name=&quot;mdc.kc.realmName&quot;&gt;master|testing&lt;/field&gt;<br>    &lt;options&gt;no_full_log&lt;/options&gt;<br>  &lt;/rule&gt;<br><br>&lt;rule id=&quot;100501&quot; level=&quot;4&quot;&gt;<br>    &lt;if_sid&gt;100500&lt;/if_sid&gt;<br>    &lt;field name=&quot;message&quot;&gt;^operationType=&quot;CREATE&quot;&lt;/field&gt;<br>    &lt;description&gt;Keycloak Create Event in Realm $(mdc.kc.realmName)&lt;/description&gt;<br>  &lt;/rule&gt;<br><br>  &lt;rule id=&quot;100502&quot; level=&quot;4&quot;&gt;<br>    &lt;if_sid&gt;100500&lt;/if_sid&gt;<br>    &lt;field name=&quot;message&quot;&gt;^operationType=&quot;UPDATE&quot;&lt;/field&gt;<br>    &lt;description&gt;Keycloak Update Event in Realm $(mdc.kc.realmName)&lt;/description&gt;<br>  &lt;/rule&gt;<br><br>  &lt;rule id=&quot;100503&quot; level=&quot;4&quot;&gt;<br>    &lt;if_sid&gt;100500&lt;/if_sid&gt;<br>    &lt;field name=&quot;message&quot;&gt;^operationType=&quot;DELETE&quot;&lt;/field&gt;<br>    &lt;description&gt;Keycloak Delete Event in Realm $(mdc.kc.realmName)&lt;/description&gt;<br>  &lt;/rule&gt;<br><br>  &lt;rule id=&quot;100504&quot; level=&quot;4&quot;&gt;<br>    &lt;if_sid&gt;100500&lt;/if_sid&gt;<br>    &lt;field name=&quot;message&quot;&gt;^operationType=&quot;ACTION&quot;&lt;/field&gt;<br>    &lt;description&gt;Keycloak Action Event in Realm $(mdc.kc.realmName)&lt;/description&gt;<br>  &lt;/rule&gt;<br><br>  &lt;rule id=&quot;100505&quot; level=&quot;4&quot;&gt;<br>    &lt;if_sid&gt;100500&lt;/if_sid&gt;<br>    &lt;field name=&quot;message&quot;&gt;^type=&quot;LOGIN&quot;&lt;/field&gt;<br>    &lt;description&gt;Keycloak Login Event in Realm $(mdc.kc.realmName)&lt;/description&gt;<br>  &lt;/rule&gt;<br><br>  &lt;rule id=&quot;100506&quot; level=&quot;4&quot;&gt;<br>    &lt;if_sid&gt;100500&lt;/if_sid&gt;<br>    &lt;field name=&quot;message&quot;&gt;^type=&quot;LOGOUT&quot;&lt;/field&gt;<br>    &lt;description&gt;Keycloak Logout Event in Realm $(mdc.kc.realmName)&lt;/description&gt;<br>  &lt;/rule&gt;<br><br>&lt;/group&gt;</pre><p>Restart the Wazuh manager to load new configurations:</p><pre>sudo systemctl restart wazuh-manager</pre><h3>Step 6 — Build Dashboards in Wazuh</h3><p>Once logs start arriving, go to <strong>Wazuh Dashboards → Discover</strong> and apply filters:</p><ul><li>Query: message: &quot;org.keycloak.events -&quot;</li><li>Fields: mdc.kc.realmName, mdc.kc.userId, operationType, type</li></ul><p>Create visualizations:</p><ul><li><strong>Pie chart:</strong> Login/Logout events per realm</li><li><strong>Bar graph:</strong> Operation types (CREATE/UPDATE/DELETE)</li><li><strong>Table:</strong> Top users by event count</li></ul><p>You can save these visualizations and combine them into a <strong>Keycloak Security Dashboard</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0hqjiS-IyXl_cE5vBtWArw.png" /><figcaption>Keycloak Events Dashboard</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EIAvSdlS9YsbmD3te2S0DQ.png" /><figcaption>Keycloak Events Dashboard</figcaption></figure><h3>Enable Archives in Wazuh (optional but helpful)</h3><p>If you want to keep a raw copy of all decoded events for deeper forensics, enable archives. On the Wazuh manager, in /var/ossec/etc/ossec.conf under the &lt;global&gt; section, set:</p><pre>&lt;global&gt;<br>  ...<br>  &lt;logall&gt;yes&lt;/logall&gt;<br>  &lt;logall_json&gt;yes&lt;/logall_json&gt;<br>  ...<br>&lt;/global&gt;</pre><p>Restart the manager to apply:</p><pre>sudo systemctl restart wazuh-manager</pre><p>Archived events will appear in:</p><pre>/var/ossec/logs/archives/</pre><p>You can live‑view new entries as they arrive:</p><pre>sudo tail -f /var/ossec/logs/archives/archives.json</pre><h3>Troubleshooting Tips</h3><pre>| Issue               | Cause                   | Fix                                                            |<br>|---------------------|-------------------------|----------------------------------------------------------------|<br>| No events in Wazuh  | Syslog connection issue | Verify TCP/514 open, check Keycloak logs for syslog errors     |<br>| JSON parse errors   | Decoder misconfig       | Confirm `prematch` string matches actual Keycloak event prefix |<br>| Missing realm info  | MDC keys not enabled    | Check Keycloak env var `KC_LOG_MDC_ENABLED=true`               |</pre><h3>Validation</h3><p>Run test logins or user updates in Keycloak and confirm corresponding events appear under <strong>Security Events</strong> in Wazuh with rule IDs 10050x.</p><h3>Benefits Recap</h3><ul><li><strong>Faster threat detection:</strong> Detect privilege escalation, failed logins, and brute-force attacks in real-time.</li><li><strong>Unified view:</strong> Aggregate Keycloak activity across all realms and tenants.</li><li><strong>Better forensics:</strong> Trace any action to a specific user, client, or IP.</li><li><strong>Compliance ready:</strong> Maintain verifiable identity audit trails.</li></ul><h3>Conclusion</h3><p>Integrating Keycloak with Wazuh transforms identity data into actionable intelligence. Every login, update, or admin action becomes a security event you can correlate and alert on. The configuration above uses <strong>only verified, tested steps</strong>, requiring minimal customization.</p><blockquote><em>With this setup, you turn Keycloak’s authentication insights into real-time, auditable security visibility in Wazuh — ensuring stronger identity governance and compliance across your infrastructure.</em></blockquote><blockquote><strong><em>About the Author</em></strong><em><br> </em><a href="https://wazuh.com/?utm_source=ambassadors&amp;utm_medium=referral&amp;utm_campaign=ambassadors+program"><em>I’m a Wazuh Ambassador passionate about open-source security, SIEM engineering, and community knowledge sharing.</em></a></blockquote><blockquote><em>Want to learn more or get involved?<br> </em><a href="https://wazuh.com/ambassadors-program/?utm_source=ambassadors&amp;utm_medium=referral&amp;utm_campaign=ambassadors+program"><em>Explore the Wazuh Ambassadors Program — join a global network of cybersecurity professionals contributing to open-source innovation.</em></a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a669817dc018" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OpenCTI SSO with Keycloak (OIDC): The Complete Setup Guide]]></title>
            <link>https://yashpateld22d.medium.com/opencti-sso-with-keycloak-oidc-the-complete-setup-guide-7e66496406cb?source=rss-0ab7e254ae3d------2</link>
            <guid isPermaLink="false">https://medium.com/p/7e66496406cb</guid>
            <category><![CDATA[single-sign-on]]></category>
            <category><![CDATA[opencti-sso]]></category>
            <category><![CDATA[openid-connect]]></category>
            <category><![CDATA[opencti-keycloak]]></category>
            <category><![CDATA[opencti-authentication]]></category>
            <dc:creator><![CDATA[Yash Patel]]></dc:creator>
            <pubDate>Fri, 31 Oct 2025 16:56:51 GMT</pubDate>
            <atom:updated>2025-10-31T16:56:51.528Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Keywords:</strong> OpenCTI SSO, Keycloak OIDC, OpenID Connect, Cyber Threat Intelligence, Identity Management, Single Sign-On, OpenCTI Authentication, OpenCTI Keycloak Integration</p><h3>Introduction to OpenCTI</h3><p>OpenCTI (Open Cyber Threat Intelligence Platform) is an open-source intelligence management platform that empowers organizations to <strong>centralize, analyze, and share cyber threat intelligence (CTI)</strong>. It provides analysts and SOC teams with a structured approach to tracking adversaries, incidents, and vulnerabilities.</p><p>However, as organizations scale, managing multiple user accounts across security tools becomes cumbersome. Integrating OpenCTI with an identity provider such as <strong>Keycloak</strong> allows you to implement <strong>Single Sign-On (SSO)</strong> using <strong>OpenID Connect (OIDC)</strong> — making authentication seamless, secure, and centralized.</p><h3>Why Enable SSO in OpenCTI</h3><p>Integrating SSO with OpenCTI provides a range of advantages for both administrators and users:</p><h3>Security</h3><ul><li>Centralized authentication ensures consistent enforcement of MFA and password policies.</li><li>Reduces risks from weak or reused credentials.</li></ul><h3>Efficiency</h3><ul><li>Users authenticate once and gain access across multiple platforms.</li><li>Simplifies user provisioning and deprovisioning via Keycloak.</li></ul><h3>Compliance &amp; Auditing</h3><ul><li>Unified identity management supports better access control and traceability.</li><li>Streamlined audit trails simplify compliance with frameworks such as ISO 27001, SOC 2, or NIST.</li></ul><p>In essence, SSO integration with Keycloak enhances both <strong>security</strong> and <strong>usability</strong> of OpenCTI.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dyUHJemZuWZh-BpzjTsDUQ.png" /><figcaption>Default Login</figcaption></figure><h3>Prerequisites</h3><p>Before diving into configuration, ensure you have:</p><ul><li>A <strong>working OpenCTI instance</strong> (via Docker Compose).</li><li>A <strong>Keycloak server</strong> (self-hosted or external) with admin access.</li><li>Valid <strong>domain URLs</strong> for both OpenCTI and Keycloak.</li><li>Network connectivity between the two environments.</li></ul><blockquote><strong><em>Tip:</em></strong><em> Use HTTPS in production to secure token exchanges and callbacks.</em></blockquote><h3>Step 1: Configure OIDC Variables in .env</h3><p>Add the following lines to your OpenCTI .env file to enable OpenID Connect integration:</p><pre># OIDC Configuration<br>OIDC_ISSUER=&lt;YOUR_KEYCLOAK_REALM_URL&gt;<br>OIDC_CLIENT_ID=&lt;YOUR_CLIENT_ID&gt;<br>OIDC_CLIENT_SECRET=&lt;YOUR_CLIENT_SECRET&gt;</pre><h3>Important Notes</h3><ul><li>OIDC_ISSUER must point to your Keycloak realm, e.g.:</li></ul><pre>https://your-keycloak-domain/realms/&lt;realm-name&gt;</pre><ul><li>Replace CLIENT_ID and CLIENT_SECRET with credentials generated from Keycloak.</li><li>Do not use placeholder demo URLs — if the realm URL or callback path is invalid, the SSO button <strong>won’t appear</strong> in OpenCTI.</li></ul><h3>Step 2: Update the Docker Compose Configuration</h3><p>Modify the <strong>opencti</strong> service in docker-compose.yml by adding the following environment variables:</p><pre>- PROVIDERS__LOCAL__STRATEGY=LocalStrategy<br>- PROVIDERS__OPENID__STRATEGY=OpenIDConnectStrategy<br>- PROVIDERS__OPENID__CONFIG__LABEL=Login with OpenID<br>- PROVIDERS__OPENID__CONFIG__ISSUER=${OIDC_ISSUER}<br>- PROVIDERS__OPENID__CONFIG__CLIENT_ID=${OIDC_CLIENT_ID}<br>- PROVIDERS__OPENID__CONFIG__CLIENT_SECRET=${OIDC_CLIENT_SECRET}<br>- PROVIDERS__OPENID__CONFIG__REDIRECT_URIS=[&quot;&lt;YOUR_OPENCTI_URL&gt;/auth/oic/callback&quot;]<br><br><br># OIDC Parameters<br>- PROVIDERS__OPENID__CONFIG__PARAMS__RESPONSE_TYPE=code<br>- PROVIDERS__OPENID__CONFIG__PARAMS__SCOPE=&quot;openid&quot;<br>- PROVIDERS__OPENID__CONFIG__PARAMS__PROMPT=login<br><br><br># Userinfo and Claims<br>- PROVIDERS__OPENID__CONFIG__USE_USERINFO=true<br><br><br># Group Mapping<br>- PROVIDERS__OPENID__CONFIG__GROUPS_MANAGEMENT__GROUPS_SCOPE=groups<br>- PROVIDERS__OPENID__CONFIG__GROUPS_MANAGEMENT__GROUPS_PATH=[&quot;groups&quot;,&quot;realm_access.roles&quot;,&quot;resource_access.account.roles&quot;]</pre><pre>docker compose up -d --force-recreate --no-deps opencti</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xbWp1qNXTcRnByT_NkooBQ.png" /><figcaption>Login Page With Openid Button</figcaption></figure><h3>Step 3: Configure the Keycloak Client</h3><p><strong>Create a new client:</strong></p><ul><li>Navigate to <strong>Clients → Create</strong>.</li><li>Enter opencti as the Client ID.</li><li>Select <strong>Confidential</strong> as the client type.</li></ul><p><strong>Enable Authorization Code Flow:</strong></p><ul><li>Turn ON <em>Standard Flow</em>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PthrSVv06hflX0CTe3GteQ.png" /><figcaption>Client Create</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EW_Z9mJmIiJZF52bVHiZOA.png" /><figcaption>Details</figcaption></figure><p><strong>Configure Redirect URI and Web Origins:</strong></p><ul><li>Redirect URI: &lt;YOUR_OPENCTI_URL&gt;/auth/oic/callback</li><li>Web Origins: *</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qsljOqo_m9ancg6neiQ9cQ.png" /></figure><p><strong>Set Credentials:</strong></p><ul><li>Retrieve the <strong>Client Secret</strong> under <em>Credentials</em>.</li></ul><p><strong>Add Default Client Scopes:</strong></p><ul><li>Ensure email and profile are attached as <em>Default Scopes</em>.</li></ul><h3>Step 4: Add the groups Client Scope</h3><p>If you skip this step, you might encounter <strong>invalid_scope</strong> or missing claims errors. To fix this:</p><p>Go to <strong>Realm → Client Scopes → Create</strong>.</p><p>Name it groups and select the <strong>OpenID Connect</strong> protocol.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Tqg_xByadpg9Y9-kclPFPw.png" /><figcaption>Client Scope</figcaption></figure><p>Under <strong>Mappers</strong>, create a <strong>Group Membership</strong> mapper:</p><ul><li><strong>Token Claim Name:</strong> groups</li><li><strong>Add to ID Token:</strong> ON</li><li><strong>Add to Access Token:</strong> ON</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ejpO_qyMfltxrQjxGfI9qA.png" /><figcaption>Add Mapper</figcaption></figure><p>Attach the new scope to the opencti client under <em>Client Scopes</em> → <em>Add client scope</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*paJgfZjmKTkfPWxj_jT_uw.png" /><figcaption>Attach Scope</figcaption></figure><h3>Step 5: Test the Integration</h3><ol><li>Open your OpenCTI login page in <strong>Incognito Mode</strong>.</li><li>You should now see a <strong>“Login with OpenID”</strong> button.</li><li>Click it — you’ll be redirected to the Keycloak login page.</li><li>Upon successful authentication, you’ll return to OpenCTI logged in as your Keycloak user.</li></ol><p>If you don’t see the SSO button, double-check:</p><ul><li>The issuer URL is correct.</li><li>The redirect URI matches exactly between OpenCTI and Keycloak.</li><li>The Keycloak client uses the <strong>Standard Flow</strong>.</li></ul><h3>Troubleshooting Common Issues</h3><h3>No SSO Button</h3><ul><li>Ensure your .env has the <strong>correct Keycloak realm URL</strong>.</li><li>Restart the OpenCTI backend container after any configuration change.</li></ul><h3>Invalid Scope Error</h3><ul><li>Confirm that the groups client scope exists and is attached properly.</li></ul><h3>Groups Missing from Token</h3><ul><li>Check Keycloak token contents using <a href="https://jwt.io/">jwt.io</a> to verify the groups claim.</li><li>Adjust GROUPS_PATH in your Docker configuration if your claim structure differs.</li></ul><h3>Logout Doesn’t Clear SSO Session</h3><ul><li>OpenCTI’s logout only clears the local session. Configure RP-Initiated Logout in Keycloak if you want global session termination.</li></ul><h3>Conclusion</h3><p>Implementing <strong>SSO with OpenCTI and Keycloak</strong> strengthens your organization’s authentication framework while streamlining user management. With OIDC integration, you can centralize login, enforce uniform access policies, and improve the user experience.</p><p>Follow these steps carefully — and once configured, your OpenCTI platform will be ready for enterprise-grade, secure, and scalable identity management.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7e66496406cb" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>