<?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"><channel><title><![CDATA[Ops & Architecture Nexus]]></title><description><![CDATA[Ops & Architecture Nexus]]></description><link>https://yvesstan.space</link><generator>RSS for Node</generator><lastBuildDate>Tue, 01 Dec 2026 23:11:52 GMT</lastBuildDate><atom:link href="https://yvesstan.space/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[From Zero to SOC: Deploying a Production-Ready Security Operations Center on Real Infrastructure]]></title><description><![CDATA[A step-by-step guide to deploying pfSense, Wazuh, TheHive, Cortex, MISP and Shuffle on Proxmox — with every screenshot along the way]]></description><link>https://yvesstan.space/from-zero-to-soc</link><guid isPermaLink="true">https://yvesstan.space/from-zero-to-soc</guid><category><![CDATA[cybersecurity]]></category><category><![CDATA[Security]]></category><category><![CDATA[wazuh]]></category><category><![CDATA[Open Source]]></category><category><![CDATA[Homelab]]></category><dc:creator><![CDATA[Yves Stanislas ADANI]]></dc:creator><pubDate>Tue, 01 Dec 2026 00:22:09 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/67942ac47266728f8823d95c/b6dd4895-1922-42f3-80d6-3a89a2d6c80f.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2>Table of Contents</h2>
<p><strong>Part 1 — Architecture</strong></p>
<ol>
<li>Introduction</li>
<li>High-Level Design (HLD)</li>
<li>Low-Level Design (LLD)</li>
<li>Lab Inventory and Deployment Architecture</li>
</ol>
<p><strong>Part 2 — Deployment</strong></p>
<ol start="5">
<li>Deploying and configuring the pfSense firewall</li>
<li>Installing the server that hosts the SOC components</li>
<li>Installing the SOC components</li>
<li>Configuring and using TheHive (ticketing system)</li>
<li>Integrations and automation</li>
<li>Installing the Shuffle SOAR</li>
</ol>
<p><strong>Part 3 — Use Cases in Action</strong></p>
<ol start="11">
<li>SOC use case demonstrations</li>
<li>Conclusion</li>
</ol>
<hr />
<h1>Part 1 — Architecture</h1>
<h2>1. Introduction</h2>
<p>This guide walks you through building a complete, operational SOC (Security Operations Center) on real infrastructure, end to end: from the architecture design, to the deployment of every component, to real attack scenarios that prove the SOC actually detects and responds.</p>
<p>The SOC is built entirely on open-source tools:</p>
<ul>
<li><strong>pfSense</strong>: firewall, router and DHCP server</li>
<li><strong>Proxmox</strong>: hypervisor hosting all the virtual machines</li>
<li><strong>Wazuh</strong>: SIEM, the core of the SOC</li>
<li><strong>TheHive</strong>: incident and case management (ticketing)</li>
<li><strong>Cortex</strong>: automated analysis of observables</li>
<li><strong>MISP</strong>: threat intelligence sharing platform</li>
<li><strong>Shuffle</strong>: SOAR, for automated response playbooks</li>
</ul>
<p>The goal is proactive monitoring, automation of critical tasks, and fast incident handling. Every step comes with a screenshot so you can follow along in your own lab.</p>
<h2>2. High-Level Design (HLD)</h2>
<p>This architecture describes how threats are detected, analyzed and answered in our external SOC.</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/hld-01-v2.jpg" alt="High-level architecture of the external SOC" style="display:block;margin:0 auto" />

<h3>2.1. Components and their roles</h3>
<p><strong>1. Windows 10 client with the Wazuh agent</strong></p>
<p><em>Role:</em> the Windows 10 endpoint runs the Wazuh agent, which collects security events (logs, system alerts). The agent watches system activity, detects anomalies and sends the data to the Wazuh server.</p>
<p><em>Capabilities:</em></p>
<ul>
<li>Real-time monitoring of local events</li>
<li>Attack detection (intrusions, changes to sensitive files)</li>
<li>Forwarding of collected data to the central server for analysis</li>
</ul>
<p><strong>2. Wazuh server</strong></p>
<p><em>Role:</em> the Wazuh server centralizes the data sent by the agents installed on the endpoints, and analyzes it to spot suspicious or malicious behavior.</p>
<p><em>Capabilities:</em></p>
<ul>
<li>Agent management (endpoint monitoring)</li>
<li>Log analysis and alert generation</li>
<li>Forwarding of critical alerts to the orchestrator (Shuffle)</li>
</ul>
<p><strong>3. Shuffle (automation orchestrator)</strong></p>
<p><em>Role:</em> Shuffle automates security workflows and orchestrates the different stages of incident handling.</p>
<p><em>Capabilities:</em></p>
<ul>
<li>Receives and processes alerts from the Wazuh server</li>
<li>Enriches alerts with IOCs (indicators of compromise) using tools such as MISP or Cortex</li>
<li>Sends enriched alerts to TheHive for centralized management</li>
<li>Sends email notifications to the SOC team for critical alerts</li>
</ul>
<p><strong>4. TheHive (incident management)</strong></p>
<p><em>Role:</em> TheHive is the platform used to centralize, track and resolve security alerts.</p>
<p><em>Capabilities:</em></p>
<ul>
<li>Ingests enriched alerts coming from Shuffle</li>
<li>Assigns tasks to SOC analysts</li>
<li>Enables collaboration between SOC team members for a fast response</li>
<li>Communicates both ways with Cortex for additional analysis</li>
</ul>
<p><strong>5. MISP (threat intelligence sharing)</strong></p>
<p><em>Role:</em> MISP is a threat intelligence sharing platform. It enriches alerts with a collaborative database of indicators of compromise (malicious IPs, file hashes, suspicious domains).</p>
<p><em>Capabilities:</em></p>
<ul>
<li>Provides relevant IOCs to enrich alerts</li>
<li>Improves detection with global threat intelligence</li>
</ul>
<p><strong>6. Cortex (automated analysis)</strong></p>
<p><em>Role:</em> Cortex runs analysis tools (analyzers) on IOCs to produce actionable information.</p>
<p><em>Capabilities:</em></p>
<ul>
<li>In-depth lookups on suspicious domains, IP addresses or files</li>
<li>Sends results straight back to TheHive to support decision-making</li>
</ul>
<p><strong>7. SOC analyst</strong></p>
<p><em>Role:</em> the SOC analyst interprets alerts, manages incidents and applies remediation.</p>
<p><em>Responsibilities:</em></p>
<ul>
<li>Monitor the alerts generated by Wazuh and enriched in TheHive</li>
<li>Respond to incidents, through automated or manual response actions</li>
<li>Work with the analysis and management tools to keep the network secure</li>
</ul>
<p><strong>8. Router / firewall (active response)</strong></p>
<p><em>Role:</em> the network infrastructure used to apply incident responses, for example blocking a malicious IP or isolating an endpoint.</p>
<p><em>Capabilities:</em></p>
<ul>
<li>Connects all the components of the architecture</li>
<li>Allows corrective actions to be executed directly on the endpoints</li>
</ul>
<h3>2.2. How it all works together</h3>
<ol>
<li><strong>Event collection:</strong> Wazuh agents on the endpoints collect logs and send them to the Wazuh server for centralized analysis.</li>
<li><strong>Detection and alerting:</strong> the Wazuh server analyzes the data, detects suspicious behavior and raises alerts when a threat is found.</li>
<li><strong>Orchestration and enrichment:</strong> alerts are sent to Shuffle, which enriches them with IOCs from MISP and Cortex, notifies the SOC team by email, and forwards the enriched alerts to TheHive.</li>
<li><strong>Incident management and analysis:</strong> enriched alerts are centralized in TheHive and assigned to an analyst, who uses Cortex for further analysis and takes corrective action.</li>
<li><strong>Incident response:</strong> responses can include blocking a malicious IP, isolating an endpoint, or other actions executed through the router, the firewall, an EDR or Wazuh itself.</li>
</ol>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/hld-02.png" alt="SOC workflow: from the Wazuh agent to TheHive and email notifications" style="display:block;margin:0 auto" />

<p>In short, this architecture relies on smooth integration between collection, analysis, management and orchestration tools. Automation with Shuffle and enrichment with MISP and Cortex cut response times, while collaboration between the tools and the analysts keeps threat handling effective.</p>
<h2>3. Low-Level Design (LLD)</h2>
<p>The LLD describes how the components talk to each other: which protocols, which ports, and in which direction the data flows.</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/lld-01.jpg" alt="Low-level design: communication between the SOC components" style="display:block;margin:0 auto" />

<blockquote>
<p><strong>Note:</strong> the reference design below uses <strong>OPNsense with Zenarmor</strong> as the next-generation firewall and <strong>Suricata</strong> as the IDS/IPS. In the lab deployed in Part 2, the firewall role is played by <strong>pfSense</strong> (with Snort/Suricata as IDS/IPS). The communication flows are the same: firewall and IDS logs go to Wazuh over Syslog.</p>
</blockquote>
<h3>3.1. Communication details</h3>
<p><strong>1. Wazuh (SIEM)</strong></p>
<p><em>Log collection:</em></p>
<ul>
<li><strong>Agents:</strong> installed on endpoints, servers and network devices; they send their logs to the Wazuh manager.</li>
<li><strong>API integration:</strong> Wazuh exchanges data with TheHive and MISP through their APIs.</li>
<li><strong>Syslog:</strong> Wazuh collects firewall and Suricata logs over Syslog (UDP/TCP 514 by default).</li>
<li><strong>Filebeat (optional):</strong> can be used to ship logs from network tools to Wazuh, for better scalability.</li>
</ul>
<p><em>Threat detection:</em></p>
<ul>
<li>Wazuh stores and queries the indexed data in the <strong>Wazuh indexer</strong>, and detects threats using rules and threat feeds coming from MISP.</li>
</ul>
<p><strong>2. MISP (threat intelligence platform)</strong></p>
<p><em>Communication:</em></p>
<ul>
<li><strong>REST API:</strong> MISP provides IOCs (malicious IP addresses, file hashes…) to Wazuh. Wazuh queries MISP at scheduled intervals for updates.</li>
<li><strong>Data feeds:</strong> MISP pulls data from external threat intelligence providers over secure HTTPS/TLS connections.</li>
</ul>
<p><em>System-level interaction:</em></p>
<ul>
<li>IOCs are formatted and sent to Wazuh to be correlated with the collected logs.</li>
<li>MISP can share threats with other SOCs over HTTPS/TLS.</li>
</ul>
<p><strong>3. TheHive (incident management)</strong></p>
<p><em>Communication:</em></p>
<ul>
<li><strong>Webhook / API:</strong> Wazuh sends high-priority alerts to TheHive, which creates cases through its API. TheHive calls Cortex to enrich incidents (API over HTTPS/TLS).</li>
</ul>
<p><em>System-level interaction:</em></p>
<ul>
<li>Alerts are automatically parsed and turned into structured cases.</li>
<li>Analysts use TheHive's web interface to manage cases and take further action.</li>
</ul>
<p><strong>4. Cortex (automation and enrichment)</strong></p>
<p><em>Communication:</em></p>
<ul>
<li><strong>API calls:</strong> Cortex receives analysis requests from TheHive (for example, file hash checks or IP reputation). Cortex analyzers connect to external services (VirusTotal, WHOIS, etc.) over HTTPS/TLS.</li>
</ul>
<p><em>System-level interaction:</em></p>
<ul>
<li>Analysis results are sent back to TheHive to enrich incidents with actionable information.</li>
</ul>
<p><strong>5. Firewall / NGFW (OPNsense with Zenarmor in the reference design)</strong></p>
<p><em>Communication:</em></p>
<ul>
<li><strong>Syslog:</strong> the firewall sends its firewall and VPN logs to Wazuh over Syslog (UDP/TCP).</li>
<li><strong>Zenarmor:</strong> records network activity (blocked connections, suspicious flows) and sends it to Wazuh.</li>
</ul>
<p><em>System-level interaction:</em></p>
<ul>
<li>The firewall enforces network policies based on threat intelligence (for example, blocking malicious IPs).</li>
<li>Automated workflows can push firewall rules dynamically through the firewall's API.</li>
</ul>
<p><strong>6. Suricata (IDS/IPS)</strong></p>
<p><em>Communication:</em></p>
<ul>
<li><strong>Syslog / JSON output:</strong> Suricata writes its alerts in JSON and sends them to Wazuh via Syslog or over an encrypted (TLS) connection.</li>
<li><strong>SPAN / TAP ports:</strong> Suricata listens to network traffic on a mirror port or a network TAP to detect threats.</li>
</ul>
<p><em>System-level interaction:</em></p>
<ul>
<li>Suricata alerts (matched signatures) are processed by Wazuh and correlated with endpoint data and threat intelligence.</li>
<li>Suricata rules can be updated based on IOCs from MISP or on Wazuh alerts.</li>
</ul>
<h3>3.2. Workflow summary</h3>
<ol>
<li><strong>Log and alert collection:</strong> Wazuh collects logs from the endpoints, the firewall and Suricata, and receives threat intelligence from MISP.</li>
<li><strong>Alert correlation:</strong> Wazuh correlates the logs and raises alerts when events match predefined rules or IOCs.</li>
<li><strong>Incident management:</strong> alerts are sent to TheHive for case management; Cortex enriches the cases with extra context from external tools.</li>
<li><strong>Automated actions:</strong> critical incidents can trigger API calls to the firewall to block IPs or update rules.</li>
<li><strong>Network security hardening:</strong> the firewall and Suricata actively monitor traffic and raise alerts on malicious activity.</li>
</ol>
<h3>3.3. Protocols and ports</h3>
<table>
<thead>
<tr>
<th>Component</th>
<th>Protocol</th>
<th>Port</th>
<th>Purpose</th>
</tr>
</thead>
<tbody><tr>
<td>Wazuh agents</td>
<td>TCP/UDP</td>
<td>1514 / 514</td>
<td>Send logs to Wazuh</td>
</tr>
<tr>
<td>Wazuh manager</td>
<td>HTTPS</td>
<td>443</td>
<td>API communication (e.g. with TheHive)</td>
</tr>
<tr>
<td>MISP</td>
<td>HTTPS</td>
<td>443</td>
<td>Share IOCs with Wazuh</td>
</tr>
<tr>
<td>TheHive</td>
<td>HTTPS</td>
<td>443</td>
<td>Case management via API</td>
</tr>
<tr>
<td>Cortex</td>
<td>HTTPS</td>
<td>443</td>
<td>Automated analysis via analyzers</td>
</tr>
<tr>
<td>Firewall (OPNsense / pfSense)</td>
<td>Syslog (UDP/TCP)</td>
<td>514</td>
<td>Firewall logs sent to Wazuh</td>
</tr>
<tr>
<td>Suricata</td>
<td>Syslog / JSON</td>
<td>514 / custom</td>
<td>Alerts sent to Wazuh</td>
</tr>
</tbody></table>
<blockquote>
<p>In the lab deployed in Part 2, the web interfaces listen on these ports: Wazuh dashboard <code>9443</code>, TheHive <code>9000</code>, Cortex <code>9001</code>, MISP <code>443</code>, Portainer <code>9111</code>, Shuffle <code>3001</code>/<code>3443</code>.</p>
</blockquote>
<h3>3.4. Network communication map</h3>
<ol>
<li><strong>Endpoints → Wazuh manager:</strong> logs are sent securely by the Wazuh agents (encrypted channel).</li>
<li><strong>Wazuh → MISP:</strong> queries MISP IOCs via API (HTTPS).</li>
<li><strong>Wazuh → TheHive:</strong> alerts are sent to TheHive to create cases (HTTPS API).</li>
<li><strong>TheHive → Cortex:</strong> sends enrichment requests (HTTPS API).</li>
<li><strong>Firewall and Suricata → Wazuh:</strong> Syslog/JSON logs are forwarded to Wazuh over encrypted connections.</li>
</ol>
<h2>4. Lab Inventory and Deployment Architecture</h2>
<p>Here is the architecture we actually deployed on Proxmox:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-001.jpg" alt="Deployment architecture of the SOC lab" style="display:block;margin:0 auto" />

<p>And here are the virtual machines that make up the lab:</p>
<table>
<thead>
<tr>
<th>VM name on Proxmox</th>
<th>Type</th>
<th>Role</th>
<th>IP address</th>
<th>Software</th>
</tr>
</thead>
<tbody><tr>
<td>VIZUALIZER-DASHBOARDS</td>
<td>Jump host</td>
<td>Used to connect to and view the web interfaces of all deployed tools</td>
<td>20.0.0.20</td>
<td>Windows 10 + PuTTY (SSH administration of the Linux servers)</td>
</tr>
<tr>
<td>PROD-FIREWALL</td>
<td>Firewall</td>
<td>Firewall, DHCP server for the LAN, and IDS/IPS with Snort</td>
<td>WAN: 10.0.0.10/32 — LAN: 20.0.0.10/24</td>
<td>pfSense + Snort</td>
</tr>
<tr>
<td>SECURITY-OPERATION-CENTER</td>
<td>External SOC</td>
<td>Detects, analyzes and responds to security incidents in the environment it protects</td>
<td>20.0.0.21</td>
<td>Portainer, TheHive, Cortex, MISP, Wazuh</td>
</tr>
<tr>
<td>REDTEAM</td>
<td>Pentest machine</td>
<td>Runs penetration tests to simulate real attacks, from detection to incident response</td>
<td>20.0.0.22</td>
<td>Kali Linux</td>
</tr>
<tr>
<td>PLAYBOOK-AUTOMATION-SOAR</td>
<td>SOAR</td>
<td>Automates the playbooks defined for incident handling</td>
<td>20.0.0.25</td>
<td>Ubuntu Server 24.04.1 + Docker + Shuffle</td>
</tr>
<tr>
<td>Windows-Agent</td>
<td>Windows agent</td>
<td>Test endpoint for the SIEM use cases</td>
<td>20.0.0.23</td>
<td>Windows 10 + Wazuh agent</td>
</tr>
<tr>
<td>Linux-Agent</td>
<td>Linux agent</td>
<td>Test endpoint for the SIEM use cases</td>
<td>20.0.0.24</td>
<td>Ubuntu Desktop + Wazuh agent</td>
</tr>
</tbody></table>
<hr />
<h1>Part 2 — Deployment</h1>
<h2>5. Deploying and Configuring the pfSense Firewall</h2>
<h3>5.1. What is pfSense?</h3>
<p><strong>pfSense is an open-source operating system, based on FreeBSD, used to build a router/firewall. This guide uses version 2.7.2 (the latest release as of February 2024).</strong></p>
<h3>5.2. Installing pfSense on Proxmox 8.1</h3>
<p>In this section, we install pfSense on a hosted Proxmox 8.1 hypervisor, using the following architecture:</p>
<ul>
<li>1 pfSense virtual machine with 2 interfaces, "WAN" and "LAN"</li>
</ul>
<p>In our setup:</p>
<ul>
<li>WAN --&gt; <code>vmbr1</code> --&gt; 10.0.0.1/24</li>
<li>LAN --&gt; <code>vmbr2</code> --&gt; 20.0.0.1/24</li>
</ul>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-002.jpg" alt="Screenshot 2" style="display:block;margin:0 auto" />

<ul>
<li>1 Windows 10 machine, connected to the pfSense "LAN" interface, used to administer the firewall</li>
</ul>
<h4>5.2.1. Prerequisites</h4>
<ul>
<li>A Proxmox 8.1 hypervisor</li>
<li>The pfSense ISO image</li>
<li>A Windows 10 machine for administration</li>
</ul>
<h4>5.2.2. Downloading and preparing the ISO image</h4>
<p><strong>1.</strong> Download the pfSense ISO image from the official website: <a href="https://www.pfsense.org/download/">https://www.pfsense.org/download/</a></p>
<p><strong>2.</strong> Select the "AMD64" architecture and the "DVD Image (ISO)" installer.</p>
<p><strong>3.</strong> Click the "Download" button:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-003.jpg" alt="Screenshot 3" style="display:block;margin:0 auto" />

<p>Note: the image is downloaded as an <code>.iso.gz</code> archive. Extract it with a tool such as 7-Zip to get the <code>.iso</code> file.</p>
<h4>5.2.3. Uploading the ISO to Proxmox</h4>
<p><strong>1.</strong> Log in to the Proxmox web interface.</p>
<p><strong>2.</strong> In the server view, click the "local" storage, then "ISO Images" in the right-hand panel.</p>
<p><strong>3.</strong> Click "Upload" to transfer the image from your PC to the Proxmox server.</p>
<p>Tip: you can also download the ISO directly from a URL if you have a valid link to the <code>.iso</code> file.</p>
<h4>5.2.4. Creating the network bridges (vmbr) on Proxmox</h4>
<p>Before creating the virtual machine, we need to create the "vmbr" bridges that pfSense will connect to.</p>
<p><strong>1.</strong> Click the name of your Proxmox node, then click "Network" in the right-hand panel.</p>
<p><strong>2.</strong> Click "Create" &gt; "Linux Bridge":</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-004.jpg" alt="Screenshot 4" style="display:block;margin:0 auto" />

<p>A new bridge, "vmbr1", now appears in the Proxmox network list:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-005.jpg" alt="Screenshot 5" style="display:block;margin:0 auto" />

<p><strong>3.</strong> Click "Apply Configuration" to activate the bridge.</p>
<p>pfSense needs 2 virtual network cards, each connected to its own bridge. In our case, <code>vmbr0</code> is already bound to the server's public IP address, so we use <code>vmbr1</code> <strong>for the WAN</strong> and <code>vmbr2</code> <strong>for the LAN</strong>.</p>
<h4>5.2.5. Creating and configuring the pfSense VM</h4>
<p><strong>1.</strong> Click "Create VM".</p>
<p><strong>2.</strong> Name your VM and, in the next step, select the installation ISO image.</p>
<p><strong>3.</strong> Keep the default settings in the "System" tab.</p>
<p><strong>4.</strong> In the "Disks" tab, set the disk size to 20 GB.</p>
<p><strong>5.</strong> Keep the default settings in the "CPU" tab.</p>
<p><strong>6.</strong> Set the memory to 2048 MB.</p>
<p><strong>7.</strong> In the "Network" tab, select "vmbr1".</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-006.jpg" alt="Screenshot 6" style="display:block;margin:0 auto" />

<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-007.png" alt="Screenshot 7" style="display:block;margin:0 auto" />

<p><strong>8.</strong> Confirm the creation of the VM, but do not start it yet!</p>
<p><strong>9.</strong> Add a second network card to the pfSense VM:</p>
<p><strong>10.</strong> Click your VM, then "Hardware" &gt; "Add" in the right-hand panel.</p>
<p><strong>11.</strong> Click "Network Device".</p>
<p><strong>12.</strong> Select "vmbr2" for this card (leave the MAC address on "auto").</p>
<p><strong>13.</strong> Click "Add".</p>
<p>The network hardware of your pfSense VM should now look like this:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-008.jpg" alt="Screenshot 8" style="display:block;margin:0 auto" />

<p>The pfSense VM is ready to start.</p>
<h3>5.3. Installing pfSense</h3>
<p><strong>1.</strong> Start the VM to launch the installer, wait a moment, then accept the license agreement by pressing "Enter":</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-009.jpg" alt="Screenshot 9" style="display:block;margin:0 auto" />

<p><strong>2.</strong> Select <strong>"Install pfSense"</strong>:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-010.jpg" alt="Screenshot 10" style="display:block;margin:0 auto" />

<p><strong>3.</strong> This version of the installer asks you to configure the network before continuing:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-011.jpg" alt="Screenshot 11" style="display:block;margin:0 auto" />

<p><strong>4.</strong> First, select the WAN interface, which corresponds to <code>vmbr1</code>:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-012.jpg" alt="Screenshot 12" style="display:block;margin:0 auto" />

<p><strong>5.</strong> Configure the WAN interface with a static IP address matching your setup. It should look like this:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-013.jpg" alt="Screenshot 13" style="display:block;margin:0 auto" />

<p><strong>6.</strong> Next, select the LAN interface, which corresponds to <code>vmbr2</code>:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-014.jpg" alt="Screenshot 14" style="display:block;margin:0 auto" />

<p><strong>7.</strong> Configure its IP address according to your setup and, most importantly, enable it as a DHCP server:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-015.jpg" alt="Screenshot 15" style="display:block;margin:0 auto" />

<p><strong>8.</strong> Confirm the interface assignment to continue the installation:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-016.jpg" alt="Screenshot 16" style="display:block;margin:0 auto" />

<p><strong>9.</strong> Click "Continue". If everything is correct, a message says that no valid subscription was found. Choose the <strong>CE (Community Edition)</strong> version:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-017.jpg" alt="Screenshot 17" style="display:block;margin:0 auto" />

<p><strong>10.</strong> Choose the file system. We use <strong>ZFS</strong> (the recommended default):</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-018.jpg" alt="Screenshot 18" style="display:block;margin:0 auto" />

<p><strong>11.</strong> Select the storage disk:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-019.jpg" alt="Screenshot 19" style="display:block;margin:0 auto" />

<p><strong>12.</strong> Confirm your choice. The disk will be formatted for the installation:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-020.jpg" alt="Screenshot 20" style="display:block;margin:0 auto" />

<p><strong>13.</strong> Choose the version to install. We use <strong>2.7.2</strong>, the most stable release at the time:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-021.jpg" alt="Screenshot 21" style="display:block;margin:0 auto" />

<p><strong>14.</strong> The installation starts:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-022.jpg" alt="Screenshot 22" style="display:block;margin:0 auto" />

<p><strong>15.</strong> When the installation is complete, you get the following screen:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-023.jpg" alt="Screenshot 23" style="display:block;margin:0 auto" />

<p><strong>16.</strong> Select <strong>"Reboot"</strong> to restart:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-024.jpg" alt="Screenshot 24" style="display:block;margin:0 auto" />

<p><strong>17.</strong> Wait for the machine to restart. On boot, pfSense detects the network interfaces and asks you to assign them as "WAN" and "LAN". Here, pfSense detected our 2 network cards as "vtnet0" and "vtnet1":</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-025.jpg" alt="Screenshot 25" style="display:block;margin:0 auto" />

<p><strong>18.</strong> Assign the detected network cards to the "WAN" and "LAN" interfaces (important!):</p>
<ul>
<li>Type "vtnet0" and press "Enter" to assign it as the "WAN" interface</li>
<li>Type "vtnet1" to assign the other card as the "LAN" interface:</li>
</ul>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-026.jpg" alt="Screenshot 26" style="display:block;margin:0 auto" />

<p><strong>19.</strong> Type <strong>"y"</strong> to confirm and wait while pfSense applies the assignment (this can take a few minutes):</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-027.jpg" alt="Screenshot 27" style="display:block;margin:0 auto" />

<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-028.jpg" alt="Screenshot 28" style="display:block;margin:0 auto" />

<h3>5.4. Assigning IP Addresses to the WAN and LAN Interfaces</h3>
<p>Once the interfaces are assigned, pfSense displays the following screen:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-029.png" alt="Screenshot 29" style="display:block;margin:0 auto" />

<p>The "WAN" interface has no IP address yet, because it must be configured statically. With a hosting provider, this is often a failover IP in the form <code>xxx.xxx.xxx.xxx/32</code>; in our case, it is the address of the <code>vmbr1</code> network. The "LAN" interface, on the other hand, received pfSense's default address, <code>192.168.1.1/24</code>.</p>
<p>We therefore assign a static IP address to the "WAN" interface from the pfSense console:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-030.jpg" alt="Screenshot 30" style="display:block;margin:0 auto" />

<p><strong>1.</strong> Type "2" ("Set interface(s) IP address"), then "1" to select the "WAN" interface:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-031.png" alt="Screenshot 31" style="display:block;margin:0 auto" />

<p><strong>2.</strong> Answer "n" when asked whether to configure the WAN via DHCP (our WAN IP is static):</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-032.jpg" alt="Screenshot 32" style="display:block;margin:0 auto" />

<p><strong>3.</strong> Enter the WAN IP address (in our case, an address on the <code>vmbr1</code> network):</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-033.jpg" alt="Screenshot 33" style="display:block;margin:0 auto" />

<p><strong>4.</strong> Enter the subnet mask (/32):</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-034.jpg" alt="Screenshot 34" style="display:block;margin:0 auto" />

<p><strong>5.</strong> Enter the gateway IP address:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-035.jpg" alt="Screenshot 35" style="display:block;margin:0 auto" />

<p><strong>6.</strong> Answer "n" when asked whether to configure a WAN IPv6 address via DHCP6:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-036.jpg" alt="Screenshot 36" style="display:block;margin:0 auto" />

<p><strong>7.</strong> Press "Enter" without typing anything (no WAN IPv6 address):</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-037.jpg" alt="Screenshot 37" style="display:block;margin:0 auto" />

<p><strong>8.</strong> Answer "n" here as well, since the WAN address is static:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-038.jpg" alt="Screenshot 38" style="display:block;margin:0 auto" />

<p><strong>9.</strong> Answer "n" to keep HTTPS access to the pfSense web interface:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-039.jpg" alt="Screenshot 39" style="display:block;margin:0 auto" />

<p><strong>10.</strong> Press "Enter" to confirm:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-040.jpg" alt="Screenshot 40" style="display:block;margin:0 auto" />

<p>Now we configure the LAN interface so that it matches the <code>vmbr2</code> network.</p>
<p><strong>11.</strong> As before, choose option 2:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-041.jpg" alt="Screenshot 41" style="display:block;margin:0 auto" />

<p><strong>12.</strong> This time, select the LAN interface (option 2):</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-042.jpg" alt="Screenshot 42" style="display:block;margin:0 auto" />

<p><strong>13.</strong> Answer "n" so the interface is not configured as a DHCP client:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-043.jpg" alt="Screenshot 43" style="display:block;margin:0 auto" />

<p><strong>14.</strong> Enter the LAN interface IP address:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-044.jpg" alt="Screenshot 44" style="display:block;margin:0 auto" />

<p><strong>15.</strong> Enter the subnet mask:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-045.jpg" alt="Screenshot 45" style="display:block;margin:0 auto" />

<p><strong>16.</strong> Enter the gateway IP address:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-046.jpg" alt="Screenshot 46" style="display:block;margin:0 auto" />

<p><strong>17.</strong> Confirm this address as the default gateway, then answer "n" to skip IPv6 configuration:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-047.jpg" alt="Screenshot 47" style="display:block;margin:0 auto" />

<p><strong>18.</strong> Press "Enter" to skip the IPv6 address for the LAN interface:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-048.jpg" alt="Screenshot 48" style="display:block;margin:0 auto" />

<p><strong>19.</strong> Next, we enable the DHCP server on the LAN so it can assign IP addresses to the SOC components. Answer "y":</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-049.jpg" alt="Screenshot 49" style="display:block;margin:0 auto" />

<p><strong>20.</strong> Enter the range of IP addresses the DHCP server can assign, as shown below:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-050.jpg" alt="Screenshot 50" style="display:block;margin:0 auto" />

<p><strong>21.</strong> Finally, keep "HTTPS" as the web interface protocol:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-051.jpg" alt="Screenshot 51" style="display:block;margin:0 auto" />

<p><strong>22.</strong> The LAN interface is now configured, as shown below. Press "Enter" to continue:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-052.jpg" alt="Screenshot 52" style="display:block;margin:0 auto" />

<p><strong>23.</strong> Both interfaces are now correctly configured:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-053.jpg" alt="Screenshot 53" style="display:block;margin:0 auto" />

<h3>5.5. Accessing the pfSense Web Interface from a VM on vmbr2 (LAN)</h3>
<p><strong>1.</strong> Create a virtual machine with a graphical interface (in our case, a Windows machine).</p>
<p><strong>2.</strong> Connect it to "vmbr2" so that it sits on the LAN, then start it. Here, we created a Windows 10 VM with a network card connected to "vmbr2".</p>
<p>We named this VM <strong>VIZUALIZER-DASHBOARDS</strong>. It acts as a jump host to access the SOC components and, above all, to administer the firewall.</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-054.jpg" alt="Screenshot 54" style="display:block;margin:0 auto" />

<p>Make sure the Windows VM's network card is connected to "vmbr2"; otherwise, it will not be able to reach the pfSense LAN!</p>
<p>Once the VM is running, you can confirm it is on the LAN: it received a <code>20.0.0.xxx/24</code> address from the pfSense DHCP server and has Internet access:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-055.jpg" alt="Screenshot 55" style="display:block;margin:0 auto" />

<p><strong>3.</strong> Open a browser on the VM and go to <code>https://20.0.0.10</code> (the pfSense LAN address). Accept the browser warning to trust pfSense's self-signed certificate:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-056.jpg" alt="Screenshot 56" style="display:block;margin:0 auto" />

<p><strong>4.</strong> Log in with the default credentials: username "admin", password "pfsense":</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-057.jpg" alt="Screenshot 57" style="display:block;margin:0 auto" />

<p><strong>5.</strong> The pfSense setup wizard opens automatically. Click "Next":</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-058.jpg" alt="Screenshot 58" style="display:block;margin:0 auto" />

<p><strong>6.</strong> The wizard has 9 steps. In the first screen, you can set your "Domain".</p>
<p>Also enter your DNS servers (here, Quad9), then click "Next":</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-059.jpg" alt="Screenshot 59" style="display:block;margin:0 auto" />

<p><strong>7.</strong> In step 3, set the "Timezone" to "Europe/Paris" and click "Next":</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-060.jpg" alt="Screenshot 60" style="display:block;margin:0 auto" />

<p><strong>8.</strong> In step 4, make sure the WAN IP type is set to "Static" and click "Next":</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-061.jpg" alt="Screenshot 61" style="display:block;margin:0 auto" />

<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-062.jpg" alt="Screenshot 62" style="display:block;margin:0 auto" />

<p><strong>9.</strong> In step 5, you will see the LAN IP settings you configured during installation. Click "Next":</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-063.jpg" alt="Screenshot 63" style="display:block;margin:0 auto" />

<p><strong>10.</strong> Change the default admin password for the web interface (never keep the default password, everyone knows it!) and click <strong>"Next"</strong>:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-064.jpg" alt="Screenshot 64" style="display:block;margin:0 auto" />

<p><strong>11.</strong> The configuration is complete! Click "Reload" to apply your settings:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-065.jpg" alt="Screenshot 65" style="display:block;margin:0 auto" />

<p><strong>12.</strong> pfSense reloads and confirms that the setup was successful:</p>
<ul>
<li>Click "Finish":</li>
</ul>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-066.jpg" alt="Screenshot 66" style="display:block;margin:0 auto" />

<p><strong>13.</strong> Accept the license agreement by clicking "Accept":</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-067.jpg" alt="Screenshot 67" style="display:block;margin:0 auto" />

<p><strong>14.</strong> Click "Close" to finish:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-068.jpg" alt="Screenshot 68" style="display:block;margin:0 auto" />

<p><strong>15.</strong> The pfSense dashboard is displayed:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-069.jpg" alt="Screenshot 69" style="display:block;margin:0 auto" />

<p>The pfSense firewall is now configured and ready to use!</p>
<h3>5.6. Configuring NAT on the Firewall</h3>
<p>Next, we configure NAT so that machines on the LAN can reach the Internet through the single WAN interface.</p>
<p><strong>1.</strong> Enable NAT (address translation)</p>
<p>pfSense must translate the private LAN addresses into the WAN address.</p>
<p><strong>2.</strong> Go to: <code>Firewall</code> → <code>NAT</code> → <code>Outbound</code></p>
<p><strong>3.</strong> Select the <code>Hybrid Outbound NAT</code> mode.</p>
<p><strong>4.</strong> This mode lets pfSense create automatic rules while still allowing you to add your own.</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-070.jpg" alt="Screenshot 70" style="display:block;margin:0 auto" />

<p><strong>5.</strong> Add a manual NAT rule:</p>
<ul>
<li><code>Interface</code>: <code>WAN</code></li>
<li><code>Source</code>: <code>LAN subnets</code> (your LAN network, here <code>20.0.0.0/24</code>)</li>
<li><code>Destination</code>: <code>any</code></li>
<li><code>Translation</code>: <code>Interface Address</code></li>
<li>Save and apply the changes.</li>
</ul>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-071.jpg" alt="Screenshot 71" style="display:block;margin:0 auto" />

<p><strong>6.</strong> Create a firewall rule on the LAN interface</p>
<p>Now we allow traffic from the LAN to the Internet.</p>
<p><strong>6.1.</strong> Go to: <code>Firewall</code> → <code>Rules</code> → <code>LAN</code></p>
<p><strong>6.2.</strong> Add a new rule:</p>
<ul>
<li>Action: <code>Pass</code></li>
<li>Interface: <code>LAN</code></li>
<li>Address Family: <code>IPv4</code></li>
<li>Protocol: <code>Any</code> (allows TCP/UDP/ICMP)</li>
<li>Source: <code>20.0.0.0/24</code></li>
<li>Destination: <code>Any</code></li>
<li>Gateway: <code>Default</code></li>
<li>Description: <code>Allow Internet access from LAN</code></li>
</ul>
<p><strong>7.</strong> Save and apply the rules (<code>Apply Changes</code>).</p>
<p>You can confirm it works by pinging <a href="http://google.com">google.com</a> from the Windows host:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-072.jpg" alt="Screenshot 72" style="display:block;margin:0 auto" />

<h2>6. Installing the Server that Hosts the SOC Components</h2>
<h3>6.1. Server specifications</h3>
<ul>
<li>OS --&gt; Ubuntu Server 24.04.1</li>
<li>RAM --&gt; 32 GB</li>
<li>Storage --&gt; 400 GB</li>
<li>4 cores</li>
<li>2 CPU sockets</li>
</ul>
<h3>6.2. Installing and configuring Ubuntu Server</h3>
<p><strong>1.</strong> In the Proxmox web interface, click <strong>"Create VM"</strong>:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-073.png" alt="Screenshot 73" style="display:block;margin:0 auto" />

<p><strong>2.</strong> Name the machine. We called it <strong>"SECURITY-OPERATION-CENTER"</strong>:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-074.jpg" alt="Screenshot 74" style="display:block;margin:0 auto" />

<p><strong>3.</strong> Select the Ubuntu Server ISO image:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-075.jpg" alt="Screenshot 75" style="display:block;margin:0 auto" />

<p><strong>4.</strong> In the <strong>"System"</strong> section, keep the defaults and click <strong>"Next"</strong>:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-076.png" alt="Screenshot 76" style="display:block;margin:0 auto" />

<p><strong>5.</strong> In the disk section, increase the size according to your available storage, then click <strong>"Next"</strong>. We set it to 400 GB:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-077.png" alt="Screenshot 77" style="display:block;margin:0 auto" />

<p><strong>6.</strong> Set the number of cores and CPU sockets the VM needs, then click <strong>"Next"</strong>:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-078.png" alt="Screenshot 78" style="display:block;margin:0 auto" />

<p><strong>7.</strong> Due to limited resources, we later came back and adjusted this section as follows:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-079.jpg" alt="Screenshot 79" style="display:block;margin:0 auto" />

<p><strong>8.</strong> Set the amount of RAM:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-080.png" alt="Screenshot 80" style="display:block;margin:0 auto" />

<p><strong>9.</strong> Select the network card. Here it is the LAN bridge, <code>vmbr2</code>. Since the pfSense LAN interface acts as a DHCP server, the VM will receive its IP address automatically:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-081.png" alt="Screenshot 81" style="display:block;margin:0 auto" />

<p><strong>10.</strong> Here is what the final VM configuration should look like:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-082.jpg" alt="Screenshot 82" style="display:block;margin:0 auto" />

<p><strong>11.</strong> Start the machine by clicking <strong>"Start"</strong>:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-083.jpg" alt="Screenshot 83" style="display:block;margin:0 auto" />

<p><strong>12.</strong> Once the VM has booted, select <strong>"Try or Install Ubuntu Server"</strong>:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-084.jpg" alt="Screenshot 84" style="display:block;margin:0 auto" />

<p><strong>13.</strong> We kept English as the installation language:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-085.jpg" alt="Screenshot 85" style="display:block;margin:0 auto" />

<p><strong>14.</strong> Continue without updating the installer for now (updates will be applied after installation):</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-086.png" alt="Screenshot 86" style="display:block;margin:0 auto" />

<p><strong>15.</strong> Choose your keyboard layout (in our case, <strong>"French"</strong>):</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-087.jpg" alt="Screenshot 87" style="display:block;margin:0 auto" />

<p><strong>16.</strong> Select the standard Ubuntu Server installation:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-088.jpg" alt="Screenshot 88" style="display:block;margin:0 auto" />

<p><strong>17.</strong> The server automatically receives an IP address from pfSense, here <strong>20.0.0.21/24</strong>:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-089.jpg" alt="Screenshot 89" style="display:block;margin:0 auto" />

<p><strong>18.</strong> The installer tests connectivity by reaching the Ubuntu download mirror:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-090.jpg" alt="Screenshot 90" style="display:block;margin:0 auto" />

<p><strong>19.</strong> Select the storage disk. This is the 400 GB disk we defined when creating the VM:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-091.jpg" alt="Screenshot 91" style="display:block;margin:0 auto" />

<p><strong>20.</strong> Review the partition layout, then confirm:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-092.jpg" alt="Screenshot 92" style="display:block;margin:0 auto" />

<p><strong>21.</strong> Confirm again: the disk will be formatted so the OS can be installed:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-093.jpg" alt="Screenshot 93" style="display:block;margin:0 auto" />

<p><strong>22.</strong> Create your user account and set the server name and password:</p>
<p><strong>Username --&gt; manager</strong></p>
<p><strong>Password --&gt;</strong> <code>********</code></p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-094.jpg" alt="Screenshot 94" style="display:block;margin:0 auto" />

<p><strong>23.</strong> Enable <strong>"Install OpenSSH server"</strong>. We will use it to connect to the server over SSH:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-095.jpg" alt="Screenshot 95" style="display:block;margin:0 auto" />

<p><strong>24.</strong> You can also select optional software packages. We skipped this step and continued without selecting anything:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-096.jpg" alt="Screenshot 96" style="display:block;margin:0 auto" />

<p><strong>25.</strong> The installation starts:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-097.jpg" alt="Screenshot 97" style="display:block;margin:0 auto" />

<p><strong>26.</strong> When the installation completes successfully, you will see <strong>"SUCCESS"</strong> on the last line:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-098.png" alt="Screenshot 98" style="display:block;margin:0 auto" />

<p><strong>27.</strong> Restart the machine by selecting <strong>"Reboot Now"</strong>:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-099.png" alt="Screenshot 99" style="display:block;margin:0 auto" />

<p><strong>28.</strong> Log in to the server with your username and password:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-100.jpg" alt="Screenshot 100" style="display:block;margin:0 auto" />

<p><strong>29.</strong> First, set a password for the <strong>"root"</strong> user with this command:</p>
<pre><code class="language-bash">sudo passwd
</code></pre>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-101.jpg" alt="Screenshot 101" style="display:block;margin:0 auto" />

<p><strong>30.</strong> Then switch to the root user and update the system packages:</p>
<pre><code class="language-bash">sudo apt update &amp;&amp; apt upgrade -y
</code></pre>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-102.jpg" alt="Screenshot 102" style="display:block;margin:0 auto" />

<p>Wait for the updates to finish.</p>
<p>Once they are done, the server is ready:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-103.jpg" alt="Screenshot 103" style="display:block;margin:0 auto" />

<p>We can now start deploying the SOC components!</p>
<h2>7. Installing the SOC Components</h2>
<p>In this section, we install the core components of the SOC:</p>
<ul>
<li><strong>Portainer</strong>: to manage the Docker containers</li>
<li><strong>TheHive</strong>: our ticketing / case management system</li>
<li><strong>Cortex</strong>: our SOAR, used to analyze observables</li>
<li><strong>MISP</strong>: our threat intelligence sharing platform, used to collect threat information and enrich indicators of compromise (IOCs)</li>
<li><strong>Wazuh</strong>: our SIEM, which centralizes the SOC's security events</li>
</ul>
<p>The diagram below summarizes how these components work together:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-104.jpg" alt="Screenshot 104" style="display:block;margin:0 auto" />

<h3>7.1. Automated Deployment</h3>
<p>The first step is to connect to the deployment server over SSH and clone the GitHub repository that contains our installation script.</p>
<p><strong>1.</strong> Log in to the Windows 10 host where our SSH client (PuTTY) is installed:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-105.jpg" alt="Screenshot 105" style="display:block;margin:0 auto" />

<p><strong>2.</strong> Sign in to GitHub to access our private repository:</p>
<p><em>(private repository link hidden)</em></p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-106.jpg" alt="Screenshot 106" style="display:block;margin:0 auto" />

<p><strong>3.</strong> Connect to the deployment server over SSH with PuTTY:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-107.jpg" alt="Screenshot 107" style="display:block;margin:0 auto" />

<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-108.jpg" alt="Screenshot 108" style="display:block;margin:0 auto" />

<p><strong>4.</strong> Log in to the server with our user account (manager):</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-109.jpg" alt="Screenshot 109" style="display:block;margin:0 auto" />

<p><strong>5.</strong> Switch to <strong>root</strong> and clone the private repository, using:</p>
<p><strong>Username --&gt;</strong> <code>********</code></p>
<p><strong>Password --&gt; the Personal Access Token generated on GitHub</strong></p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-110.jpg" alt="Screenshot 110" style="display:block;margin:0 auto" />

<p><strong>6.</strong> Once cloned, go into the <strong>SOC-AS-A-SERVICE</strong> folder and make <strong>"Script_De_Déploiement.sh"</strong> executable:</p>
<pre><code class="language-bash">chmod +x Script_De_Déploiement.sh
</code></pre>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-111.jpg" alt="Screenshot 111" style="display:block;margin:0 auto" />

<p><strong>7.</strong> Run the script:</p>
<pre><code class="language-bash">./Script_De_Déploiement.sh
</code></pre>
<p>The script displays a menu that lets you choose which tool to install:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-112.jpg" alt="Screenshot 112" style="display:block;margin:0 auto" />

<p><strong>8.</strong> Start with <strong>option 1</strong>, which installs the updates and prerequisites needed by the other components:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-113.jpg" alt="Screenshot 113" style="display:block;margin:0 auto" />

<p><strong>9.</strong> When it finishes, the script shows the Portainer address. Portainer hosts and monitors the containers used in our environment. You will set the password for the <strong>"admin"</strong> user the first time you log in:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-114.jpg" alt="Screenshot 114" style="display:block;margin:0 auto" />

<p><strong>10.</strong> The console then tells you to open Portainer at <strong><a href="http://YOUR_IP:9111">http://YOUR_IP:9111</a></strong>, in our case <a href="http://20.0.0.21:9111"><strong>http://20.0.0.21:9111</strong></a>:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-115.jpg" alt="Screenshot 115" style="display:block;margin:0 auto" />

<p><strong>11.</strong> You now have access to the Portainer interface:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-116.jpg" alt="Screenshot 116" style="display:block;margin:0 auto" />

<p>Notice that 2 containers are already running. They are required by TheHive.</p>
<p><strong>12.</strong> Next, install the ticketing system by choosing <strong>option 2</strong> in the script:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-117.jpg" alt="Screenshot 117" style="display:block;margin:0 auto" />

<p><strong>13.</strong> Once installed, the console tells you to open TheHive at</p>
<p><strong><a href="http://YOUR_IP:9000">http://YOUR_IP:9000</a></strong>, in our case <a href="http://20.0.0.21:9000"><strong>http://20.0.0.21:9000</strong></a></p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-118.jpg" alt="Screenshot 118" style="display:block;margin:0 auto" />

<p><strong>14.</strong> Open the TheHive interface at that address and log in with the following credentials (you can change them later):</p>
<p><strong>Username --&gt; admin</strong></p>
<p><strong>Password --&gt;</strong> <code>********</code></p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-119.jpg" alt="Screenshot 119" style="display:block;margin:0 auto" />

<p><strong>15.</strong> You are now logged in to TheHive:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-120.jpg" alt="Screenshot 120" style="display:block;margin:0 auto" />

<p><strong>16.</strong> Next, install the <strong>Cortex</strong> SOAR by choosing <strong>option 3</strong> in the script:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-121.jpg" alt="Screenshot 121" style="display:block;margin:0 auto" />

<p><strong>17.</strong> When it finishes, the console tells you to open Cortex at <strong><a href="http://YOUR_IP:9001">http://YOUR_IP:9001</a></strong>, in our case <a href="http://20.0.0.21:9001"><strong>http://20.0.0.21:9001</strong></a>:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-122.jpg" alt="Screenshot 122" style="display:block;margin:0 auto" />

<p><strong>18.</strong> Open the Cortex interface:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-123.jpg" alt="Screenshot 123" style="display:block;margin:0 auto" />

<p><strong>19.</strong> On first access, Cortex asks you to update its database and create an administrator account:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-124.jpg" alt="Screenshot 124" style="display:block;margin:0 auto" />

<p>In our case:</p>
<p><strong>Username --&gt; admin</strong></p>
<p><strong>Password --&gt;</strong> <code>********</code></p>
<p><strong>20.</strong> You can now log in to Cortex with the credentials you just created:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-125.jpg" alt="Screenshot 125" style="display:block;margin:0 auto" />

<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-126.jpg" alt="Screenshot 126" style="display:block;margin:0 auto" />

<p><strong>21.</strong> Next, install the <strong>Wazuh</strong> SIEM by choosing <strong>option 4</strong> in the script:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-127.jpg" alt="Screenshot 127" style="display:block;margin:0 auto" />

<p><strong>22.</strong> When the installation finishes, the console tells you to open Wazuh at <strong><a href="https://YOUR_IP:9443">https://YOUR_IP:9443</a></strong>, in our case <a href="https://20.0.0.21:9443"><strong>https://20.0.0.21:9443</strong></a>:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-128.jpg" alt="Screenshot 128" style="display:block;margin:0 auto" />

<p><strong>23.</strong> Log in to Wazuh with the following credentials:</p>
<p><strong>Username --&gt; admin</strong></p>
<p><strong>Password --&gt;</strong> <code>********</code></p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-129.jpg" alt="Screenshot 129" style="display:block;margin:0 auto" />

<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-130.jpg" alt="Screenshot 130" style="display:block;margin:0 auto" />

<p><strong>24.</strong> Next, install <strong>MISP</strong> by choosing <strong>option 5</strong> in the script:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-131.jpg" alt="Screenshot 131" style="display:block;margin:0 auto" />

<p><strong>25.</strong> The script asks for the server's IP address before starting the installation.</p>
<p>Enter your server's IP address, in our case <strong>20.0.0.21</strong>:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-132.jpg" alt="Screenshot 132" style="display:block;margin:0 auto" />

<p><strong>26.</strong> When the installation finishes, the console tells you to open MISP at <strong><a href="https://YOUR_IP">https://YOUR_IP</a></strong>, in our case <a href="https://20.0.0.21"><strong>https://20.0.0.21</strong></a>:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-133.jpg" alt="Screenshot 133" style="display:block;margin:0 auto" />

<p><strong>27.</strong> Log in to MISP with the following credentials:</p>
<p><strong>Username --&gt; <a href="mailto:admin@admin.test">admin@admin.test</a></strong></p>
<p><strong>Password --&gt; the one generated during the MISP installation</strong></p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-134.jpg" alt="Screenshot 134" style="display:block;margin:0 auto" />

<p><strong>28.</strong> After logging in, MISP asks you to change the password. Our new credentials:</p>
<p><strong>Username --&gt; <a href="mailto:admin@admin.test">admin@admin.test</a></strong></p>
<p><strong>Password --&gt;</strong> <code>********</code></p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-135.jpg" alt="Screenshot 135" style="display:block;margin:0 auto" />

<h2>8. Configuring and Using TheHive (Ticketing System)</h2>
<p>In this section, we log in to TheHive and walk through how to use it in a production environment.</p>
<p><strong>1.</strong> Log in to the TheHive web interface and start by creating an organization.</p>
<p>In TheHive, an "Organization" represents a separate entity, such as a department or a business unit, that uses TheHive independently. Here is why organizations matter:</p>
<h4>What an organization does in TheHive</h4>
<p><strong>Data isolation</strong>: by default, organizations are isolated from each other and cannot see or share data. This keeps information confidential and secure.</p>
<p><strong>User management</strong>: you can assign users to one or more organizations. The suggested permission profiles depend on the organization type (Admin or non-Admin).</p>
<p><strong>Case and task management</strong>: non-admin organizations handle the day-to-day work on cases, alerts and tasks.</p>
<h4>Why create an organization?</h4>
<p><strong>Separation of duties</strong>: organizations let you separate responsibilities and data between teams or departments.</p>
<p><strong>Effective collaboration</strong>: organizations make it easier for the security team to work together, and with other organizations, so incidents are handled faster.</p>
<p><strong>Automation and orchestration</strong>: TheHive is designed to automate and orchestrate incident response, which reduces response times and improves your security posture.</p>
<p>In short, organizations give you a structured and secure way to manage security incidents, while making collaboration and automation easier.</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-136.jpg" alt="Screenshot 136" style="display:block;margin:0 auto" />

<p><strong>2.</strong> Give your organization a name and a description:</p>
<p><strong>Name --&gt; CYBERETHIK</strong></p>
<p><strong>Description --&gt; SOC-EXTERNE-CYBERETHIK</strong></p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-137.jpg" alt="Screenshot 137" style="display:block;margin:0 auto" />

<p><strong>3.</strong> Open the organization you just created and create a user inside it:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-138.jpg" alt="Screenshot 138" style="display:block;margin:0 auto" />

<p><strong>4.</strong> Fill in the new user's details:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-139.jpg" alt="Screenshot 139" style="display:block;margin:0 auto" />

<p><strong>5.</strong> Set a password for this user by clicking <strong>New password</strong>:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-140.jpg" alt="Screenshot 140" style="display:block;margin:0 auto" />

<p><strong>6.</strong> Log out, then log back in with the new user, in our case <a href="mailto:analyst1@cyberethik.co"><strong>analyst1@cyberethik.co</strong></a>:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-141.jpg" alt="Screenshot 141" style="display:block;margin:0 auto" />

<p><strong>7.</strong> Once logged in, you see this screen:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-142.jpg" alt="Screenshot 142" style="display:block;margin:0 auto" />

<p>It shows 0 cases, 0 alerts and 0 tasks. This is normal: no incident has been reported yet. Let's create a few for the demo.</p>
<p><strong>8.</strong> Click <strong>"New Case"</strong> in the top-right corner:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-143.jpg" alt="Screenshot 143" style="display:block;margin:0 auto" />

<p>We created a case called <strong>"Demo Case"</strong>:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-144.jpg" alt="Screenshot 144" style="display:block;margin:0 auto" />

<p><strong>9.</strong> Once the case is created, you see its details:</p>
<p>the assigned analyst, the severity, the creation date, the description and other information, as shown below:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-145.jpg" alt="Screenshot 145" style="display:block;margin:0 auto" />

<p><strong>10.</strong> Now that the case exists, what can we do with it?</p>
<p>We can assign tasks related to this case to one or more analysts.</p>
<p>For example, let's assign an IP address investigation task to an analyst:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-146.jpg" alt="Screenshot 146" style="display:block;margin:0 auto" />

<p><strong>11.</strong> The case <strong>"Demo Case"</strong> now has a task called <strong>"Investigate IP"</strong>:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-147.jpg" alt="Screenshot 147" style="display:block;margin:0 auto" />

<p><strong>12.</strong> Several analysts can work on different tasks within the same case. Let's add a second task, <strong>"Investigate Domain"</strong>, to <strong>"Demo Case"</strong>:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-148.jpg" alt="Screenshot 148" style="display:block;margin:0 auto" />

<p><strong>13.</strong> An analyst can now log in and choose which task to work on in <strong>"Demo Case"</strong>.</p>
<p>For example, the analyst can start investigating the IP address by starting the task:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-149.jpg" alt="Screenshot 149" style="display:block;margin:0 auto" />

<p><strong>14.</strong> Click <strong>Start</strong> to get the screen below:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-150.jpg" alt="Screenshot 150" style="display:block;margin:0 auto" />

<p><strong>15.</strong> During or after the investigation, the analyst can click <strong>"Add new task log"</strong> to document their work:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-151.jpg" alt="Screenshot 151" style="display:block;margin:0 auto" />

<p><strong>16.</strong> You can also attach files, for example as evidence from an analysis:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-152.jpg" alt="Screenshot 152" style="display:block;margin:0 auto" />

<p><strong>17.</strong> If you have several organizations, you can share tasks with them by clicking <strong>"Add Share"</strong> and selecting the organization to share with:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-153.png" alt="Screenshot 153" style="display:block;margin:0 auto" />

<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-154.jpg" alt="Screenshot 154" style="display:block;margin:0 auto" />

<p><strong>18.</strong> Because we started the task, it is automatically assigned to our analyst account, as shown below:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-155.jpg" alt="Screenshot 155" style="display:block;margin:0 auto" />

<p>Likewise, if another analyst logs in and starts the <strong>"Investigate Domain"</strong> task, it will be assigned to them.</p>
<p><strong>19.</strong> Now let's say the analysis is complete and we want to take an action, for example blocking the IP address.</p>
<p>To do this, open the case by clicking <strong>"Demo Case"</strong>:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-156.jpg" alt="Screenshot 156" style="display:block;margin:0 auto" />

<p><strong>20.</strong> Click <strong>"Require action"</strong>, then <strong>"Add log"</strong>:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-157.jpg" alt="Screenshot 157" style="display:block;margin:0 auto" />

<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-158.jpg" alt="Screenshot 158" style="display:block;margin:0 auto" />

<p><strong>21.</strong> Once confirmed, a <strong>pop-up</strong> indicates that an action is required:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-159.jpg" alt="Screenshot 159" style="display:block;margin:0 auto" />

<p><strong>22.</strong> Back on the task list, you can see that the <strong>"Investigate IP"</strong> task requires an action:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-160.jpg" alt="Screenshot 160" style="display:block;margin:0 auto" />

<p>You can now share this task with the operational team in charge, for example the network or system team. These teams would be represented by the organizations you share with, as described above.</p>
<p><strong>23.</strong> Once the required action has been completed, click <strong>"Mark as done"</strong> in the <strong>pop-up</strong>, describe the action taken, and confirm:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-161.jpg" alt="Screenshot 161" style="display:block;margin:0 auto" />

<p><strong>24.</strong> Here, for example, we added the comment <strong>"IP address blocked by the network team"</strong>:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-162.jpg" alt="Screenshot 162" style="display:block;margin:0 auto" />

<p><strong>25.</strong> Now close the task:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-163.jpg" alt="Screenshot 163" style="display:block;margin:0 auto" />

<p><strong>26.</strong> The task is now closed:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-164.jpg" alt="Screenshot 164" style="display:block;margin:0 auto" />

<p>Repeat the same process for the second task.</p>
<p><strong>27.</strong> You can also add observables (artifacts) during the analysis. Open the <strong>"Observables"</strong> tab, click <strong>"Add observables"</strong>, and choose a type, for example a domain or an IP:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-165.jpg" alt="Screenshot 165" style="display:block;margin:0 auto" />

<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-166.jpg" alt="Screenshot 166" style="display:block;margin:0 auto" />

<p><strong>28.</strong> Here we add the IP <strong>8.8.8.8</strong> with a medium severity. You can flag it as an indicator of compromise by clicking the star next to <strong>IoC</strong>, and add a tag; here we used the tag <strong>"attacking IP"</strong>:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-167.jpg" alt="Screenshot 167" style="display:block;margin:0 auto" />

<p><strong>29.</strong> The observable now appears in the list:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-168.jpg" alt="Screenshot 168" style="display:block;margin:0 auto" />

<p><strong>30.</strong> Now suppose this IP address is linked to the domain <strong>"</strong><a href="http://hacker.com"><strong>hacker.com</strong></a><strong>"</strong>. Add it as another observable:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-169.jpg" alt="Screenshot 169" style="display:block;margin:0 auto" />

<p><strong>31.</strong> If you try to close the case now, TheHive warns you that it cannot be closed yet, because the <strong>"Investigate Domain"</strong> task is still in progress:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-170.jpg" alt="Screenshot 170" style="display:block;margin:0 auto" />

<p><strong>32.</strong> To close the case properly, go back to the tasks and close the <strong>"Investigate Domain"</strong> task first:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-171.png" alt="Screenshot 171" style="display:block;margin:0 auto" />

<p>Both tasks of the case are now handled and closed:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-172.jpg" alt="Screenshot 172" style="display:block;margin:0 auto" />

<p><strong>33.</strong> You can now close <strong>"Demo Case"</strong> without any issue:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-173.jpg" alt="Screenshot 173" style="display:block;margin:0 auto" />

<p><strong>34.</strong> When closing a case, you must classify the incident, as shown below, and add a comment if needed:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-174.jpg" alt="Screenshot 174" style="display:block;margin:0 auto" />

<p><strong>35.</strong> Since this was a demo, we classified it as a false positive:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-175.jpg" alt="Screenshot 175" style="display:block;margin:0 auto" />

<p><strong>36.</strong> The case is now closed:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-176.jpg" alt="Screenshot 176" style="display:block;margin:0 auto" />

<p>You can also speed up incident handling by checking whether an observable has already been seen in a previous case, so you don't waste time investigating it again. To show this, create a new case called <strong>demo2</strong>:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-177.jpg" alt="Screenshot 177" style="display:block;margin:0 auto" />

<p><strong>37.</strong> In this new case, add the same observable that we added for the <strong>"Investigate IP"</strong> task earlier:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-178.jpg" alt="Screenshot 178" style="display:block;margin:0 auto" />

<p><strong>38.</strong> Click the observable to see whether it is linked to a previously handled case:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-179.jpg" alt="Screenshot 179" style="display:block;margin:0 auto" />

<p><strong>39.</strong> TheHive shows that it is linked to a recent case, <strong>"Demo Case"</strong>:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-180.jpg" alt="Screenshot 180" style="display:block;margin:0 auto" />

<p>This lets you correlate observables and quickly see whether they have already been identified and handled, which makes the analysis faster and easier.</p>
<p>You can then simply close the case, with a comment saying it had already been seen.</p>
<p>Both cases are now closed:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-181.png" alt="Screenshot 181" style="display:block;margin:0 auto" />

<p><strong>40.</strong> You can also follow activity in TheHive in real time by clicking <strong>"Open in new window"</strong> in the top-right corner:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-182.jpg" alt="Screenshot 182" style="display:block;margin:0 auto" />

<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-183.jpg" alt="Screenshot 183" style="display:block;margin:0 auto" />

<p>In the next section, we will see how to run analyses on observables.</p>
<p>For example, instead of manually checking an IP's reputation on AbuseIPDB or VirusTotal, we will do it directly from TheHive.</p>
<p>To do this, we make API calls to threat intelligence databases and services, through our Cortex SOAR.</p>
<h2>9. Integrations and Automation</h2>
<p>In this section, we run analyses on observables using services such as VirusTotal and AbuseIPDB.</p>
<p>When an analyst clicks an observable attached to a case in TheHive, they can instantly enrich it with useful information for the investigation.</p>
<p>This helps the team quickly deal with both urgent and non-urgent threats.</p>
<p>The overall goal is to automate observable analysis directly from the ticketing system.</p>
<p>Cortex makes API calls to various data and threat intelligence sources and displays the results, which makes analysts' work faster and more productive.</p>
<h3>9.1. Configuring Cortex</h3>
<p>As with TheHive, the first step is to log in to Cortex, create an organization, and add a user to it.</p>
<p><strong>1.</strong> Create an organization and add a user</p>
<p>Click <strong>"Add organization"</strong> in the top-left corner:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-184.png" alt="Screenshot 184" style="display:block;margin:0 auto" />

<p><strong>2.</strong> Give the organization a name and a description:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-185.jpg" alt="Screenshot 185" style="display:block;margin:0 auto" />

<p><strong>3.</strong> Select the organization you just created to add a user to it:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-186.jpg" alt="Screenshot 186" style="display:block;margin:0 auto" />

<p><strong>4.</strong> Click <strong>"Add user"</strong> in the top-left corner:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-187.jpg" alt="Screenshot 187" style="display:block;margin:0 auto" />

<p><strong>5.</strong> Fill in the user's details and confirm. The new user now appears in the list:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-188.jpg" alt="Screenshot 188" style="display:block;margin:0 auto" />

<p><strong>6.</strong> Next, we need to add <strong>analyzers</strong>. Analyzers are the modules that make the <strong>API</strong> calls.</p>
<p>The TheHive Project's GitHub repository has a Cortex Analyzers section with a full list of analyzers built by the community:</p>
<p><a href="https://github.com/TheHive-Project/Cortex-Analyzers/tree/master/analyzers">Cortex-Analyzers/analyzers at master · TheHive-Project/Cortex-Analyzers</a></p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-189.png" alt="Screenshot 189" style="display:block;margin:0 auto" />

<p><strong>7.</strong> Install the prerequisites described on this page: <a href="https://docs.strangebee.com/cortex/installation-and-configuration/analyzers-responders/">Analyzers &amp; Responders - TheHive 5 Documentation</a></p>
<p>Once they are installed, you can enable an analyzer. For example, to check an IP address's reputation with VirusTotal, first enable the VirusTotal analyzer in Cortex: click the <strong>"Organization"</strong> section in the top-right corner:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-190.jpg" alt="Screenshot 190" style="display:block;margin:0 auto" />

<p><strong>8.</strong> Then open the <strong>"Analyzers"</strong> tab:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-191.jpg" alt="Screenshot 191" style="display:block;margin:0 auto" />

<p><strong>9.</strong> Since we want to enable <strong>VirusTotal</strong>, search for it in the search bar:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-192.png" alt="Screenshot 192" style="display:block;margin:0 auto" />

<p><strong>10.</strong> Here, it is already enabled. If it were not, you would click <strong>"Enable"</strong> (see the arrow at the bottom, on <strong>VirusTotal_Rescan_3_1</strong>). A form like the one below opens, where you enter your VirusTotal API key:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-193.jpg" alt="Screenshot 193" style="display:block;margin:0 auto" />

<p>Then enable it.</p>
<p><strong>11.</strong> To test the analyzer, click <strong>"New Analysis"</strong> in the top-left corner:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-194.jpg" alt="Screenshot 194" style="display:block;margin:0 auto" />

<p><strong>12.</strong> Fill in the required information as follows:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-195.jpg" alt="Screenshot 195" style="display:block;margin:0 auto" />

<p>Here, we run the test on Google's public DNS IP address, <strong>8.8.8.8</strong>.</p>
<p><strong>13.</strong> Click <strong>"Start"</strong> to run the analyzer on the IP. If everything works, the status shows <strong>"Success"</strong> once the job is complete:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-196.jpg" alt="Screenshot 196" style="display:block;margin:0 auto" />

<p><strong>14.</strong> Click <strong>"View"</strong> to see the results. You get a detailed report like this:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-197.jpg" alt="Screenshot 197" style="display:block;margin:0 auto" />

<p>You can follow the same process to add any other analyzers you need and run analyses with them.</p>
<p>You can also analyze other data types, such as <strong>IPs, hashes, domains, etc.</strong>, to confirm potential indicators of compromise.</p>
<p>Next, we will integrate Cortex with TheHive so that analyses can be launched directly from TheHive when handling an alert or a case with observables.</p>
<h3>9.2. Integrating Cortex with TheHive</h3>
<p><strong>Goals:</strong></p>
<ul>
<li>Run analyses on observables that already exist in TheHive</li>
<li>Use a single web interface</li>
<li>Work faster</li>
</ul>
<p><strong>1.</strong> Connect TheHive to the Cortex API</p>
<p>First, create another user in Cortex with read and analyze permissions (<code>read</code>, <code>analyze</code>):</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-198.jpg" alt="Screenshot 198" style="display:block;margin:0 auto" />

<p><strong>2.</strong> Create an API key for this user:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-199.jpg" alt="Screenshot 199" style="display:block;margin:0 auto" />

<p><strong>3.</strong> Once the API key is created, click <strong>"Reveal"</strong>:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-200.jpg" alt="Screenshot 200" style="display:block;margin:0 auto" />

<p><strong>4.</strong> You can now see and copy the API key:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-201.jpg" alt="Screenshot 201" style="display:block;margin:0 auto" />

<p><strong>5.</strong> Connect to the server where TheHive is installed and open the following file: <code>/etc/thehive/application.conf</code></p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-202.jpg" alt="Screenshot 202" style="display:block;margin:0 auto" />

<p><strong>6.</strong> Go to the <strong>"Cortex configuration"</strong> section and make the following changes:</p>
<p>set the name (we used <code>CORTEX1</code>), enter the Cortex server address in the <code>url</code> field, and add the API key of the user you just created. The configuration should look like this:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-203.png" alt="Screenshot 203" style="display:block;margin:0 auto" />

<p><strong>7.</strong> Save the file and restart TheHive:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-204.jpg" alt="Screenshot 204" style="display:block;margin:0 auto" />

<p><strong>8.</strong> Refresh the TheHive web interface and click <strong>"About"</strong> in the top-right corner. You can see that Cortex is now connected to TheHive:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-205.jpg" alt="Screenshot 205" style="display:block;margin:0 auto" />

<p><strong>9.</strong> You can now run an analyzer on an observable directly from TheHive, without opening Cortex. Tick the box next to the observable and click <strong>"Run analyzers"</strong>:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-206.jpg" alt="Screenshot 206" style="display:block;margin:0 auto" />

<p><strong>10.</strong> Choose the analyzer you want to run:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-207.jpg" alt="Screenshot 207" style="display:block;margin:0 auto" />

<p><strong>11.</strong> For example, select VirusTotal. New information is added to the observable:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-208.jpg" alt="Screenshot 208" style="display:block;margin:0 auto" />

<p><strong>12.</strong> Click the results to see more details for your analysis:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-209.jpg" alt="Screenshot 209" style="display:block;margin:0 auto" />

<p><strong>13.</strong> Every analyzer launched from TheHive actually runs in Cortex. You can find it in the <strong>"Jobs History"</strong> section of Cortex:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-210.jpg" alt="Screenshot 210" style="display:block;margin:0 auto" />

<p><strong>14.</strong> Most analyzer results are displayed as raw JSON. You can make them much more readable with report templates. To do this, log back in to TheHive as an admin:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-211.jpg" alt="Screenshot 211" style="display:block;margin:0 auto" />

<p><strong>15.</strong> Go to the <strong>"Analyzer templates"</strong> section:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-212.jpg" alt="Screenshot 212" style="display:block;margin:0 auto" />

<p><strong>16.</strong> Download the templates using the link provided in this section:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-213.jpg" alt="Screenshot 213" style="display:block;margin:0 auto" />

<p><strong>17.</strong> Download the <strong>template</strong> archive, <strong>without unzipping it</strong>:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-214.jpg" alt="Screenshot 214" style="display:block;margin:0 auto" />

<p><strong>18.</strong> Go back, click <strong>"Import templates"</strong>, and import the file you downloaded:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-215.jpg" alt="Screenshot 215" style="display:block;margin:0 auto" />

<p><strong>19.</strong> Now, when you log in as an analyst and view an analyzer's results, they are displayed in a much clearer format than raw JSON:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-216.jpg" alt="Screenshot 216" style="display:block;margin:0 auto" />

<p>From now on, every analyzer report will be displayed this way!</p>
<h3>9.3. Configuring MISP (Threat Intelligence Sharing Platform)</h3>
<p>In this section, we configure MISP, our platform for sharing indicators of compromise (IOCs). MISP is valuable because it gathers many threat feeds in one central place, so you don't have to jump between sources during an investigation.</p>
<p>Log in to MISP and start by enabling some feeds.</p>
<p><strong>1.</strong> In the <strong>"Sync Actions"</strong> menu, select <strong>"Feeds"</strong>:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-217.jpg" alt="Screenshot 217" style="display:block;margin:0 auto" />

<p><strong>2.</strong> You now see the list of available feeds:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-218.jpg" alt="Screenshot 218" style="display:block;margin:0 auto" />

<p><strong>3.</strong> There are 2 default feeds. Select both and click <strong>"Enable selected"</strong>:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-219.jpg" alt="Screenshot 219" style="display:block;margin:0 auto" />

<p><strong>4.</strong> Confirm by clicking <strong>"Yes"</strong>:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-220.jpg" alt="Screenshot 220" style="display:block;margin:0 auto" />

<p><strong>5.</strong> To check the progress, go to <strong>"Administration"</strong> &gt; <strong>"Jobs"</strong>:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-221.jpg" alt="Screenshot 221" style="display:block;margin:0 auto" />

<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-222.jpg" alt="Screenshot 222" style="display:block;margin:0 auto" />

<p><strong>6.</strong> When it is done, the progress bar shows <strong>"Completed"</strong>. While the feeds are loading, you can already view the downloaded events by clicking "Home" &gt; <strong>"List Events"</strong>:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-223.png" alt="Screenshot 223" style="display:block;margin:0 auto" />

<p>These feeds provide many indicators of compromise: known malware and their hashes, malicious IPs, malicious domains, and more.</p>
<p><strong>7.</strong> To see more details or metadata about an event or IOC, click the eye icon in the last column of the <strong>"List Events"</strong> page:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-224.jpg" alt="Screenshot 224" style="display:block;margin:0 auto" />

<p>You get a lot of useful information:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-225.jpg" alt="Screenshot 225" style="display:block;margin:0 auto" />

<p><strong>8.</strong> You can also do threat modeling in MISP by opening the <strong>"Event Graph"</strong> tab while viewing an event:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-226.jpg" alt="Screenshot 226" style="display:block;margin:0 auto" />

<h3>9.4. Integrating MISP with Cortex</h3>
<p>In this section, we connect MISP to Cortex so that Cortex can query the MISP IOC database through its API.</p>
<p><strong>1.</strong> First, we need to enable the MISP analyzer in Cortex:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-227.png" alt="Screenshot 227" style="display:block;margin:0 auto" />

<p><strong>2.</strong> To enable it, we need a MISP API key. Log in to MISP, go to <strong>"Administration"</strong>, and select <strong>"List Auth Keys"</strong>:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-228.jpg" alt="Screenshot 228" style="display:block;margin:0 auto" />

<p><strong>3.</strong> Click <strong>"Add authentication key"</strong>:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-229.jpg" alt="Screenshot 229" style="display:block;margin:0 auto" />

<p><strong>4.</strong> Fill in the details for your environment, including the IP address allowed to use the key (the Cortex server, in our case <strong>20.0.0.21</strong>). Once you confirm, MISP displays the new API key:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-230.jpg" alt="Screenshot 230" style="display:block;margin:0 auto" />

<p><strong>5.</strong> Make sure you copy this key before leaving the page; it is only shown once:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-231.jpg" alt="Screenshot 231" style="display:block;margin:0 auto" />

<p>When creating the key, we added the comment <strong>"Rest API Integration MISP-CORTEX"</strong>.</p>
<p><strong>6.</strong> Copy the key and paste it into the <strong>"key"</strong> field of the MISP analyzer in Cortex:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-232.jpg" alt="Screenshot 232" style="display:block;margin:0 auto" />

<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-233.jpg" alt="Screenshot 233" style="display:block;margin:0 auto" />

<p><strong>7.</strong> Click <strong>"Save"</strong> to enable the analyzer.</p>
<p>Let's run a quick test to confirm that MISP is properly connected to Cortex.</p>
<p>In Cortex, click <strong>"New Analysis"</strong> in the top-left corner:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-234.jpg" alt="Screenshot 234" style="display:block;margin:0 auto" />

<p><strong>8.</strong> Run a test on the IP <strong>8.8.8.8</strong>. MISP now appears in the list of available analyzers:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-235.jpg" alt="Screenshot 235" style="display:block;margin:0 auto" />

<p><strong>9.</strong> Select it and click <strong>"Start"</strong>:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-236.jpg" alt="Screenshot 236" style="display:block;margin:0 auto" />

<p><strong>10.</strong> The analyzer runs successfully, which confirms the integration works:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-237.jpg" alt="Screenshot 237" style="display:block;margin:0 auto" />

<p><strong>11.</strong> Here are the analyzer's results:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-238.jpg" alt="Screenshot 238" style="display:block;margin:0 auto" />

<p><strong>12.</strong> Now let's run the MISP analyzer from TheHive. We will test it with a malicious domain as the observable.</p>
<p>Start by adding an observable to the <strong>"demo2"</strong> case created earlier:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-239.jpg" alt="Screenshot 239" style="display:block;margin:0 auto" />

<p><strong>13.</strong> Fill in the required information:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-240.jpg" alt="Screenshot 240" style="display:block;margin:0 auto" />

<p><strong>14.</strong> Select the observable you just added and click <strong>"Run analyzers"</strong>:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-241.png" alt="Screenshot 241" style="display:block;margin:0 auto" />

<p><strong>15.</strong> Select MISP from the available analyzers:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-242.jpg" alt="Screenshot 242" style="display:block;margin:0 auto" />

<p><strong>16.</strong> The analysis completes successfully and MISP returns information about the observable:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-243.jpg" alt="Screenshot 243" style="display:block;margin:0 auto" />

<p><strong>17.</strong> Click the result to view the detailed report:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-244.jpg" alt="Screenshot 244" style="display:block;margin:0 auto" />

<p>Next, we integrate the Wazuh SIEM with TheHive.</p>
<h3>9.5. Integrating Wazuh with TheHive</h3>
<h4>Step 1: Install the TheHive Python module with pip</h4>
<p>This Python module is used by the custom integration script we will create in the next step.</p>
<p>Run the following command on the deployment server:</p>
<pre><code class="language-bash">sudo /var/ossec/framework/python/bin/pip3 install thehive4py
</code></pre>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-245.jpg" alt="Screenshot 245" style="display:block;margin:0 auto" />

<h4>Step 2: Create the custom integration script</h4>
<p>Create the script below in <strong>/var/ossec/integrations/</strong> and name it <a href="http://custom-w2thive.py"><strong>custom-w2thive.py</strong></a>. We used nano, but any text editor will do.</p>
<p>In this script, the <code>lvl_threshold</code> variable is set to <code>0</code>, which means <strong>every</strong> alert created by Wazuh is forwarded to TheHive. If you monitor a large number of agents, this can generate a lot of noise; consider raising the threshold so that only more severe alerts are forwarded.</p>
<pre><code class="language-python">#!/var/ossec/framework/python/bin/python3
import json
import sys
import os
import re
import logging
import uuid
from thehive4py.api import TheHiveApi
from thehive4py.models import Alert, AlertArtifact
#start user config
# Global vars
#threshold for wazuh rules level
lvl_threshold=0
#threshold for suricata rules level
suricata_lvl_threshold=3
debug_enabled = False
#info about created alert
info_enabled = True
#end user config
# Set paths
pwd = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
log_file = '{0}/logs/integrations.log'.format(pwd)
logger = logging.getLogger(__name__)
#set logging level
logger.setLevel(logging.WARNING)
if info_enabled:
    logger.setLevel(logging.INFO)
if debug_enabled:
    logger.setLevel(logging.DEBUG)
# create the logging file handler
fh = logging.FileHandler(log_file)
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
fh.setFormatter(formatter)
logger.addHandler(fh)
def main(args):
    logger.debug('#start main')
    logger.debug('#get alert file location')
    alert_file_location = args[1]
    logger.debug('#get TheHive url')
    thive = args[3]
    logger.debug('#get TheHive api key')
    thive_api_key = args[2]
    thive_api = TheHiveApi(thive, thive_api_key )
    logger.debug('#open alert file')
    w_alert = json.load(open(alert_file_location))
    logger.debug('#alert data')
    logger.debug(str(w_alert))
    logger.debug('#gen json to dot-key-text')
    alt = pr(w_alert,'',[])
    logger.debug('#formatting description')
    format_alt = md_format(alt)
    logger.debug('#search artifacts')
    artifacts_dict = artifact_detect(format_alt)
    alert = generate_alert(format_alt, artifacts_dict, w_alert)
    logger.debug('#threshold filtering')
    if w_alert['rule']['groups']==['ids','suricata']:
        #checking the existence of the data.alert.severity field
        if 'data' in w_alert.keys():
            if 'alert' in w_alert['data']:
                #checking the level of the source event
                if int(w_alert['data']['alert']['severity'])&lt;=suricata_lvl_threshold:
                    send_alert(alert, thive_api)
    elif int(w_alert['rule']['level'])&gt;=lvl_threshold:
        #if the event is different from suricata AND suricata-event-type: alert check lvl_threshold
        send_alert(alert, thive_api)
def pr(data,prefix, alt):
    for key,value in data.items():
        if hasattr(value,'keys'):
            pr(value,prefix+'.'+str(key),alt=alt)
        else:
            alt.append((prefix+'.'+str(key)+'|||'+str(value)))
    return alt
def md_format(alt,format_alt=''):
    md_title_dict = {}
    #sorted with first key
    for now in alt:
        now = now[1:]
        #fix first key last symbol
        dot = now.split('|||')[0].find('.')
        if dot==-1:
            md_title_dict[now.split('|||')[0]] =[now]
        else:
            if now[0:dot] in md_title_dict.keys():
                (md_title_dict[now[0:dot]]).append(now)
            else:
                md_title_dict[now[0:dot]]=[now]
    for now in md_title_dict.keys():
        format_alt+='### '+now.capitalize()+'\n'+'| key | val |\n| ------ | ------ |\n'
        for let in md_title_dict[now]:
            key,val = let.split('|||')[0],let.split('|||')[1]
            format_alt+='| **' + key + '** | ' + val + ' |\n'
    return format_alt
def artifact_detect(format_alt):
    artifacts_dict = {}
    artifacts_dict['ip'] = re.findall(r'\d+\.\d+\.\d+\.\d+',format_alt)
    artifacts_dict['url'] = re.findall(r'http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&amp;+]|[!*\(\),]|(?:&lt;a class="embed-card" href="0-9a-fA-F"&gt;0-9a-fA-F&lt;/a&gt;[0-9a-fA-F]))+',format_alt)
    artifacts_dict['domain'] = []
    for now in artifacts_dict['url']:
        artifacts_dict['domain'].append(now.split('//')[1].split('/')[0])
    return artifacts_dict
def generate_alert(format_alt, artifacts_dict,w_alert):
    #generate alert sourceRef
    sourceRef = str(uuid.uuid4())[0:6]
    artifacts = []
    if 'agent' in w_alert.keys():
        if 'ip' not in w_alert['agent'].keys():
            w_alert['agent']['ip']='no agent ip'
    else:
        w_alert['agent'] = {'id':'no agent id', 'name':'no agent name'}
    for key,value in artifacts_dict.items():
        for val in value:
            artifacts.append(AlertArtifact(dataType=key, data=val))
    alert = Alert(title=w_alert['rule']['description'],
            tlp=2,
            tags=['wazuh',
            'rule='+w_alert['rule']['id'],
            'agent_name='+w_alert['agent']['name'],
            'agent_id='+w_alert['agent']['id'],
            'agent_ip='+w_alert['agent']['ip'],],
            description=format_alt ,
            type='wazuh_alert',
            source='wazuh',
            sourceRef=sourceRef,
            artifacts=artifacts,)
    return alert
def send_alert(alert, thive_api):
    response = thive_api.create_alert(alert)
    if response.status_code == 201:
        logger.info('Create TheHive alert: '+ str(response.json()['id']))
    else:
        logger.error('Error create TheHive alert: {}/{}'.format(response.status_code, response.text))
if __name__ == "__main__":
    try:
        logger.debug('debug mode') # if debug enabled
        # Main function
        main(sys.argv)
    except Exception:
        logger.exception('EGOR')
</code></pre>
<p>Create the script in the right location:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-246.jpg" alt="Screenshot 246" style="display:block;margin:0 auto" />

<p>Next, create a bash script called <code>custom-w2thive</code> in the same <strong>/var/ossec/integrations/</strong> folder. Wazuh uses it to run the Python script above:</p>
<p>Here is the bash script:</p>
<pre><code class="language-bash">#!/bin/sh
# Copyright (C) 2015-2020, Wazuh Inc.
# Created by Wazuh, Inc. &lt;info@wazuh.com&gt;.
# This program is free software; you can redistribute it and/or modify it under the terms of GP&gt;
WPYTHON_BIN="framework/python/bin/python3"
SCRIPT_PATH_NAME="$0"
DIR_NAME="$(cd $(dirname ${SCRIPT_PATH_NAME}); pwd -P)"
SCRIPT_NAME="$(basename ${SCRIPT_PATH_NAME})"
case ${DIR_NAME} in
    */active-response/bin | */wodles*)
        if [ -z "${WAZUH_PATH}" ]; then
            WAZUH_PATH="$(cd ${DIR_NAME}/../..; pwd)"
        fi
        PYTHON_SCRIPT="${DIR_NAME}/${SCRIPT_NAME}.py"
        ;;
    */bin)
        if [ -z "${WAZUH_PATH}" ]; then
            WAZUH_PATH="$(cd ${DIR_NAME}/..; pwd)"
        fi
        PYTHON_SCRIPT="${WAZUH_PATH}/framework/scripts/${SCRIPT_NAME}.py"
        ;;
    */integrations)
        if [ -z "${WAZUH_PATH}" ]; then
            WAZUH_PATH="$(cd ${DIR_NAME}/..; pwd)"
        fi
        PYTHON_SCRIPT="${DIR_NAME}/${SCRIPT_NAME}.py"
        ;;
esac
${WAZUH_PATH}/${WPYTHON_BIN} ${PYTHON_SCRIPT} $@
</code></pre>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-247.jpg" alt="Screenshot 247" style="display:block;margin:0 auto" />

<h4>Step 3: Set permissions and ownership</h4>
<p>Make sure Wazuh has the right permissions to run both scripts by running the following commands:</p>
<pre><code class="language-bash">sudo chmod 755 /var/ossec/integrations/custom-w2thive.py
sudo chmod 755 /var/ossec/integrations/custom-w2thive
sudo chown root:wazuh /var/ossec/integrations/custom-w2thive.py
sudo chown root:wazuh /var/ossec/integrations/custom-w2thive
</code></pre>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-248.jpg" alt="Screenshot 248" style="display:block;margin:0 auto" />

<h4>Step 4: Enable the integration in the Wazuh manager configuration</h4>
<p>Open the Wazuh manager configuration file (<code>/var/ossec/etc/ossec.conf</code>) and add the block below. Put your TheHive server address in the <code>&lt;hook_url&gt;</code> tag and your TheHive API key in the <code>&lt;api_key&gt;</code> tag. The block goes inside the <code>&lt;ossec_config&gt;</code> section. Make sure the indentation matches the rest of the file to avoid errors.</p>
<pre><code class="language-xml">&lt;ossec_config&gt;
…
  &lt;integration&gt;
    &lt;name&gt;custom-w2thive&lt;/name&gt;
    &lt;hook_url&gt;http://TheHive_Server_IP:9000&lt;/hook_url&gt;
    &lt;api_key&gt;YOUR_THEHIVE_API_KEY&lt;/api_key&gt;
    &lt;alert_format&gt;json&lt;/alert_format&gt;
  &lt;/integration&gt;
…
&lt;/ossec_config&gt;
</code></pre>
<p>To get the API key, log in to TheHive as an admin, select your organization, and create an API key for the user linked to that organization:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-249.jpg" alt="Screenshot 249" style="display:block;margin:0 auto" />

<p><strong>1.</strong> Click <strong>"Reveal"</strong> after creating the key, then copy and save it. We will use it in the Wazuh–TheHive integration:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-250.png" alt="Screenshot 250" style="display:block;margin:0 auto" />

<p><strong>2.</strong> Here is what the final Wazuh configuration looks like:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-251.png" alt="Screenshot 251" style="display:block;margin:0 auto" />

<p><strong>3.</strong> Once done, restart the Wazuh manager:</p>
<pre><code class="language-bash">sudo systemctl restart wazuh-manager
</code></pre>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-252.jpg" alt="Screenshot 252" style="display:block;margin:0 auto" />

<p><strong>4.</strong> If everything went well, you will soon see Wazuh alerts appear in the <strong>Alerts</strong> tab of TheHive:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-253.png" alt="Screenshot 253" style="display:block;margin:0 auto" />

<p>The integration is complete!</p>
<p>In the next section, we connect TheHive to MISP.</p>
<h3>9.6. Integrating TheHive with MISP</h3>
<p>The goal is to be able to push alerts and cases from TheHive directly to MISP, so nothing gets lost.</p>
<p><strong>1.</strong> On the deployment server, open the file:</p>
<p><code>/etc/thehive/application.conf</code></p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-254.jpg" alt="Screenshot 254" style="display:block;margin:0 auto" />

<p><strong>2.</strong> As with the Cortex integration, go to the MISP configuration section of the file:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-255.png" alt="Screenshot 255" style="display:block;margin:0 auto" />

<p><strong>3.</strong> Fill in the required information. The configuration should look like this:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-256.png" alt="Screenshot 256" style="display:block;margin:0 auto" />

<p><strong>4.</strong> Save your changes and restart TheHive:</p>
<pre><code class="language-bash">systemctl restart thehive
</code></pre>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-257.jpg" alt="Screenshot 257" style="display:block;margin:0 auto" />

<p><strong>5.</strong> Refresh TheHive and open the <strong>"About"</strong> section, as we did for Cortex. MISP is now connected, but an error is displayed next to it:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-258.jpg" alt="Screenshot 258" style="display:block;margin:0 auto" />

<p><strong>6.</strong> To fix this error, TheHive must accept MISP's self-signed certificate. In the same file, <code>/etc/thehive/application.conf</code>, add the following line to the MISP section:</p>
<pre><code class="language-plaintext">wsConfig.ssl.loose.acceptAnyCertificate: true
</code></pre>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-259.png" alt="Screenshot 259" style="display:block;margin:0 auto" />

<p><strong>7.</strong> Restart TheHive again and refresh the page to confirm that the certificate is accepted and the error is gone:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-260.jpg" alt="Screenshot 260" style="display:block;margin:0 auto" />

<p><strong>8.</strong> Next, let's see how to turn important alerts into cases, so analysts can track and handle them properly.</p>
<p>Go to the alerts page in TheHive:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-261.jpg" alt="Screenshot 261" style="display:block;margin:0 auto" />

<p><strong>9.</strong> Select an alert to turn into a case. Here, we use the alert <strong>"Successful sudo to ROOT executed"</strong> and click the <strong>"Import and preview"</strong> icon next to it:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-262.png" alt="Screenshot 262" style="display:block;margin:0 auto" />

<p><strong>10.</strong> The following screen appears:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-263.jpg" alt="Screenshot 263" style="display:block;margin:0 auto" />

<p><strong>11.</strong> Click <strong>"Merge into case"</strong> at the bottom:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-264.jpg" alt="Screenshot 264" style="display:block;margin:0 auto" />

<p><strong>12.</strong> Type the title of an existing case. Here, we choose <strong>"Demo Case"</strong>, created earlier. Select it from the list, then click <strong>"Merge"</strong>:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-265.jpg" alt="Screenshot 265" style="display:block;margin:0 auto" />

<p><strong>13.</strong> The alert has been merged into the case, along with its key information:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-266.jpg" alt="Screenshot 266" style="display:block;margin:0 auto" />

<p><strong>14.</strong> The alert is now part of the case, as shown below after clicking <strong>"Merge"</strong>:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-267.jpg" alt="Screenshot 267" style="display:block;margin:0 auto" />

<p>You can also export a case to MISP, for example to enrich specific alerts further.</p>
<p>To do this, open a case and click <strong>"Export"</strong> in the top-right corner:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-268.jpg" alt="Screenshot 268" style="display:block;margin:0 auto" />

<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-269.jpg" alt="Screenshot 269" style="display:block;margin:0 auto" />

<p><strong>15.</strong> The case has been exported to MISP:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-270.jpg" alt="Screenshot 270" style="display:block;margin:0 auto" />

<p><strong>16.</strong> If, during an investigation, you find a critical IOC that could help others facing the same threat, you can publish it on MISP to share it with the community. Just make sure it does not contain any confidential information:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-271.png" alt="Screenshot 271" style="display:block;margin:0 auto" />

<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-272.jpg" alt="Screenshot 272" style="display:block;margin:0 auto" />

<p><strong>17.</strong> With the SOC environment in place, the next step is onboarding the assets to monitor, by installing Wazuh agents on them.</p>
<p>For this demo, we use one Windows agent and one Linux agent:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-273.jpg" alt="Screenshot 273" style="display:block;margin:0 auto" />

<p><strong>18.</strong> Let's start with the Windows 10 host. Log in to Wazuh and generate the agent deployment script:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-274.jpg" alt="Screenshot 274" style="display:block;margin:0 auto" />

<p><strong>19.</strong> Click <strong>"Deploy new agent"</strong>, then choose the operating system for the agent, in our case Windows:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-275.jpg" alt="Screenshot 275" style="display:block;margin:0 auto" />

<p><strong>20.</strong> Fill in the required information. The screen should look like this:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-276.jpg" alt="Screenshot 276" style="display:block;margin:0 auto" />

<p><strong>21.</strong> Wazuh generates a PowerShell command:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-277.jpg" alt="Screenshot 277" style="display:block;margin:0 auto" />

<p><strong>22.</strong> To enroll the Windows 10 host, log in to it, open PowerShell as Administrator, and run the command:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-278.jpg" alt="Screenshot 278" style="display:block;margin:0 auto" />

<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-279.jpg" alt="Screenshot 279" style="display:block;margin:0 auto" />

<p><strong>23.</strong> The command ran successfully. To start the agent, run:</p>
<pre><code class="language-powershell">NET START WazuhSvc
</code></pre>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-280.png" alt="Screenshot 280" style="display:block;margin:0 auto" />

<p>The Wazuh agent is now running.</p>
<p><strong>24.</strong> Now let's do the same for the Linux host. In Wazuh, change the operating system to generate the Linux deployment command:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-281.jpg" alt="Screenshot 281" style="display:block;margin:0 auto" />

<p><strong>25.</strong> After filling in the required information, the screen looks like this:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-282.png" alt="Screenshot 282" style="display:block;margin:0 auto" />

<p><strong>26.</strong> Copy the generated command and run it on the Linux host as root:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-283.jpg" alt="Screenshot 283" style="display:block;margin:0 auto" />

<p><strong>27.</strong> To start the agent, run the following commands:</p>
<pre><code class="language-bash">sudo systemctl daemon-reload
sudo systemctl enable wazuh-agent
sudo systemctl start wazuh-agent
</code></pre>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-284.jpg" alt="Screenshot 284" style="display:block;margin:0 auto" />

<p><strong>28.</strong> The agent is now running. Let's check Wazuh to confirm that both agents are connected:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-285.jpg" alt="Screenshot 285" style="display:block;margin:0 auto" />

<p><strong>29.</strong> Both agents are listed and active, since both hosts are currently running.</p>
<p>Click <strong>"Inventory"</strong> to see all the system information collected from an agent:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-286.jpg" alt="Screenshot 286" style="display:block;margin:0 auto" />

<h2>10. Installing the Shuffle SOAR</h2>
<p>Shuffle lets us automate the playbooks we define.</p>
<p>For this installation, we deployed a dedicated Ubuntu host on our Proxmox hypervisor to run Shuffle:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-287.jpg" alt="Screenshot 287" style="display:block;margin:0 auto" />

<p><strong>1.</strong> Install the Docker prerequisites. Log in to the Ubuntu host and run the following commands:</p>
<pre><code class="language-bash">sudo apt update
sudo apt install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common
</code></pre>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-288.jpg" alt="Screenshot 288" style="display:block;margin:0 auto" />

<p><strong>2.</strong> Download the Docker installation script:</p>
<pre><code class="language-bash">curl -fsSL https://get.docker.com -o get-docker.sh
</code></pre>
<p><strong>3.</strong> Install Docker:</p>
<pre><code class="language-bash">sh get-docker.sh
</code></pre>
<p><strong>4.</strong> Download docker-compose:</p>
<pre><code class="language-bash">sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
</code></pre>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-289.jpg" alt="Screenshot 289" style="display:block;margin:0 auto" />

<p><strong>5.</strong> Make it executable:</p>
<pre><code class="language-bash">sudo chmod +x /usr/local/bin/docker-compose
</code></pre>
<p><strong>6.</strong> Enable the Docker service:</p>
<pre><code class="language-bash">sudo systemctl enable docker
</code></pre>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-290.jpg" alt="Screenshot 290" style="display:block;margin:0 auto" />

<p><strong>7.</strong> Start the Docker service:</p>
<pre><code class="language-bash">systemctl start docker
</code></pre>
<p><strong>8.</strong> Clone the Shuffle GitHub repository:</p>
<pre><code class="language-bash">git clone https://github.com/frikky/shuffle
</code></pre>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-291.jpg" alt="Screenshot 291" style="display:block;margin:0 auto" />

<p><strong>9.</strong> Go into the Shuffle folder:</p>
<pre><code class="language-bash">cd shuffle/
</code></pre>
<p><strong>10.</strong> Start Shuffle with docker-compose:</p>
<pre><code class="language-bash">sudo docker-compose up -d
</code></pre>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-292.jpg" alt="Screenshot 292" style="display:block;margin:0 auto" />

<p><strong>11.</strong> Apply the following changes so that the OpenSearch database works properly:</p>
<pre><code class="language-bash">sudo sysctl -w vm.max_map_count=262144
sudo chown 1000:1000 -R shuffle-database
</code></pre>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-293.jpg" alt="Screenshot 293" style="display:block;margin:0 auto" />

<p><strong>12.</strong> Restart Shuffle:</p>
<pre><code class="language-bash">sudo docker-compose restart
</code></pre>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-294.jpg" alt="Screenshot 294" style="display:block;margin:0 auto" />

<p>Once the installation is complete, open the web interface to create the administrator account: <a href="http://20.0.0.25:3001">http://20.0.0.25:3001</a> or <a href="https://20.0.0.25:3443">https://20.0.0.25:3443</a></p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-295.jpg" alt="Screenshot 295" style="display:block;margin:0 auto" />

<p><strong>13.</strong> You now have access to the Shuffle interface:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-296.jpg" alt="Screenshot 296" style="display:block;margin:0 auto" />

<p><strong>14.</strong> Log in with the administrator account you created on first access:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/etape-297.jpg" alt="Screenshot 297" style="display:block;margin:0 auto" />

<p>Shuffle is installed and ready to use!</p>
<hr />
<h1>Part 3 — Use Cases in Action</h1>
<h2>11. SOC Use Case Demonstrations</h2>
<p>The SOC is deployed. Now let's prove it works. This part walks through a set of real-world scenarios that show how Wazuh, the core of our SOC, can be configured to <strong>prevent, detect and respond</strong> to threats. Each use case is a realistic scenario you can reproduce in your own lab with a few specific configuration changes.</p>
<h3>11.1. Preparing the lab environment</h3>
<p>Wazuh is made of <strong>agents</strong>, deployed on the monitored endpoints, and <strong>central components</strong>, which collect and analyze the data sent by the agents.</p>
<p>We recommend using virtual machines and taking <strong>snapshots</strong> right after setting up the infrastructure. This way, you can go back to a clean environment before testing each new use case, so tests don't interfere with each other.</p>
<p>The diagram below shows the lab architecture needed to run the use cases in this part:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/usecase-001.jpg" alt="Wazuh lab architecture for the use cases" style="display:block;margin:0 auto" />

<h4>Wazuh central components</h4>
<p>In these use cases, the Wazuh central components (server, indexer and dashboard) run on a single system. A distributed architecture isn't needed to monitor a small environment like this one. Here, we simply use the Wazuh SIEM deployed in Part 2.</p>
<h4>Monitored endpoints</h4>
<p>The Wazuh agent monitors the following endpoints. Depending on the use case, an endpoint plays the role of the <strong>victim</strong> or of the <strong>attacker</strong>.</p>
<table>
<thead>
<tr>
<th>Endpoint</th>
<th>Operating system (64-bit)</th>
<th>CPU</th>
<th>RAM</th>
<th>Disk</th>
</tr>
</thead>
<tbody><tr>
<td>Ubuntu</td>
<td>Ubuntu 22.04 LTS</td>
<td>1 vCPU</td>
<td>2 GB</td>
<td>10 GB</td>
</tr>
<tr>
<td>RHEL</td>
<td>Red Hat Enterprise Linux 9.0 / 8.0</td>
<td>1 vCPU</td>
<td>2 GB</td>
<td>10 GB</td>
</tr>
<tr>
<td>Windows</td>
<td>Windows 11 / 10</td>
<td>2 vCPU</td>
<td>4 GB</td>
<td>25 GB</td>
</tr>
<tr>
<td>Kali Linux</td>
<td>Kali Linux (attacker)</td>
<td>—</td>
<td>—</td>
<td>—</td>
</tr>
</tbody></table>
<p>See section 9.6 (steps 17 to 29) for how to install the Wazuh agent on these endpoints. You need Internet access for some integrations and to download the software used in the use cases.</p>
<blockquote>
<p><strong>Note:</strong> the use cases were run in a dedicated test network (<code>192.168.20.0/24</code>), so the IP addresses in the screenshots differ from those of Part 2. In the commands, replace placeholders such as <code>&lt;UBUNTU_IP&gt;</code> with your own values.</p>
</blockquote>
<h4>The 12 use cases</h4>
<ol>
<li>Blocking a known malicious actor</li>
<li>File integrity monitoring</li>
<li>Detecting a brute-force attack</li>
<li>Monitoring Docker events</li>
<li>Monitoring AWS infrastructure</li>
<li>Detecting unauthorized processes</li>
<li>Network IDS integration</li>
<li>Detecting a SQL injection attack</li>
<li>Detecting suspicious binaries</li>
<li>Detecting and removing malware with VirusTotal</li>
<li>Vulnerability detection</li>
<li>Detecting hidden processes</li>
</ol>
<hr />
<h3>11.2. Use case 1 — Blocking a known malicious actor</h3>
<p>In this use case, we prevent malicious IP addresses from accessing a web server. We set up an Apache web server on an Ubuntu endpoint and try to reach it from an attacker endpoint.</p>
<p>We use a public <strong>IP reputation database</strong>: a list of IP addresses that have been reported as malicious. The attacker endpoint plays the malicious actor, so we add its IP address to that database.</p>
<p>We then configure Wazuh to <strong>block the attacker from reaching the web server for 60 seconds</strong>, a simple way to discourage attackers from continuing.</p>
<p>This use case relies on two Wazuh features: <strong>CDB lists</strong> and <strong>Active Response</strong>.</p>
<p><strong>Infrastructure</strong></p>
<table>
<thead>
<tr>
<th>Endpoint</th>
<th>Description</th>
</tr>
</thead>
<tbody><tr>
<td>Attacker (RHEL 9.0)</td>
<td>Connects to the victim's web server. Its IP address is flagged as malicious using a Wazuh CDB list.</td>
</tr>
<tr>
<td>Ubuntu 22.04 (victim)</td>
<td>Runs an Apache 2.4.54 web server. Wazuh Active Response automatically blocks connections from the attacker.</td>
</tr>
<tr>
<td>Windows 11 (victim)</td>
<td>Runs an Apache 2.4.54 web server. Wazuh Active Response automatically blocks connections from the attacker.</td>
</tr>
</tbody></table>
<h4>Configuration — Ubuntu endpoint</h4>
<p>Install an Apache web server and monitor its logs with the Wazuh agent.</p>
<p><strong>1.1.</strong> Update the local packages and install Apache:</p>
<pre><code class="language-bash">sudo apt update
sudo apt install apache2
</code></pre>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/usecase-002.jpg" alt="Use case screenshot 2" style="display:block;margin:0 auto" />

<p><strong>1.2.</strong> If the firewall is enabled, allow external access to the web ports (skip this step if the firewall is disabled):</p>
<pre><code class="language-bash">sudo ufw status
sudo ufw app list
sudo ufw allow 'Apache'
</code></pre>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/usecase-003.png" alt="Use case screenshot 3" style="display:block;margin:0 auto" />

<p><strong>1.3.</strong> Check that the Apache service is running:</p>
<pre><code class="language-bash">sudo systemctl status apache2
</code></pre>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/usecase-004.jpg" alt="Use case screenshot 4" style="display:block;margin:0 auto" />

<p><strong>1.4.</strong> Use <code>curl</code> (or open the URL in a browser) to display the Apache default page and confirm the installation:</p>
<pre><code class="language-bash">curl http://&lt;UBUNTU_IP&gt;
</code></pre>
<p>You should get a result like this:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/usecase-005.jpg" alt="Use case screenshot 5" style="display:block;margin:0 auto" />

<p><strong>1.5.</strong> Add the following to <code>/var/ossec/etc/ossec.conf</code> so the Wazuh agent monitors the Apache access logs:</p>
<pre><code class="language-xml">&lt;localfile&gt;
  &lt;log_format&gt;syslog&lt;/log_format&gt;
  &lt;location&gt;/var/log/apache2/access.log&lt;/location&gt;
&lt;/localfile&gt;
</code></pre>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/usecase-006.png" alt="Use case screenshot 6" style="display:block;margin:0 auto" />

<p><strong>1.6.</strong> Restart the Wazuh agent to apply the changes:</p>
<pre><code class="language-bash">sudo systemctl restart wazuh-agent
</code></pre>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/usecase-007.jpg" alt="Use case screenshot 7" style="display:block;margin:0 auto" />

<h4>Configuration — Wazuh server</h4>
<p>On the Wazuh server, we add the attacker's IP address to a CDB list, then configure the rules and Active Response.</p>
<p><strong>Download the utilities and set up the CDB list</strong></p>
<p><strong>1.7.</strong> Install <code>wget</code> to download the required files:</p>
<pre><code class="language-bash">sudo apt update &amp;&amp; sudo apt install -y wget
</code></pre>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/usecase-008.jpg" alt="Use case screenshot 8" style="display:block;margin:0 auto" />

<p><strong>1.8.</strong> Download the AlienVault IP reputation database:</p>
<pre><code class="language-bash">sudo wget https://raw.githubusercontent.com/firehol/blocklist-ipsets/master/alienvault_reputation.ipset -O /var/ossec/etc/lists/alienvault_reputation.ipset
</code></pre>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/usecase-009.jpg" alt="Use case screenshot 9" style="display:block;margin:0 auto" />

<p><strong>1.9.</strong> Add the attacker's IP address to the reputation database (replace <code>&lt;ATTACKER_IP&gt;</code> with the attacker's IP):</p>
<pre><code class="language-bash">echo "&lt;ATTACKER_IP&gt;" | sudo tee -a /var/ossec/etc/lists/alienvault_reputation.ipset
</code></pre>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/usecase-010.jpg" alt="Use case screenshot 10" style="display:block;margin:0 auto" />

<p><strong>1.10.</strong> Download a script that converts the <code>.ipset</code> format to the CDB list format:</p>
<pre><code class="language-bash">sudo wget https://wazuh.com/resources/iplist-to-cdblist.py -O /tmp/iplist-to-cdblist.py
</code></pre>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/usecase-011.jpg" alt="Use case screenshot 11" style="display:block;margin:0 auto" />

<p><strong>1.11.</strong> Convert <code>alienvault_reputation.ipset</code> to a CDB list with the script:</p>
<pre><code class="language-bash">sudo python3 /tmp/iplist-to-cdblist.py /var/ossec/etc/lists/alienvault_reputation.ipset /var/ossec/etc/lists/blacklist-alienvault
</code></pre>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/usecase-012.jpg" alt="Use case screenshot 12" style="display:block;margin:0 auto" />

<p><strong>1.12.</strong> Optional: remove the <code>.ipset</code> file and the script, which are no longer needed:</p>
<pre><code class="language-bash">sudo rm -rf /var/ossec/etc/lists/alienvault_reputation.ipset
sudo rm -rf /tmp/iplist-to-cdblist.py
</code></pre>
<p><strong>1.13.</strong> Set the right ownership on the generated file:</p>
<pre><code class="language-bash">sudo chown wazuh:wazuh /var/ossec/etc/lists/blacklist-alienvault
</code></pre>
<p><strong>Configure Active Response to block the malicious IP</strong></p>
<p>Add a custom rule that triggers a Wazuh Active Response script. Add it to the custom ruleset file on the Wazuh server, <code>/var/ossec/etc/rules/local_rules.xml</code>:</p>
<pre><code class="language-xml">&lt;group name="attack,"&gt;
  &lt;rule id="100100" level="10"&gt;
    &lt;if_group&gt;web|attack|attacks&lt;/if_group&gt;
    &lt;list field="srcip" lookup="address_match_key"&gt;etc/lists/blacklist-alienvault&lt;/list&gt;
    &lt;description&gt;IP address found in AlienVault reputation database.&lt;/description&gt;
  &lt;/rule&gt;
&lt;/group&gt;
</code></pre>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/usecase-013.png" alt="Use case screenshot 13" style="display:block;margin:0 auto" />

<p><strong>1.14.</strong> Edit the Wazuh server configuration file, <code>/var/ossec/etc/ossec.conf</code>, and add the list to the <code>&lt;ruleset&gt;</code> section:</p>
<pre><code class="language-xml">&lt;ossec_config&gt;
  &lt;ruleset&gt;
    &lt;!-- Default ruleset --&gt;
    &lt;decoder_dir&gt;ruleset/decoders&lt;/decoder_dir&gt;
    &lt;rule_dir&gt;ruleset/rules&lt;/rule_dir&gt;
    &lt;rule_exclude&gt;0215-policy_rules.xml&lt;/rule_exclude&gt;
    &lt;list&gt;etc/lists/audit-keys&lt;/list&gt;
    &lt;list&gt;etc/lists/amazon/aws-eventnames&lt;/list&gt;
    &lt;list&gt;etc/lists/security-eventchannel&lt;/list&gt;
    &lt;list&gt;etc/lists/blacklist-alienvault&lt;/list&gt;

    &lt;!-- User-defined ruleset --&gt;
    &lt;decoder_dir&gt;etc/decoders&lt;/decoder_dir&gt;
    &lt;rule_dir&gt;etc/rules&lt;/rule_dir&gt;
  &lt;/ruleset&gt;
&lt;/ossec_config&gt;
</code></pre>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/usecase-014.png" alt="Use case screenshot 14" style="display:block;margin:0 auto" />

<p><strong>1.15.</strong> Add the Active Response block to the same file, <code>/var/ossec/etc/ossec.conf</code>.</p>
<p><em>For the Ubuntu endpoint:</em> the <code>firewall-drop</code> command works with the local iptables firewall and drops incoming connections from the attacker for 60 seconds:</p>
<pre><code class="language-xml">&lt;ossec_config&gt;
  &lt;active-response&gt;
    &lt;command&gt;firewall-drop&lt;/command&gt;
    &lt;location&gt;local&lt;/location&gt;
    &lt;rules_id&gt;100100&lt;/rules_id&gt;
    &lt;timeout&gt;60&lt;/timeout&gt;
  &lt;/active-response&gt;
&lt;/ossec_config&gt;
</code></pre>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/usecase-015.jpg" alt="Use case screenshot 15" style="display:block;margin:0 auto" />

<p><strong>1.16.</strong> Restart the Wazuh manager to apply the changes:</p>
<pre><code class="language-bash">sudo systemctl restart wazuh-manager
</code></pre>
<h4>Attack emulation</h4>
<p>From the attacker endpoint, access the web server (replace <code>&lt;WEBSERVER_IP&gt;</code> with the right value):</p>
<pre><code class="language-bash">curl http://&lt;WEBSERVER_IP&gt;
</code></pre>
<p>The first connection goes through. After that, Wazuh Active Response temporarily blocks every new connection from the attacker for 60 seconds.</p>
<h4>Viewing the alerts</h4>
<p>You can view the alert data in the Wazuh dashboard: open the <strong>Threat Hunting</strong> module and add filters in the search bar to query the alerts.</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/usecase-016.jpg" alt="Use case screenshot 16" style="display:block;margin:0 auto" />

<hr />
<h3>11.3. Use case 2 — File integrity monitoring (FIM)</h3>
<p>File Integrity Monitoring (FIM) helps you audit sensitive files and meet regulatory compliance requirements. Wazuh has a built-in FIM module that watches the file system for file <strong>creation, modification and deletion</strong>.</p>
<p>In this use case, the Wazuh FIM module detects changes in monitored directories on an Ubuntu endpoint. It also enriches the alerts with information about the user and process behind each change, using <strong>who-data</strong> auditing.</p>
<p><strong>Infrastructure</strong></p>
<table>
<thead>
<tr>
<th>Endpoint</th>
<th>Description</th>
</tr>
</thead>
<tbody><tr>
<td>Ubuntu 22.04</td>
<td>The Wazuh FIM module monitors a directory on this endpoint to detect file creation, changes and deletion.</td>
</tr>
<tr>
<td>Windows 11</td>
<td>The Wazuh FIM module monitors a directory on this endpoint to detect file creation, changes and deletion.</td>
</tr>
</tbody></table>
<h4>Configuration — Ubuntu endpoint</h4>
<p>Configure the Wazuh agent to monitor file system changes in the <code>/root</code> directory.</p>
<p><strong>2.1.</strong> Edit the Wazuh agent configuration file, <code>/var/ossec/etc/ossec.conf</code>, and add the directory to monitor inside the <code>&lt;syscheck&gt;</code> block. <code>report_changes</code> and <code>realtime</code> give you details on what changed, as soon as it changes:</p>
<pre><code class="language-xml">&lt;directories check_all="yes" report_changes="yes" realtime="yes"&gt;/root&lt;/directories&gt;
</code></pre>
<blockquote>
<p>You can monitor any path you like in this block.</p>
</blockquote>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/usecase-017.jpg" alt="Use case screenshot 17" style="display:block;margin:0 auto" />

<p><strong>2.2.</strong> Restart the Wazuh agent to apply the changes:</p>
<pre><code class="language-bash">sudo systemctl restart wazuh-agent
</code></pre>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/usecase-018.jpg" alt="Use case screenshot 18" style="display:block;margin:0 auto" />

<h4>Testing the configuration</h4>
<ul>
<li>Create a text file in the monitored directory, then wait 5 seconds.</li>
<li>Add some content to the file and save it. Wait 5 seconds.</li>
<li>Delete the file from the monitored directory.</li>
</ul>
<h4>Viewing the alerts</h4>
<p>Open the <strong>File Integrity Monitoring</strong> module in the Wazuh dashboard and add filters in the search bar to query the alerts:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/usecase-019.jpg" alt="Use case screenshot 19" style="display:block;margin:0 auto" />

<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/usecase-020.jpg" alt="Use case screenshot 20" style="display:block;margin:0 auto" />

<p>You can see the file being created, then modified, then deleted!</p>
<hr />
<h3>11.4. Use case 3 — Detecting a brute-force attack</h3>
<p>Brute-forcing is a common way for attackers to gain unauthorized access to endpoints and services. Services such as <strong>SSH</strong> on Linux and <strong>RDP</strong> on Windows are frequent targets. Wazuh detects brute-force attacks by <strong>correlating multiple failed authentication events</strong>.</p>
<p>Use case 1 showed how to block an attacker's IP with Active Response. Here, we show how Wazuh detects brute-force attacks against our endpoints.</p>
<p><strong>Infrastructure</strong></p>
<table>
<thead>
<tr>
<th>Endpoint</th>
<th>Description</th>
</tr>
</thead>
<tbody><tr>
<td>Kali Linux (attacker)</td>
<td>Runs the brute-force attacks. Needs an SSH client.</td>
</tr>
<tr>
<td>Ubuntu 22.04 (victim)</td>
<td>Target of SSH brute-force attacks. Needs an SSH server installed and enabled.</td>
</tr>
<tr>
<td>Windows 10 (victim)</td>
<td>Target of RDP brute-force attacks. Needs RDP enabled.</td>
</tr>
</tbody></table>
<h4>Configuration</h4>
<p>On the attacker endpoint (Kali), install <strong>Hydra</strong>, which we will use to run the brute-force attack:</p>
<p><strong>3.1.</strong> Install Hydra:</p>
<pre><code class="language-bash">sudo apt update
sudo apt install -y hydra
</code></pre>
<h4>Attack emulation — SSH (Ubuntu)</h4>
<ul>
<li>Create a text file containing 10 random passwords.</li>
<li>Run Hydra against the Ubuntu endpoint (replace <code>&lt;UBUNTU_IP&gt;</code> with its IP address):</li>
</ul>
<pre><code class="language-bash">sudo hydra -l badguy -P &lt;PASSWD_LIST.txt&gt; &lt;UBUNTU_IP&gt; ssh
</code></pre>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/usecase-021.jpg" alt="Use case screenshot 21" style="display:block;margin:0 auto" />

<p>Wazuh detects the attack, and the alerts include information about the attacker:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/usecase-022.png" alt="Use case screenshot 22" style="display:block;margin:0 auto" />

<h4>Attack emulation — RDP (Windows)</h4>
<p>Now let's try an RDP brute-force against the Windows endpoint. Run Hydra from the attacker, replacing <code>&lt;WINDOWS_IP&gt;</code> with the Windows endpoint's IP:</p>
<pre><code class="language-bash">sudo hydra -l badguy -P &lt;PASSWD_LIST.txt&gt; rdp://&lt;WINDOWS_IP&gt;
</code></pre>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/usecase-023.jpg" alt="Use case screenshot 23" style="display:block;margin:0 auto" />

<p>Here is what Wazuh detects:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/usecase-024.jpg" alt="Use case screenshot 24" style="display:block;margin:0 auto" />

<p>The RDP brute-force attack is detected by the SIEM as well.</p>
<hr />
<h3>11.5. Use case 4 — Monitoring Docker events</h3>
<p>Docker automates the deployment of applications inside software containers. The Wazuh Docker module detects security incidents in containers and alerts in real time. Here, we configure Wazuh to monitor Docker events on an Ubuntu endpoint that hosts containers.</p>
<p><strong>Infrastructure</strong></p>
<table>
<thead>
<tr>
<th>Endpoint</th>
<th>Description</th>
</tr>
</thead>
<tbody><tr>
<td>Ubuntu 22.04</td>
<td>The Docker host where you create and delete containers.</td>
</tr>
</tbody></table>
<h4>Configuration</h4>
<p><strong>4.1.</strong> Install Python and pip:</p>
<pre><code class="language-bash">sudo apt install python3 python3-pip
</code></pre>
<p><strong>4.2.</strong> Upgrade pip:</p>
<pre><code class="language-bash">pip3 install --upgrade pip
</code></pre>
<p><strong>4.3.</strong> Install Docker and the Docker Python library:</p>
<pre><code class="language-bash">curl -sSL https://get.docker.com/ | sh
sudo pip3 install docker==7.1.0 urllib3==2.2.2 requests==2.32.2 --break-system-packages
</code></pre>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/usecase-025.jpg" alt="Use case screenshot 25" style="display:block;margin:0 auto" />

<p><strong>4.4.</strong> Edit the Wazuh agent configuration file, <code>/var/ossec/etc/ossec.conf</code>, and add this block to enable the <code>docker-listener</code> module:</p>
<pre><code class="language-xml">&lt;ossec_config&gt;
  &lt;wodle name="docker-listener"&gt;
    &lt;interval&gt;10m&lt;/interval&gt;
    &lt;attempts&gt;5&lt;/attempts&gt;
    &lt;run_on_start&gt;yes&lt;/run_on_start&gt;
    &lt;disabled&gt;no&lt;/disabled&gt;
  &lt;/wodle&gt;
&lt;/ossec_config&gt;
</code></pre>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/usecase-026.jpg" alt="Use case screenshot 26" style="display:block;margin:0 auto" />

<p><strong>4.5.</strong> Restart the Wazuh agent to apply the changes:</p>
<pre><code class="language-bash">sudo systemctl restart wazuh-agent
</code></pre>
<h4>Testing the configuration</h4>
<p>Perform several Docker actions: pull an image, start a container, run some commands inside it, then remove it.</p>
<ul>
<li>Pull an image, such as NGINX, and run a container:</li>
</ul>
<pre><code class="language-bash">sudo docker pull nginx
sudo docker run -d -P --name nginx_container nginx
sudo docker exec -it nginx_container cat /etc/passwd
sudo docker exec -it nginx_container /bin/bash
exit
</code></pre>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/usecase-027.jpg" alt="Use case screenshot 27" style="display:block;margin:0 auto" />

<ul>
<li>Stop and remove the container:</li>
</ul>
<pre><code class="language-bash">sudo docker stop nginx_container
sudo docker rm nginx_container
</code></pre>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/usecase-028.jpg" alt="Use case screenshot 28" style="display:block;margin:0 auto" />

<h4>Viewing the alerts</h4>
<p>Open the <strong>Docker</strong> module in the Wazuh dashboard:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/usecase-029.jpg" alt="Use case screenshot 29" style="display:block;margin:0 auto" />

<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/usecase-030.jpg" alt="Use case screenshot 30" style="display:block;margin:0 auto" />

<p>Wazuh tracks the container in real time, from its creation to its removal!</p>
<hr />
<h3>11.6. Use case 5 — Monitoring AWS infrastructure</h3>
<p>This use case shows how the Wazuh AWS module (<code>aws-s3</code>) collects log data from AWS services, here <strong>Amazon CloudTrail</strong>.</p>
<p><strong>Infrastructure</strong></p>
<table>
<thead>
<tr>
<th>Cloud service</th>
<th>Description</th>
</tr>
</thead>
<tbody><tr>
<td>Amazon CloudTrail</td>
<td>Like the other supported AWS services, CloudTrail requires the right policies for user permissions and a valid authentication method. In this PoC, we use <strong>profile</strong> authentication.</td>
</tr>
</tbody></table>
<h4>Configuration — CloudTrail</h4>
<p><strong>5.1.</strong> Open the CloudTrail service from the AWS console:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/usecase-031.jpg" alt="Use case screenshot 31" style="display:block;margin:0 auto" />

<p><strong>5.2.</strong> Create a new trail:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/usecase-032.jpg" alt="Use case screenshot 32" style="display:block;margin:0 auto" />

<p><strong>5.3.</strong> Either create a new S3 bucket or choose an existing one to store the CloudTrail logs. <strong>Write down the bucket name</strong>: you will need it in the Wazuh configuration.</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/usecase-033.png" alt="Use case screenshot 33" style="display:block;margin:0 auto" />

<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/usecase-034.jpg" alt="Use case screenshot 34" style="display:block;margin:0 auto" />

<p><strong>5.4.</strong> On the Wazuh server, add the <code>aws-s3</code> module to <code>/var/ossec/etc/ossec.conf</code>, with your bucket name and AWS profile:</p>
<pre><code class="language-xml">&lt;ossec_config&gt;
  &lt;wodle name="aws-s3"&gt;
    &lt;disabled&gt;no&lt;/disabled&gt;
    &lt;interval&gt;10m&lt;/interval&gt;
    &lt;run_on_start&gt;yes&lt;/run_on_start&gt;
    &lt;skip_on_error&gt;yes&lt;/skip_on_error&gt;
    &lt;bucket type="cloudtrail"&gt;
      &lt;name&gt;&lt;AWS_BUCKET_NAME&gt;&lt;/name&gt;
      &lt;aws_profile&gt;&lt;AWS_PROFILE_NAME&gt;&lt;/aws_profile&gt;
    &lt;/bucket&gt;
  &lt;/wodle&gt;
&lt;/ossec_config&gt;
</code></pre>
<p><strong>5.5.</strong> Restart the Wazuh manager. AWS monitoring alerts now appear in the dashboard:</p>
<pre><code class="language-bash">sudo systemctl restart wazuh-manager
</code></pre>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/usecase-035.jpg" alt="Use case screenshot 35" style="display:block;margin:0 auto" />

<hr />
<h3>11.7. Use case 6 — Detecting unauthorized processes</h3>
<p>The Wazuh <strong>command monitoring</strong> feature runs commands on an endpoint and monitors their output.</p>
<p>In this use case, we use it to detect when <strong>Netcat</strong> is running on an Ubuntu endpoint. Netcat is a networking utility often used for port scanning and listening, and a classic tool for attackers.</p>
<p><strong>Infrastructure</strong></p>
<table>
<thead>
<tr>
<th>Endpoint</th>
<th>Description</th>
</tr>
</thead>
<tbody><tr>
<td>Ubuntu 22.04</td>
<td>We configure Wazuh command monitoring on this endpoint to detect a running Netcat process.</td>
</tr>
</tbody></table>
<h4>Configuration — Ubuntu endpoint</h4>
<p>Configure command monitoring to periodically list all running processes on the Ubuntu endpoint.</p>
<p><strong>6.1.</strong> Add the following block to the Wazuh agent configuration file, <code>/var/ossec/etc/ossec.conf</code>. It collects the list of running processes every 30 seconds:</p>
<pre><code class="language-xml">&lt;ossec_config&gt;
  &lt;localfile&gt;
    &lt;log_format&gt;full_command&lt;/log_format&gt;
    &lt;alias&gt;process list&lt;/alias&gt;
    &lt;command&gt;ps -e -o pid,uname,command&lt;/command&gt;
    &lt;frequency&gt;30&lt;/frequency&gt;
  &lt;/localfile&gt;
&lt;/ossec_config&gt;
</code></pre>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/usecase-036.png" alt="Use case screenshot 36" style="display:block;margin:0 auto" />

<p><strong>6.2.</strong> Restart the Wazuh agent to apply the changes:</p>
<pre><code class="language-bash">sudo systemctl restart wazuh-agent
</code></pre>
<p><strong>6.3.</strong> Install Netcat and its dependencies:</p>
<pre><code class="language-bash">sudo apt install ncat nmap -y
</code></pre>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/usecase-037.jpg" alt="Use case screenshot 37" style="display:block;margin:0 auto" />

<h4>Configuration — Wazuh server</h4>
<p>Create a rule that fires every time Netcat is launched.</p>
<p><strong>6.4.</strong> Add the following rules to <code>/var/ossec/etc/rules/local_rules.xml</code> on the Wazuh server:</p>
<pre><code class="language-xml">&lt;group name="ossec,"&gt;
  &lt;rule id="100050" level="0"&gt;
    &lt;if_sid&gt;530&lt;/if_sid&gt;
    &lt;match&gt;^ossec: output: 'process list'&lt;/match&gt;
    &lt;description&gt;List of running processes.&lt;/description&gt;
    &lt;group&gt;process_monitor,&lt;/group&gt;
  &lt;/rule&gt;

  &lt;rule id="100051" level="7" ignore="900"&gt;
    &lt;if_sid&gt;100050&lt;/if_sid&gt;
    &lt;match&gt;nc -l&lt;/match&gt;
    &lt;description&gt;netcat listening for incoming connections.&lt;/description&gt;
    &lt;group&gt;process_monitor,&lt;/group&gt;
  &lt;/rule&gt;
&lt;/group&gt;
</code></pre>
<p><strong>6.5.</strong> Restart the Wazuh manager to apply the changes:</p>
<pre><code class="language-bash">sudo systemctl restart wazuh-manager
</code></pre>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/usecase-038.jpg" alt="Use case screenshot 38" style="display:block;margin:0 auto" />

<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/usecase-039.jpg" alt="Use case screenshot 39" style="display:block;margin:0 auto" />

<h4>Attack emulation</h4>
<p>On the monitored Ubuntu endpoint, run Netcat for 30 seconds:</p>
<pre><code class="language-bash">nc -l 8000
</code></pre>
<h4>Viewing the alerts</h4>
<p>Open the <strong>Threat Hunting</strong> module in the Wazuh dashboard and filter the alerts (for example <code>rule.id:100051</code>):</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/usecase-040.jpg" alt="Use case screenshot 40" style="display:block;margin:0 auto" />

<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/usecase-041.jpg" alt="Use case screenshot 41" style="display:block;margin:0 auto" />

<hr />
<h3>11.8. Use case 7 — Network IDS integration</h3>
<p>Wazuh integrates with a network-based intrusion detection system (NIDS) to improve threat detection by monitoring and analyzing network traffic.</p>
<p>In this use case, we integrate <strong>Suricata</strong> with Wazuh. Suricata's network traffic inspection gives extra visibility into what's happening on your network.</p>
<p><strong>Infrastructure</strong></p>
<table>
<thead>
<tr>
<th>Endpoint</th>
<th>Description</th>
</tr>
</thead>
<tbody><tr>
<td>Ubuntu 22.04</td>
<td>The endpoint where we install Suricata. Wazuh monitors and analyzes the network traffic it sees.</td>
</tr>
</tbody></table>
<h4>Configuration</h4>
<p>Set up Suricata on the Ubuntu endpoint and send its logs to the Wazuh server.</p>
<p><strong>7.1.</strong> Install Suricata on the Ubuntu endpoint (we tested this with version 6.0.8; it may take a while):</p>
<pre><code class="language-bash">sudo add-apt-repository ppa:oisf/suricata-stable
sudo apt-get update
sudo apt-get install suricata -y
</code></pre>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/usecase-042.jpg" alt="Use case screenshot 42" style="display:block;margin:0 auto" />

<p><strong>7.2.</strong> Download and extract the Emerging Threats ruleset for Suricata:</p>
<pre><code class="language-bash">cd /tmp/ &amp;&amp; curl -LO https://rules.emergingthreats.net/open/suricata-6.0.8/emerging.rules.tar.gz
sudo tar -xvzf emerging.rules.tar.gz &amp;&amp; sudo mkdir /etc/suricata/rules &amp;&amp; sudo mv rules/*.rules /etc/suricata/rules/
sudo chmod 640 /etc/suricata/rules/*.rules
</code></pre>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/usecase-043.jpg" alt="Use case screenshot 43" style="display:block;margin:0 auto" />

<p><strong>7.3.</strong> Edit the Suricata settings in <code>/etc/suricata/suricata.yaml</code> and set the following variables (use your own network interface name for <code>af-packet</code>):</p>
<pre><code class="language-yaml">HOME_NET: "&lt;UBUNTU_IP&gt;"
EXTERNAL_NET: "any"

default-rule-path: /etc/suricata/rules
rule-files:
  - "*.rules"

# Global stats configuration
stats:
  enabled: yes

# Linux high speed capture support
af-packet:
  - interface: enp0s3
</code></pre>
<p><strong>7.4.</strong> Restart Suricata:</p>
<pre><code class="language-bash">sudo systemctl restart suricata
</code></pre>
<p><strong>7.5.</strong> Add the following to the Wazuh agent configuration file, <code>/var/ossec/etc/ossec.conf</code>, so the agent reads Suricata's log file:</p>
<pre><code class="language-xml">&lt;ossec_config&gt;
  &lt;localfile&gt;
    &lt;log_format&gt;json&lt;/log_format&gt;
    &lt;location&gt;/var/log/suricata/eve.json&lt;/location&gt;
  &lt;/localfile&gt;
&lt;/ossec_config&gt;
</code></pre>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/usecase-044.png" alt="Use case screenshot 44" style="display:block;margin:0 auto" />

<p><strong>7.6.</strong> Restart the Wazuh agent to apply the changes:</p>
<pre><code class="language-bash">sudo systemctl restart wazuh-agent
</code></pre>
<h4>Attack emulation</h4>
<p>Wazuh automatically parses <code>/var/log/suricata/eve.json</code> and generates the related alerts in the dashboard.</p>
<p>Ping the Ubuntu endpoint from the Wazuh server:</p>
<pre><code class="language-bash">ping -c 20 "&lt;UBUNTU_IP&gt;"
</code></pre>
<h4>Viewing the alerts</h4>
<p>Open the <strong>Threat Hunting</strong> module and filter the alerts:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/usecase-045.jpg" alt="Use case screenshot 45" style="display:block;margin:0 auto" />

<p>The SIEM now sees and detects network flows!</p>
<hr />
<h3>11.9. Use case 8 — Detecting a SQL injection attack</h3>
<p>Wazuh can detect SQL injection attacks from web server logs that contain patterns such as <code>select</code>, <code>union</code> and other common SQL injection patterns.</p>
<p>SQL injection is an attack where a malicious actor inserts malicious code into strings that are passed to a database server for parsing and execution. A successful SQL injection gives unauthorized access to the confidential data stored in the database.</p>
<p>In this use case, we simulate a SQL injection attack against the Ubuntu endpoint and detect it with Wazuh.</p>
<p><strong>Infrastructure</strong></p>
<table>
<thead>
<tr>
<th>Endpoint</th>
<th>Description</th>
</tr>
</thead>
<tbody><tr>
<td>Ubuntu 22.04 (victim)</td>
<td>Runs an Apache 2.4.54 web server.</td>
</tr>
<tr>
<td>RHEL 8.0 (attacker)</td>
<td>Launches the SQL injection attack.</td>
</tr>
</tbody></table>
<h4>Configuration — Ubuntu endpoint</h4>
<p>Install Apache and configure the Wazuh agent to monitor the Apache logs.</p>
<p><strong>8.1.</strong> Update the local packages and install Apache:</p>
<pre><code class="language-bash">sudo apt update
sudo apt install apache2
</code></pre>
<p><strong>8.2.</strong> If the firewall is enabled, allow external access to the web ports (skip this step if it is disabled):</p>
<pre><code class="language-bash">sudo ufw app list
sudo ufw allow 'Apache'
sudo ufw status
</code></pre>
<p><strong>8.3.</strong> Check that the Apache service is running:</p>
<pre><code class="language-bash">sudo systemctl status apache2
</code></pre>
<p><strong>8.4.</strong> Use <code>curl</code> (or open the URL in a browser) to display the Apache default page:</p>
<pre><code class="language-bash">curl http://&lt;UBUNTU_IP&gt;
</code></pre>
<p><strong>8.5.</strong> Add the following to the Wazuh agent configuration file, <code>/var/ossec/etc/ossec.conf</code>, so the agent monitors the Apache access logs:</p>
<pre><code class="language-xml">&lt;ossec_config&gt;
  &lt;localfile&gt;
    &lt;log_format&gt;apache&lt;/log_format&gt;
    &lt;location&gt;/var/log/apache2/access.log&lt;/location&gt;
  &lt;/localfile&gt;
&lt;/ossec_config&gt;
</code></pre>
<p><strong>8.6.</strong> Restart the Wazuh agent to apply the changes:</p>
<pre><code class="language-bash">sudo systemctl restart wazuh-agent
</code></pre>
<h4>Attack emulation</h4>
<p>From the attacker endpoint, run the following command (replace <code>&lt;UBUNTU_IP&gt;</code> with the right IP):</p>
<pre><code class="language-bash">curl -XGET "http://&lt;UBUNTU_IP&gt;/users/?id=SELECT+*+FROM+users";
</code></pre>
<p>The expected result is an alert with rule ID <strong>31103</strong>; a <em>successful</em> SQL injection attempt generates an alert with rule ID <strong>31106</strong>.</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/usecase-046.jpg" alt="Use case screenshot 46" style="display:block;margin:0 auto" />

<p>In our case, since we had already added the attacker's IP to the CDB list in use case 1, the request was also flagged as coming from an IP with a bad reputation!</p>
<hr />
<h3>11.10. Use case 9 — Detecting suspicious binaries</h3>
<p>Wazuh has anomaly and malware detection capabilities that spot suspicious binaries on an endpoint. Binaries are executable code; attackers often tamper with them to run malicious code while avoiding detection.</p>
<p>In this use case, the Wazuh <strong>rootcheck</strong> module detects a <strong>trojaned system binary</strong> on an Ubuntu endpoint. We perform the exploit by replacing the content of a legitimate binary with malicious code, so the endpoint runs it as if it were the original.</p>
<p>The rootcheck module also checks for hidden processes, ports and files.</p>
<p><strong>Infrastructure</strong></p>
<table>
<thead>
<tr>
<th>Endpoint</th>
<th>Description</th>
</tr>
</thead>
<tbody><tr>
<td>Ubuntu 22.04</td>
<td>The Wazuh rootcheck module detects a suspicious binary on this endpoint.</td>
</tr>
</tbody></table>
<h4>Configuration</h4>
<p>The rootcheck module is enabled by default in the Wazuh agent configuration. Check the <code>&lt;rootcheck&gt;</code> block in <code>/var/ossec/etc/ossec.conf</code> on the monitored endpoint and make sure it looks like this:</p>
<pre><code class="language-xml">&lt;rootcheck&gt;
  &lt;disabled&gt;no&lt;/disabled&gt;
  &lt;check_files&gt;yes&lt;/check_files&gt;

  &lt;!-- Line for trojans detection --&gt;
  &lt;check_trojans&gt;yes&lt;/check_trojans&gt;

  &lt;check_dev&gt;yes&lt;/check_dev&gt;
  &lt;check_sys&gt;yes&lt;/check_sys&gt;
  &lt;check_pids&gt;yes&lt;/check_pids&gt;
  &lt;check_ports&gt;yes&lt;/check_ports&gt;
  &lt;check_if&gt;yes&lt;/check_if&gt;

  &lt;!-- Frequency that rootcheck is executed - every 12 hours --&gt;
  &lt;frequency&gt;43200&lt;/frequency&gt;
  &lt;rootkit_files&gt;/var/ossec/etc/shared/rootkit_files.txt&lt;/rootkit_files&gt;
  &lt;rootkit_trojans&gt;/var/ossec/etc/shared/rootkit_trojans.txt&lt;/rootkit_trojans&gt;
  &lt;skip_nfs&gt;yes&lt;/skip_nfs&gt;
&lt;/rootcheck&gt;
</code></pre>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/usecase-047.png" alt="Use case screenshot 47" style="display:block;margin:0 auto" />

<h4>Attack emulation</h4>
<ul>
<li>Make a copy of the original system binary:</li>
</ul>
<pre><code class="language-bash">sudo cp -p /usr/bin/w /usr/bin/w.copy
</code></pre>
<ul>
<li>Replace the original <code>/usr/bin/w</code> binary with the following shell script:</li>
</ul>
<pre><code class="language-bash">sudo tee /usr/bin/w &lt;&lt; EOF
#!/bin/bash
echo "`date` this is evil" &gt; /tmp/trojan_created_file
echo 'test for /usr/bin/w trojaned file' &gt;&gt; /tmp/trojan_created_file
#Now running original binary
/usr/bin/w.copy
EOF
</code></pre>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/usecase-048.jpg" alt="Use case screenshot 48" style="display:block;margin:0 auto" />

<ul>
<li>By default, the rootcheck scan runs every 12 hours. Force a scan by restarting the Wazuh agent:</li>
</ul>
<pre><code class="language-bash">sudo systemctl restart wazuh-agent
</code></pre>
<h4>Viewing the alerts</h4>
<p>Open the <strong>Threat Hunting</strong> module and filter the alerts with:</p>
<pre><code class="language-plaintext">location:rootcheck AND rule.id:510 AND data.title:Trojaned version of file detected.
</code></pre>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/usecase-049.jpg" alt="Use case screenshot 49" style="display:block;margin:0 auto" />

<hr />
<h3>11.11. Use case 10 — Detecting and removing malware with VirusTotal</h3>
<p>Wazuh uses its integration module to connect to external APIs and alerting tools such as <strong>VirusTotal</strong>.</p>
<p>In this use case, the Wazuh FIM module monitors a directory for changes, and the VirusTotal API scans the files in that directory. We then configure Wazuh to trigger an <strong>Active Response</strong> script that <strong>deletes any file VirusTotal flags as malicious</strong>.</p>
<p>You need a VirusTotal API key so Wazuh can authenticate with the VirusTotal API.</p>
<p><strong>Infrastructure</strong></p>
<table>
<thead>
<tr>
<th>Endpoint</th>
<th>Description</th>
</tr>
</thead>
<tbody><tr>
<td>Ubuntu 22.04</td>
<td>The Linux endpoint where you download a malicious file. Wazuh triggers an Active Response script to delete it once VirusTotal flags it as malicious.</td>
</tr>
<tr>
<td>Windows 11</td>
<td>The Windows endpoint where you download a malicious file. Wazuh triggers an Active Response script to delete it once VirusTotal flags it as malicious.</td>
</tr>
</tbody></table>
<h4>Configuration — Ubuntu endpoint</h4>
<p>These steps configure Wazuh to monitor the <code>/root</code> directory in near real time, install the required packages, and create the Active Response script that removes malicious files. They also work on other Linux distributions.</p>
<p><strong>10.1.</strong> In the Wazuh agent configuration file, <code>/var/ossec/etc/ossec.conf</code>, find the <code>&lt;syscheck&gt;</code> block and make sure <code>&lt;disabled&gt;</code> is set to <code>no</code>. This enables Wazuh FIM.</p>
<p><strong>10.2.</strong> Inside the <code>&lt;syscheck&gt;</code> block, add an entry to monitor the <code>/root</code> directory in near real time:</p>
<pre><code class="language-xml">&lt;directories realtime="yes"&gt;/root&lt;/directories&gt;
</code></pre>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/usecase-050.jpg" alt="Use case screenshot 50" style="display:block;margin:0 auto" />

<p><strong>10.3.</strong> Install <code>jq</code>, which the Active Response script uses to parse JSON input:</p>
<pre><code class="language-bash">sudo apt update
sudo apt -y install jq
</code></pre>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/usecase-051.jpg" alt="Use case screenshot 51" style="display:block;margin:0 auto" />

<p><strong>10.4.</strong> Create the Active Response script <code>/var/ossec/active-response/bin/remove-threat.sh</code>, which removes malicious files from the endpoint:</p>
<pre><code class="language-bash">#!/bin/bash

LOCAL=`dirname $0`;
cd $LOCAL
cd ../

PWD=`pwd`

read INPUT_JSON
FILENAME=$(echo $INPUT_JSON | jq -r .parameters.alert.data.virustotal.source.file)
COMMAND=$(echo $INPUT_JSON | jq -r .command)
LOG_FILE="${PWD}/../logs/active-responses.log"

#------------------------ Analyze command -------------------------#
if [ ${COMMAND} = "add" ]
then
 # Send control message to execd
 printf '{"version":1,"origin":{"name":"remove-threat","module":"active-response"},"command":"check_keys", "parameters":{"keys":[]}}\n'

 read RESPONSE
 COMMAND2=$(echo $RESPONSE | jq -r .command)
 if [ ${COMMAND2} != "continue" ]
 then
  echo "`date '+%Y/%m/%d %H:%M:%S'` $0: $INPUT_JSON Remove threat active response aborted" &gt;&gt; ${LOG_FILE}
  exit 0;
 fi
fi

# Removing file
rm -f $FILENAME
if [ $? -eq 0 ]; then
 echo "`date '+%Y/%m/%d %H:%M:%S'` $0: $INPUT_JSON Successfully removed threat" &gt;&gt; ${LOG_FILE}
else
 echo "`date '+%Y/%m/%d %H:%M:%S'` $0: $INPUT_JSON Error removing threat" &gt;&gt; ${LOG_FILE}
fi

exit 0;
</code></pre>
<p><strong>10.5.</strong> Set the script's ownership and permissions:</p>
<pre><code class="language-bash">sudo chmod 750 /var/ossec/active-response/bin/remove-threat.sh
sudo chown root:wazuh /var/ossec/active-response/bin/remove-threat.sh
</code></pre>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/usecase-052.jpg" alt="Use case screenshot 52" style="display:block;margin:0 auto" />

<p><strong>10.6.</strong> Restart the Wazuh agent to apply the changes:</p>
<pre><code class="language-bash">sudo systemctl restart wazuh-agent
</code></pre>
<h4>Configuration — Wazuh server</h4>
<p>On the Wazuh server, we raise alerts for changes in the endpoint's directory, enable the VirusTotal integration, and trigger the Active Response script whenever a suspicious file is detected.</p>
<p><strong>10.7.</strong> Add the following rules to <code>/var/ossec/etc/rules/local_rules.xml</code>. They raise alerts for changes in <code>/root</code> detected by FIM scans:</p>
<pre><code class="language-xml">&lt;group name="syscheck,pci_dss_11.5,nist_800_53_SI.7,"&gt;
    &lt;!-- Rules for Linux systems --&gt;
    &lt;rule id="100200" level="7"&gt;
        &lt;if_sid&gt;550&lt;/if_sid&gt;
        &lt;field name="file"&gt;/root&lt;/field&gt;
        &lt;description&gt;File modified in /root directory.&lt;/description&gt;
    &lt;/rule&gt;
    &lt;rule id="100201" level="7"&gt;
        &lt;if_sid&gt;554&lt;/if_sid&gt;
        &lt;field name="file"&gt;/root&lt;/field&gt;
        &lt;description&gt;File added to /root directory.&lt;/description&gt;
    &lt;/rule&gt;
&lt;/group&gt;
</code></pre>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/usecase-053.png" alt="Use case screenshot 53" style="display:block;margin:0 auto" />

<p><strong>10.8.</strong> Add the following to the Wazuh server's <code>/var/ossec/etc/ossec.conf</code> to enable the VirusTotal integration. Replace <code>&lt;YOUR_VIRUS_TOTAL_API_KEY&gt;</code> with your own key. A VirusTotal query is triggered every time rule <code>100200</code> or <code>100201</code> fires:</p>
<pre><code class="language-xml">&lt;ossec_config&gt;
  &lt;integration&gt;
    &lt;name&gt;virustotal&lt;/name&gt;
    &lt;api_key&gt;&lt;YOUR_VIRUS_TOTAL_API_KEY&gt;&lt;/api_key&gt; &lt;!-- Replace with your VirusTotal API key --&gt;
    &lt;rule_id&gt;100200,100201&lt;/rule_id&gt;
    &lt;alert_format&gt;json&lt;/alert_format&gt;
  &lt;/integration&gt;
&lt;/ossec_config&gt;
</code></pre>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/usecase-054.jpg" alt="Use case screenshot 54" style="display:block;margin:0 auto" />

<p><strong>10.9.</strong> Add the following blocks to the Wazuh server's <code>/var/ossec/etc/ossec.conf</code>. They enable Active Response and run the <code>remove-threat.sh</code> script when VirusTotal flags a file as malicious:</p>
<pre><code class="language-xml">&lt;ossec_config&gt;
  &lt;command&gt;
    &lt;name&gt;remove-threat&lt;/name&gt;
    &lt;executable&gt;remove-threat.sh&lt;/executable&gt;
    &lt;timeout_allowed&gt;no&lt;/timeout_allowed&gt;
  &lt;/command&gt;

  &lt;active-response&gt;
    &lt;disabled&gt;no&lt;/disabled&gt;
    &lt;command&gt;remove-threat&lt;/command&gt;
    &lt;location&gt;local&lt;/location&gt;
    &lt;rules_id&gt;87105&lt;/rules_id&gt;
  &lt;/active-response&gt;
&lt;/ossec_config&gt;
</code></pre>
<p><strong>10.10.</strong> Add the following rules to <code>/var/ossec/etc/rules/local_rules.xml</code> to alert on the Active Response results:</p>
<pre><code class="language-xml">&lt;group name="virustotal,"&gt;
  &lt;rule id="100092" level="12"&gt;
    &lt;if_sid&gt;657&lt;/if_sid&gt;
    &lt;match&gt;Successfully removed threat&lt;/match&gt;
    &lt;description&gt;$(parameters.program) removed threat located at $(parameters.alert.data.virustotal.source.file)&lt;/description&gt;
  &lt;/rule&gt;

  &lt;rule id="100093" level="12"&gt;
    &lt;if_sid&gt;657&lt;/if_sid&gt;
    &lt;match&gt;Error removing threat&lt;/match&gt;
    &lt;description&gt;Error removing threat located at $(parameters.alert.data.virustotal.source.file)&lt;/description&gt;
  &lt;/rule&gt;
&lt;/group&gt;
</code></pre>
<p><strong>10.11.</strong> Restart the Wazuh manager to apply the configuration changes:</p>
<pre><code class="language-bash">sudo systemctl restart wazuh-manager
</code></pre>
<h4>Attack emulation</h4>
<p>Download an <strong>EICAR</strong> test file (a harmless file that every antivirus detects as malware) into the monitored <code>/root</code> directory on the Ubuntu endpoint:</p>
<pre><code class="language-bash">sudo curl -Lo /root/eicar.com https://secure.eicar.org/eicar.com &amp;&amp; sudo ls -lah /root/eicar.com
</code></pre>
<h4>Viewing the alerts</h4>
<p>Open the <strong>Threat Hunting</strong> module and filter the alerts:</p>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/usecase-055.jpg" alt="Use case screenshot 55" style="display:block;margin:0 auto" />

<p>As soon as it is downloaded, the "malware" is detected by VirusTotal and automatically deleted!</p>
<hr />
<h3>11.12. Use case 11 — Vulnerability detection</h3>
<p>Wazuh uses its <strong>Vulnerability Detection</strong> module to identify vulnerabilities in the operating systems and applications running on the endpoints.</p>
<p>This use case shows how Wazuh detects unpatched CVEs (Common Vulnerabilities and Exposures) on the monitored endpoints.</p>
<p><strong>Infrastructure</strong></p>
<table>
<thead>
<tr>
<th>Endpoint</th>
<th>Description</th>
</tr>
</thead>
<tbody><tr>
<td>Ubuntu 22.04</td>
<td>The Vulnerability Detection module scans the OS and installed applications on this Linux endpoint for vulnerabilities.</td>
</tr>
</tbody></table>
<h4>Configuration</h4>
<p>The Vulnerability Detection module is enabled by default. On the Wazuh server, check that it is enabled and correctly configured.</p>
<p><strong>11.1.</strong> Open <code>/var/ossec/etc/ossec.conf</code> on the Wazuh server and check the following settings:</p>
<ul>
<li>Vulnerability detection is enabled:</li>
</ul>
<pre><code class="language-xml">&lt;vulnerability-detection&gt;
  &lt;enabled&gt;yes&lt;/enabled&gt;
  &lt;index-status&gt;yes&lt;/index-status&gt;
  &lt;feed-update-interval&gt;60m&lt;/feed-update-interval&gt;
&lt;/vulnerability-detection&gt;
</code></pre>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/usecase-056.jpg" alt="Use case screenshot 56" style="display:block;margin:0 auto" />

<ul>
<li>The indexer connection is correctly configured. By default, one host is set in the indexer settings, <code>0.0.0.0</code>:</li>
</ul>
<pre><code class="language-xml">&lt;indexer&gt;
  &lt;enabled&gt;yes&lt;/enabled&gt;
  &lt;hosts&gt;
    &lt;host&gt;https://0.0.0.0:9200&lt;/host&gt;
  &lt;/hosts&gt;
  &lt;ssl&gt;
    &lt;certificate_authorities&gt;
      &lt;ca&gt;/etc/filebeat/certs/root-ca.pem&lt;/ca&gt;
    &lt;/certificate_authorities&gt;
    &lt;certificate&gt;/etc/filebeat/certs/filebeat.pem&lt;/certificate&gt;
    &lt;key&gt;/etc/filebeat/certs/filebeat-key.pem&lt;/key&gt;
  &lt;/ssl&gt;
&lt;/indexer&gt;
</code></pre>
<p>Replace <code>0.0.0.0</code> with the IP address or hostname of your Wazuh indexer node. You can find this value in the Filebeat configuration file, <code>/etc/filebeat/filebeat.yml</code>. Make sure the Filebeat certificate and key names match the files in <code>/etc/filebeat/certs</code>.</p>
<p>If you have a Wazuh indexer cluster, add a <code>&lt;host&gt;</code> entry for each node. For example, with two nodes:</p>
<pre><code class="language-xml">&lt;hosts&gt;
  &lt;host&gt;https://10.0.0.1:9200&lt;/host&gt;
  &lt;host&gt;https://10.0.0.2:9200&lt;/host&gt;
&lt;/hosts&gt;
</code></pre>
<p>Vulnerability detection reports to the first node in the list, and switches to the next one if it is unavailable.</p>
<p><strong>11.2.</strong> If you changed the configuration, restart the Wazuh manager:</p>
<pre><code class="language-bash">sudo systemctl restart wazuh-manager
</code></pre>
<h4>Viewing the vulnerabilities</h4>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/usecase-057.jpg" alt="Use case screenshot 57" style="display:block;margin:0 auto" />

<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/usecase-058.jpg" alt="Use case screenshot 58" style="display:block;margin:0 auto" />

<p>Wazuh identifies the vulnerabilities on our endpoints, with their severity and the affected packages.</p>
<hr />
<h3>11.13. Use case 12 — Detecting hidden processes</h3>
<p>In this use case, we show how Wazuh detects <strong>hidden processes created by a rootkit</strong> on a Linux endpoint. We deploy a kernel-mode rootkit, <strong>Diamorphine</strong>, on an Ubuntu endpoint.</p>
<p>This rootkit hides itself from the list of kernel modules, and hides selected processes from the <code>ps</code> utility. Wazuh still detects it, using the <code>setsid()</code>, <code>getpid()</code> and <code>kill()</code> system calls.</p>
<p><strong>Infrastructure</strong></p>
<table>
<thead>
<tr>
<th>Endpoint</th>
<th>Description</th>
</tr>
</thead>
<tbody><tr>
<td>Ubuntu 22.04</td>
<td>We download, compile and load a rootkit on this endpoint, then configure the Wazuh rootcheck module to detect the anomaly.</td>
</tr>
</tbody></table>
<h4>Configuration</h4>
<p>On the Ubuntu endpoint, emulate a rootkit and run a rootcheck scan to detect it.</p>
<p><strong>12.1.</strong> Switch to the root user and update the packages:</p>
<pre><code class="language-bash">sudo su
apt update
</code></pre>
<p><strong>12.2.</strong> Install the packages needed to build the rootkit:</p>
<pre><code class="language-bash">apt -y install gcc git
</code></pre>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/usecase-059.jpg" alt="Use case screenshot 59" style="display:block;margin:0 auto" />

<p><strong>12.3.</strong> Configure the Wazuh agent to run rootcheck scans <strong>every 2 minutes</strong>. In <code>/var/ossec/etc/ossec.conf</code>, set the <code>frequency</code> option of the <code>&lt;rootcheck&gt;</code> section to <code>120</code>:</p>
<pre><code class="language-xml">&lt;rootcheck&gt;
  &lt;disabled&gt;no&lt;/disabled&gt;
  &lt;check_files&gt;yes&lt;/check_files&gt;
  &lt;check_trojans&gt;yes&lt;/check_trojans&gt;
  &lt;check_dev&gt;yes&lt;/check_dev&gt;
  &lt;check_sys&gt;yes&lt;/check_sys&gt;
  &lt;check_pids&gt;yes&lt;/check_pids&gt;
  &lt;check_ports&gt;yes&lt;/check_ports&gt;
  &lt;check_if&gt;yes&lt;/check_if&gt;

  &lt;!-- rootcheck execution frequency - every 12 hours by default --&gt;
  &lt;frequency&gt;120&lt;/frequency&gt;

  &lt;rootkit_files&gt;etc/shared/rootkit_files.txt&lt;/rootkit_files&gt;
  &lt;rootkit_trojans&gt;etc/shared/rootkit_trojans.txt&lt;/rootkit_trojans&gt;
  &lt;skip_nfs&gt;yes&lt;/skip_nfs&gt;
&lt;/rootcheck&gt;
</code></pre>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/usecase-060.jpg" alt="Use case screenshot 60" style="display:block;margin:0 auto" />

<p><strong>12.4.</strong> Restart the Wazuh agent to apply the changes:</p>
<pre><code class="language-bash">systemctl restart wazuh-agent
</code></pre>
<h4>Attack emulation — Ubuntu endpoint</h4>
<ul>
<li>Get the Diamorphine rootkit source code from GitHub:</li>
</ul>
<pre><code class="language-bash">git clone https://github.com/m0nad/Diamorphine
</code></pre>
<ul>
<li>Go to the Diamorphine directory and compile the source code:</li>
</ul>
<pre><code class="language-bash">cd Diamorphine
make
</code></pre>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/usecase-061.jpg" alt="Use case screenshot 61" style="display:block;margin:0 auto" />

<p><strong>12.5.</strong> Load the rootkit kernel module:</p>
<pre><code class="language-bash">insmod diamorphine.ko
</code></pre>
<p>The Diamorphine kernel-level rootkit is now installed on the Ubuntu endpoint.</p>
<p><strong>12.6.</strong> By default, Diamorphine hides itself, so <code>lsmod</code> won't show it. Sending signal <code>63</code> to any process (whether it exists or not) toggles the module between hidden and visible:</p>
<pre><code class="language-bash">lsmod | grep diamorphine
kill -63 509
lsmod | grep diamorphine
</code></pre>
<p><strong>12.7.</strong> The rootkit can also hide selected processes from <code>ps</code>. Sending signal <code>31</code> to a process hides or unhides it. Let's hide the <code>rsyslogd</code> process. First, it is visible:</p>
<pre><code class="language-bash">ps auxw | grep rsyslogd | grep -v grep
</code></pre>
<p>You get an output like this:</p>
<pre><code class="language-plaintext">root  732  0.0  0.7  214452  3572 ?  Ssl  14:53  0:00 /usr/sbin/rsyslogd -n
</code></pre>
<p>Now hide it, and check again:</p>
<pre><code class="language-bash">kill -31 &lt;PID_OF_RSYSLOGD&gt;
ps auxw | grep rsyslogd | grep -v grep
</code></pre>
<p>This time, the output is empty: the process is hidden.</p>
<p>The next rootcheck scan runs and alerts on the <code>rsyslogd</code> process hidden by the Diamorphine rootkit.</p>
<h4>Viewing the alerts</h4>
<p>Open the <strong>Threat Hunting</strong> module and filter the alerts with:</p>
<pre><code class="language-plaintext">rule.groups:rootcheck
</code></pre>
<img src="https://raw.githubusercontent.com/yvesstan/soc-blog-images/main/usecase-062.jpg" alt="Use case screenshot 62" style="display:block;margin:0 auto" />

<p>If you run the same <code>kill -31</code> command against the process again, it becomes visible, and the following rootcheck scans no longer raise an alert about it.</p>
<hr />
<h3>11.14. Going further</h3>
<p>Depending on the environment your SOC protects, you will build many more use cases. The twelve above are among the most common ones implemented right after deploying a SOC, whether internal or external.</p>
<p>The goal of this part is to give analysts hands-on practice with the SOC against the kinds of incidents they will face in a real enterprise environment.</p>
<h2>12. Conclusion</h2>
<p>This guide covered the full lifecycle of an operational SOC:</p>
<ul>
<li><strong>Architecture:</strong> a high-level design that explains the role of each component, and a low-level design that details how they communicate.</li>
<li><strong>Deployment:</strong> a pfSense firewall, an Ubuntu server hosting Wazuh, TheHive, Cortex and MISP, all the integrations between them, and Shuffle for automation.</li>
<li><strong>Operations:</strong> twelve attack scenarios, from brute-force and SQL injection to malware and rootkits, each detected and, where possible, answered automatically.</li>
</ul>
<p>The result is a complete, open-source SOC that any team can reproduce, and a solid foundation for real-world detection and incident response.</p>
]]></content:encoded></item><item><title><![CDATA[Security Architecture & Design Review With Threat Modeling]]></title><description><![CDATA[Perform a complete Security Architecture & Design Review . Master the STRIDE framework, create Data Flow Diagrams, and deliver professional security…]]></description><link>https://yvesstan.space/security-architecture-and-design-review-with-threat-modeling</link><guid isPermaLink="true">https://yvesstan.space/security-architecture-and-design-review-with-threat-modeling</guid><category><![CDATA[cybersecurity]]></category><category><![CDATA[threat modeling]]></category><category><![CDATA[security architecture]]></category><category><![CDATA[appsec]]></category><category><![CDATA[Stride]]></category><category><![CDATA[infosec]]></category><category><![CDATA[Web Security]]></category><category><![CDATA[secure by design]]></category><dc:creator><![CDATA[Yves Stanislas ADANI]]></dc:creator><pubDate>Wed, 04 Feb 2026 17:40:39 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1770226216100/5db42fe8-ebb0-47a9-8a64-de45d10190dd.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-tldr"><strong>TL;DR</strong></h2>
<p>In this article, I'll walk you through the complete process of <strong>Security Architecture &amp; Design Review (SAR)</strong> for an e-commerce web application. You'll discover how to use the <strong>Microsoft Threat Modeling Tool</strong>, create <strong>Data Flow Diagrams</strong>, identify threats using the <strong>STRIDE model</strong>, and produce a professional security report for your stakeholders.</p>
<h3 id="heading-introduction-why-security-architecture-review-matters"><strong>Introduction: Why Security Architecture Review Matters</strong></h3>
<p>In a world where <strong>cyberattacks against e-commerce platforms have increased by 300%</strong> in recent years, Security Architecture Review is no longer optional — it's an <strong>absolute necessity</strong>.</p>
<p>Security Architecture Review (SAR) is the process of evaluating and improving a system's security by analyzing its <strong>design</strong>, <strong>implementation</strong>, and <strong>deployment</strong>. The goal? Ensuring your system is resilient against potential threats and meets your organization's security standards.</p>
<p>The security architecture review typically includes</p>
<ul>
<li><p>A review of the design specificationsand architecture diagrams</p>
</li>
<li><p>Threat modeling to identify potential security threats and vulnerabilities</p>
</li>
<li><p>Review of design specifications and architecture diagram</p>
</li>
<li><p>Evaluation of security controls and countermeasures included in the design</p>
</li>
<li><p>Identification of potential desin weaknesses</p>
</li>
<li><p>Documentation of review findings and recommendations for improvement</p>
</li>
<li><p>Goal of enhancing overall security of the system</p>
</li>
</ul>
<p>The security review is an important step in the software development life cycle (SDLC) and should be concluded regularly to ensure that the system remains secure over time and adapts to changes in the threat landscape. The review process should be integrated in the SDLC and be performed by a team of security experts who have the necessary knowledge and skills to evaluate the system from a security perspective.</p>
<h3 id="heading-the-6-step-sar-process"><strong>The 6-Step SAR Process</strong></h3>
<p>A typical Security Architecture Review process includes the following steps:</p>
<h4 id="heading-1-planning-amp-preparation"><strong>1 - Planning &amp; Preparation</strong></h4>
<p>This foundational phase includes:</p>
<ul>
<li><p>Defining the <strong>scope</strong> and <strong>objectives</strong> of the review</p>
</li>
<li><p>Identifying the review team and establishing the timeline</p>
</li>
<li><p>Obtaining all relevant documentation (specifications, architecture diagrams, existing threat models)</p>
</li>
<li><p>Preparing the review checklist</p>
</li>
</ul>
<h4 id="heading-2-threat-modeling"><strong>2 - Threat Modeling</strong></h4>
<p>This is the heart of our process. Threat modeling involves:</p>
<ul>
<li><p>Identifying potential threats and vulnerabilities</p>
</li>
<li><p>Documenting these threats in a structured model</p>
</li>
<li><p>Using the <strong>STRIDE</strong> framework to categorize threats</p>
</li>
</ul>
<h4 id="heading-3-architecture-implementation-review"><strong>3 - Architecture Implementation Review</strong></h4>
<p>This step involves reviewing the implementation of security controls to ensure they are properly deployed and meet organizational standards.</p>
<h4 id="heading-4-deployment-review"><strong>4 - Deployment Review</strong></h4>
<p>Here we verify that the system deployment is secure and that controls are correctly configured.</p>
<h4 id="heading-5-reporting-amp-recommendations"><strong>5 - Reporting &amp; Recommendations</strong></h4>
<p>Documentation of findings, including identified threats and improvement recommendations.</p>
<h4 id="heading-6-follow-up"><strong>6 - Follow-up</strong></h4>
<p>Implementation of recommendations, regular follow-up reviews, and design updates to maintain system security over time.</p>
<h3 id="heading-security-architecture-amp-design-review-for-an-ecommerce-web-application"><strong>Security Architecture &amp; Design Review for an Ecommerce Web Application</strong></h3>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1770219596226/bacd198c-e1d1-497d-890d-06ddf6ab67c9.png" alt class="image--center mx-auto" /></p>
<p>In this picture a secure design checklist will contain a number of questions that will be answer by stakeholder who own the Application. If during the Application walktrough some of the questions have already been answered, then the secutity team will update those answers in the checklist and will ask the stakeholders to provide the information for the rest of the questions present in the checklist.</p>
<h3 id="heading-step-1-install-microsoft-threat-modeling-tool"><strong>STEP 1 INSTALL MICROSOFT THREAT MODELING TOOL</strong></h3>
<p>Let's install Microsoft Threat Modeling Tool !</p>
<p>We have to look for Microsoft Threat Modeling Tool on Google and select the one I have highlighted in Yellow</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1770219982777/e8cdc294-cad6-4961-b139-85e8f29eb6ad.png" alt class="image--center mx-auto" /></p>
<p>After choosing the Microsoft Threat Modeling Tool 2016 we'll go on the following  page</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1770220031253/c22ef187-1509-4046-a8a9-7e832c02bbee.png" alt class="image--center mx-auto" /></p>
<p>Then we'll click on Download and select "File Name" that will automatically select all</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1770220062940/b2915b4a-f891-4ef2-a924-ec08d2e278d8.png" alt class="image--center mx-auto" /></p>
<p>After successfully performed the Download now we have to install the tool</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1770220124814/337d38a5-f648-49a6-a3f4-32b6cdbb1aba.png" alt class="image--center mx-auto" /></p>
<p>After the installation successfully completed we can now launch the application</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1770220178608/813bb601-1428-4536-8a09-e3a9f83666fa.png" alt class="image--center mx-auto" /></p>
<h3 id="heading-step2-gathering-requirements"><strong>STEP2: Gathering Requirements</strong></h3>
<p><strong>Pro Tip</strong>: In 95% of cases, you'll need to ask technical questions to stakeholders during the walkthrough meeting to understand whether security processes are in place.</p>
<p>For our case study, let's imagine that <strong>STAN CONSORTIUM</strong> has engaged us to perform a Security Architecture Review of their e-commerce web application.</p>
<p>First of all we have received architecture diagram of the  application  from the stakeholders</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1770220427867/603a89a8-0206-40df-9097-1ace7edb657d.png" alt class="image--center mx-auto" /></p>
<h4 id="heading-a-complete-walkhrough-of-the-application"><strong>A complete walkhrough of the application</strong></h4>
<p>In this architecture the user will access the web app via a firewall , then there is a proxy wall in front of the web server where the web application was hosted. Now we have the presentation layer of the web application, the web server is connected to the buisness layer and the data layer in the buisness layer. In the buisness layer we have the API layer where the web APIs are exposed, the Web APIs has the application buisness logic implemented as well. This application buisness logic interacts with the backend server where the legacy application resides. Now the application where the buisness logic is present also interacts with the database service and a third party service. Therefore database service  and third party service resides in data layers. So it means that we have a database in a data layer, we have a Web APIs in the Buisness Layer precisely in the API Layer and we have the legacy application in the backend. A third party service is also present in the data layer. In front of the buisness layer at the presentaion layer is a web server. The web server requests are going to the internet via a proxy wall and then further via a firewall. And then finally the response goes back to the user.</p>
<p>To sum up :</p>
<ul>
<li><p>STAN CONSORTIUM has engaged us to perform Security Architecture and Review of their Ecommerce Web Application</p>
</li>
<li><p>The Web Application is a simple 3 layer application (Presentation layer, Buisness Layer and Data layer)</p>
</li>
<li><p>The Architecture Diagram have  been shared</p>
</li>
<li><p>Let's perform the security Architecture and Review activity</p>
</li>
</ul>
<h4 id="heading-inputs-given-by-stan-consortium"><strong>INPUTS GIVEN BY STAN CONSORTIUM</strong></h4>
<ul>
<li><p>Currently, Developpers do not have a Secure Training Program</p>
</li>
<li><p>DDOS Protection is not enabled on the Firewall</p>
</li>
<li><p>SIEM Program is not in place</p>
</li>
<li><p>User input in only validated at client side</p>
</li>
<li><p>Server logs are backed up on same server</p>
</li>
<li><p>Encryption mechanism being used for data-in-transit is TLS 1.1</p>
</li>
<li><p>MD5 algorithms is used for generating password hashes</p>
</li>
<li><p>Data in database is not encrypted</p>
</li>
<li><p>Database backup schedule is not documented</p>
</li>
<li><p>Firewall alerts are not monitored in real time</p>
</li>
</ul>
<p>In 95% of the cases, we will have to ask such questions during the walktrough meeting of the process, so it means that while we'll be provide walkthrough of the application by stakeholders, we'll have to ask such technical questions to the stakeholders that wether these processes are in place or not ?</p>
<p>This will help us to fill up or create our secured design review checklist. So right now this information has been provided to us using which we will perform the four step process of our workflow.</p>
<p> Now let's see the steps that we will follow to perform the security architecture and design review for STAN CONSORTIUM. Following are the steps in order that we should follow to perform Security Architecture and Review for this project:</p>
<ol>
<li>First of all we have to ask STAN CONSORTIUM to provide a walktrough  of the application in scope and share any architecture diagrams</li>
</ol>
<ol start="2">
<li><p>After that we will create a Security Architecture and Review Checklist based on the information provided by STAN CONSORTIUM</p>
</li>
<li><p>Here is the Checklist on my github repo --&gt; <a target="_blank" href="https://github.com/yvesstan/Security-Architecture-Review-with-Threat-Modeling/blob/main/Application%20Security%20Architecture%20Review%20Checklist.xlsx">yvesstan/Security-Architecture-Review-with-Threat-Modeling: All the delivrable include in my article about Security Architecture &amp; Review based on Threat Modeling</a> </p>
</li>
<li><p>—&gt;Now we'll perform a Threat Modeling Exercice using Microsft Threat Modeling Tool and create a DFD (Data Flow Diagram). DFD is a way of reprensenting a flow of data through a process or a system , this is really important because it will be a part of the final report that we'll be sharing with the stakeholders.</p>
<p> —&gt; After doing the Threat Modeling exercise, we will generate a report from Threat Modeling Tool as per STRIDE Model and highlight all the assets and security controls applicable to each asset.</p>
</li>
<li><p>At the end we'll prepare a final Summary report for all the stakeholders</p>
</li>
</ol>
<h3 id="heading-step-3-security-architecture-amp-design-review-checklist"><strong>STEP 3: Security Architecture &amp; Design Review Checklist</strong></h3>
<p>The security review checklist is our best ally. It contains questions that will be asked to stakeholders who own the application.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1770221780876/84dcf590-bb76-47bb-822f-1d645dfe2ffe.png" alt class="image--center mx-auto" /></p>
<p>As you can see, this is the application security architecture review checklist as I have mentionned  I've included the link to my Github repository where it's located. In this checklist you can see various categories based on authentication, authorization and similar other controls.</p>
<p>Now what we have to do ?</p>
<p>In each category we will have to define application security controls and hence our checklist should include questionnaire an all such security controls. I have filled up some of these questions based on the inputs received from STAN CONSORTIUM.</p>
<p> Generally in enterprise environment we will have to create such checklist for our project and will have to ask our stakeholders to provide inputs to each question brought up in the checklist.</p>
<p>Here's a simple workflow that I’ve made to use at this section:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1770222012246/0ddab755-9281-4a54-8148-9ff5de6ee8dc.png" alt class="image--center mx-auto" /></p>
<p>How can we use this workflow ?????</p>
<p>In the checklist we will ask the questions on the column &lt;&lt;Application Security Control&gt;&gt; to the stakeholder or perform a check during a meeting section and based on the feedback that will be mentioned in the column --&gt; "Controls Implemented (Y/N)" and our expertise  we'll fullfill the following other columns --&gt; "Comments" | "Impact if controls not implemented" | "Remediations"</p>
<p> To sum up all these controls will have to be discuss with the project stakeholders and we need to fill this information in order to identify which security controls are already implemented and which security controls have not been implemented and are missing in the application. This will help us to identifiy threat based on misssing security controls. We also have to know that this is a generic checklist and it should be modified as per the project under review.</p>
<p>In our case you can view the checklist that I've filled here --&gt; <a target="_blank" href="https://github.com/yvesstan/Security-Architecture-Review-with-Threat-Modeling/blob/main/Application%20Security%20Architecture%20Review%20Checklist%20Filled.xlsx">yvesstan/Security-Architecture-Review-with-Threat-Modeling: All the delivrable include in my article about Security Architecture &amp; Review based on Threat Modeling</a></p>
<h3 id="heading-step-4-creating-the-threat-model-with-microsoft-threat-modeling-tool"><strong>STEP 4: Creating the Threat Model with Microsoft Threat Modeling Tool</strong></h3>
<p>This is where it gets interesting! We'll create a <strong>Data Flow Diagram (DFD)</strong> — a visual representation of data flow through the system.</p>
<p>In order to create a new threat model, let’s following the steps below:</p>
<p>First of all after launching the Microsoft Threat Modeling Tool we need to click on create a model</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1770222638672/5322bb34-5d42-4c24-a977-a6c9e85c2e4f.png" alt class="image--center mx-auto" /></p>
<p>Here we bring the architecture for which we are going to create the threat model. In our case it is the Web Application Architecture Layers that we saw earlier  --&gt; <a target="_blank" href="https://github.com/yvesstan/Security-Architecture-Review-with-Threat-Modeling/blob/main/Web%20App%20Architecture%20Layer.PNG">https://github.com/yvesstan/Security-Architecture-Review-with-Threat-Modeling/blob/main/Web%20App%20Architecture%20Layer.PNG</a></p>
<ul>
<li><p>We have  a firewall , a proxy wall</p>
</li>
<li><p>Then we have a web server which is serving the web application</p>
</li>
<li><p>Then we have a buisness layer where the application is hosted</p>
</li>
<li><p>Then we have a dater layer where the database service is present and also a third party services present</p>
</li>
</ul>
<p>Now  let's build our data flow diagram based on that :</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1770222756682/75fd3d72-d148-43ab-974c-febf8eb04ad7.png" alt class="image--center mx-auto" /></p>
<p>Now that we have created the data flow diagram, it's time to generate the threat modeling report, but before we do that we need to provide some information, so in order to add that information, we will have to click on File, and --&gt; Threat Model Information and fill the informations that appear , at the end we will have something like this :</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1770222886955/14b27766-ae5e-44b2-8ebb-7dc6886595cd.png" alt class="image--center mx-auto" /></p>
<p>Now we'll close and save the work we have done!</p>
<p>And now let's generate the report by clicking on reports, create full report, and let's click on Generate Report</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1770222928378/d57a6349-2fb6-473c-9b7f-9c7e134d9e88.png" alt class="image--center mx-auto" /></p>
<p>We'll have an HTML report like the following</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1770222972109/820e1933-967e-466f-945f-b7ec6617c87a.png" alt class="image--center mx-auto" /></p>
<p>You can check the report I’ve generated here --&gt; <a target="_blank" href="https://github.com/yvesstan/Security-Architecture-Review-with-Threat-Modeling/blob/main/STAN%20SAR%20Threat%20Modeling%20Report.htm">yvesstan/Security-Architecture-Review-with-Threat-Modeling: All the delivrable include in my article about Security Architecture &amp; Review based on Threat Modeling</a></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1770223056408/9658e7cb-193c-4b2c-85a2-64edd42cae47.png" alt class="image--center mx-auto" /></p>
<p>Currently we can notice that all threats are mentioned as not started. It means that security team has not given any recommendation and the development team or the project stakeholders have not started mitigating those threats.</p>
<p> Now let's go back to our data flow diagram, let's click on view --&gt; Threat List , after clicking on it we can see the ten threat that are present in our application or that are applicable to our system</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1770223191253/21370eb5-c6d2-45a8-a621-74f4b184047a.png" alt class="image--center mx-auto" /></p>
<p>Now let's suppose we have shared this report to the stakeholders and they say that, okay the have started in the Cross Site Scripting threat, so what we'll do is in the retesting stage we will go to status and we'll mention it as mitigated</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1770223256024/7b72f1b8-21af-4bf3-99ba-c9fc3eb2d470.png" alt class="image--center mx-auto" /></p>
<p>Similarly, suppose they have also fixed the fourth threat, which is elevation using impersonation related to proxy wall, they have also mitigated it, we can select mitigate it and suppose for one of the threat like web server process memory tampered , they say that this threat is not applicable. So what we'll need to do is we'll need to select that appropriate status from this list</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1770223292823/81c197c5-c232-4520-8b8f-52a0e5799f70.png" alt class="image--center mx-auto" /></p>
<p>So now we need to save it again and generate another report , here's the following update report based on the modifications we’ve performed --&gt; <a target="_blank" href="https://github.com/yvesstan/Security-Architecture-Review-with-Threat-Modeling/blob/main/STAN%20SAR%20Threat%20Modeling%20Report%202.0.htm">Security-Architecture-Review-with-Threat-Modeling/STAN SAR Threat Modeling Report 2.0.htm at main · yvesstan/Security-Architecture-Review-with-Threat-Modeling</a></p>
<p>Now we can publish this report again to the stakeholders, so this will be an ongoing process as soon as the development team will keep on fixing these threats, we will be generating new threat modeling reports. And also since there will be changes in the application which is under development, we will keep on doing threat modeling at a regular basis.</p>
<p> So that's how we perform threat modeling on a real life application. We create the data flow diagrams, we generate the threat modeling report, then we update the mitigation status based on the fixes implemented by the development team of the project, and we perform this activity on a regular basis.</p>
<p>In the following section we are now going to use all this information in order to generate the security architecture and design Review.</p>
<h3 id="heading-step-5-the-sar-summary-report"><strong>STEP 5: The SAR Summary Report</strong></h3>
<p>Now that we perform the threat modeling, we are going to create a security architecture and design review</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1770223639470/2bf64b8d-0bf5-47d3-b1d3-2774d433b72a.png" alt class="image--center mx-auto" /></p>
<p>Here --&gt; <a target="_blank" href="https://github.com/yvesstan/Security-Architecture-Review-with-Threat-Modeling/blob/main/STAN%20CONSORTIUM-SAR-Summary-Report.pptx">yvesstan/Security-Architecture-Review-with-Threat-Modeling: All the delivrable include in my article about Security Architecture &amp; Review based on Threat Modeling</a> is the STAN CONSORTIUM Security Architecture Design Review summary report that we have created in our context.</p>
<p>If it is a draft report, we will add a version number mentioning that this is the version one of the report and once it is approved by the stakeholders, we will publish the final version of the report.</p>
<p>Now let's discuss about the contents of this report:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1770223709052/d6de6121-85f0-4e5e-9485-6c25e9eb1f0f.png" alt class="image--center mx-auto" /></p>
<p>First of all we will learn the project scope and then we will understand about the project summary. Then we will see the application architecture that is currently under review and for which we are doing the security, architecture and design review. After that, we have listed the application component details. Then we have added the data flow diagram that we have recently created in Microsoft Threat Modeling Tool. And finally, we have given the identified threats and remediation suggestions. Then we can add any appendix, for example, we can add some data flow diagram, component details in the appendix or any other information that we would like to attach.</p>
<p>Generally in enterprise environment, these components will be present in the final security Architecture and Design Review Summary Report.</p>
<p> At the project summary section of te report you will notice that there are more threats present, you know why ???</p>
<p>It's because the requirements that we initially got from our client where they had mentioned data in database is not encrypted and encryption mechanisme that was being used is TLS 1.1, we will have to take into consideration all these requirements as well, which we can't define in a data flow diagram. And then we will have to identify threats as well.</p>
<p>To sum up while identifying the threats, we will have to take into consideration all the inputs given by the project stakeholders, then we'll have to take into consideration the application security review checklist that  we have recently filled after going into discussion with the project stakeholders. And finally, we'll have to take into consideration the threats identified while doing threat modeling, using Microsoft threat modeling tools. Combining the outputs of all these three inputs would help us to identify the final summary of threats identified for the project under review.</p>
<p> So the count of the threats listed in the following screenshot should be based on our review of the inputs provided by project stakeholders based on the checklist answers that we fill after discussing with the stakeholders; and finally the threat modeling diagram that we have created using Microsoft Threat Modeling Tool.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1770223960631/ddbbee70-cf48-468d-ac44-9d72ac08a1cb.png" alt class="image--center mx-auto" /></p>
<p>At the end, the total number of threats identified from all the three inputs will help us to arrive at the total number of threats in the project summary.</p>
<p> Once the stakeholders approve our report, we will publish a final version of the report.</p>
<h3 id="heading-step-6-the-final-version-of-the-sar-summary-report"><strong>STEP 6: THE FINAL VERSION OF THE SAR SUMMARY REPORT</strong></h3>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1770224386905/b9873faf-72da-4e22-8bb3-4adbb31ddeba.png" alt class="image--center mx-auto" /></p>
<p>Now we are going to create our final version of the security architecture and Design Review  summary report. Here you can notice that we have added the report status and the report version number in our slide title so that before sharing this final report with the project stakeholders, they are able to identify that this is the final version of the report . The other changes that we have made to the final summary report are the fact that we have added review comments in the appendix section which are received once the security team provides  walkthrough to the project stakeholders,  there might be some new inputs provided by the project stakeholders at that time. We will now have to incorporate those review comments in our final summary report and then only publish our final version of the report.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1770224476516/7e366cc6-5590-4e09-8b4b-1d599404bfa3.png" alt class="image--center mx-auto" /></p>
<p>As we can see here for example, we had a finding in this report that there can be denial of service attack on the firewall because distributed denial of service protection is not enabled on Firewall. And during the walkthrough we got to know that they are already working on the firewall upgrade and that's why they have given the feedback that firewall upgrade is in progress then the finding that we have shared is no longer applicable because they are currently in the process of upgrading the firewall. In enterprise environment this kind of feedback has generally  been given by a Senior Architect, then based on that the status of this feedback as you can see here is "To be Discussed" as approval is awaited from all the stakeholders before an update in the summary report can be made.</p>
<p>So in order to make any change in this report, we need to get approvals from all the project stakeholders so that everyone is on the same page and then only we can make such changes in the summary report. That's exactly why this feedback we see here in the "REVIEW COMMENTS" section is yet to be incorporated. Then once approval is received from all the project stakeholders, we can remove the finding from the project report.</p>
<p>So the finding that we presented was as you can see in the following screenshot the first finding about the Distributed Denial of Service not enabled on Firewall</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1770224698552/ce76d2d9-9cb0-4738-86c8-b9c488e200ea.png" alt class="image--center mx-auto" /></p>
<p>Since the STAN CONSRTIUM is already in the process of upgrading the firewall so this finding will be removed from this report.</p>
<p>Next, feedback that has been received is database encryption Implementation is also in progress. This feedback comment is also given by the Senior Architect and this is also awaiting approval from all the project stakeholders. Once the project stakeholders provide their approval that this implementation is in progress and security team can go ahead to make these updates in the final summary report, then we will go in the report and we will remove this second finding which is related to missing encryption at the database level.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1770224801159/1ac34713-2982-480d-9cdc-76e9a9a42abd.png" alt class="image--center mx-auto" /></p>
<p>So that's how we publish the final version of the report. And as we keep on getting updates on a regular basis from the project stakeholders, we will be publishing new versions of the summary report. Once there is some change, we will need to update this major and minor version of the report. If there is a major change, we will change major version of the report.</p>
<p>For example, if there is a new component that has been added to the application, there will be a major version change of the report. But if there is any small change, then we will change smaller version of the report then we will publish the new report and share with all the project stakeholders and get approval on the final report . So that's how we will publish our final summary report of security, architecture and design review and the activity is complete.</p>
<p>Once this report is published, this entire activity is completed for this iteration and this entire process will be repeated on a regular basis based on the changes that will  be made to the application.</p>
<p>By the way you can checkout the final version of our report here —&gt; <a target="_blank" href="https://github.com/yvesstan/Security-Architecture-Review-with-Threat-Modeling/blob/main/STAN%20CONSORTIUM-SAR-Summary-Report_Final_1.0.pptx">yvesstan/Security-Architecture-Review-with-Threat-Modeling: All the delivrable include in my article about Security Architecture &amp; Review based on Threat Modeling</a></p>
<h3 id="heading-conclusion-mastering-security-architecture-review"><strong>Conclusion: Mastering Security Architecture Review</strong></h3>
<p>Security Architecture Review is a <strong>critical</strong> step in the Software Development Life Cycle (SDLC). It should be:</p>
<ul>
<li><p>Integrated into the development cycle</p>
</li>
<li><p>Performed by a team of security experts</p>
</li>
<li><p>Repeated regularly to adapt to evolving threats</p>
</li>
<li><p>Documented and shared with all stakeholders</p>
</li>
</ul>
<h3 id="heading-keys-to-success">Keys to Success:</h3>
<ol>
<li><p><strong>Collaboration</strong> — Work closely with stakeholders</p>
</li>
<li><p><strong>Documentation</strong> — Keep track of everything</p>
</li>
<li><p><strong>Iteration</strong> — It's a continuous process, not a one-shot deal</p>
</li>
<li><p><strong>Prioritization</strong> — Focus on critical threats first</p>
</li>
</ol>
<p> Resources</p>
<ul>
<li><p>🔗 <a target="_blank" href="https://aka.ms/threatmodelingtool">Microsoft Threat Modeling Tool</a></p>
</li>
<li><p>🔗 <a target="_blank" href="https://docs.microsoft.com/en-us/azure/security/develop/threat-modeling-tool-threats">STRIDE Threat Model</a></p>
</li>
<li><p>🔗 <a target="_blank" href="https://github.com/yvesstan/Security-Architecture-Review-with-Threat-Modeling">My GitHub Repository - Security Architecture Review Templates</a></p>
</li>
</ul>
<p><strong>Have you implemented a Security Architecture Review process in your organization?</strong> Share your experience in the comments!</p>
<p>Written with 💙&amp;passion! for the cybersecurity community</p>
]]></content:encoded></item><item><title><![CDATA[Os-security-patch-management-automation-with-ansible]]></title><description><![CDATA[Ansible playbook that automates security audits using Lynis on one or multiple Ubuntu hosts. The playbook scans for vulnerabilities and generates…]]></description><link>https://yvesstan.space/os-security-patch-management-automation-with-ansible</link><guid isPermaLink="true">https://yvesstan.space/os-security-patch-management-automation-with-ansible</guid><category><![CDATA[Devops]]></category><category><![CDATA[automation]]></category><category><![CDATA[Security]]></category><category><![CDATA[Linux]]></category><dc:creator><![CDATA[Yves Stanislas ADANI]]></dc:creator><pubDate>Fri, 23 Jan 2026 18:19:40 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1769192044736/9be09ce3-4ab5-4346-93f5-5639c0a8a571.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Ansible playbook that automates security audits using Lynis on one or multiple Ubuntu hosts. The playbook scans for vulnerabilities and generates actionable remediation steps, which can then be automated using another playbook.</p>
<h1 id="heading-patch-management-with-ansible"><strong>Patch Management with Ansible</strong></h1>
<p><img src="https://camo.githubusercontent.com/dfccf0cdc59cf22fb4e6a6f14733de569de1339e7b5442dbe0a329b18340237c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f50617463682532304d616e6167656d656e742d4175746f6d6174696f6e2d626c7565" alt="Patch Management" /></p>
<p>In enterprise environments, vulnerability management typically follows this workflow:</p>
<ul>
<li><p>A vulnerability scanner (Tenable, Qualys, Rapid7, OpenVAS) performs scans on infrastructure.</p>
</li>
<li><p>The results are collected in an Excel format (usually a template proposed by the CISO) where findings are organized by severity level, CVSS score, plugin, and other relevant factors.</p>
</li>
<li><p>Prioritization is then carried out from critical to less critical vulnerabilities, enabling teams to apply patches accordingly using tools like Microsoft WSUS or other enterprise-level solutions.</p>
</li>
</ul>
<p>To streamline this process, I have implemented an <strong>Ansible playbook</strong> that automates security audits using Lynis on one or multiple Ubuntu hosts. The playbook scans for vulnerabilities at the OS mainly at the kernel level and generates actionable remediation steps, which can then be automated using another playbook.</p>
<h3 id="heading-scriptsplaybooks-ive-write-to-use-for-the-demonstration">SCRIPTS/PLAYBOOKS I’ve write to use for the demonstration</h3>
<p>vul_scan_automation.yml : Here is the playbook which have been write to automate secutity weaknesses discovery at the OS level, you can assess it here —&gt; <a target="_blank" href="https://github.com/yvesstan/PATCH-MANAGEMENT-AUTOMATION-WITH-ANSIBLE/blob/main/automatelynis.yml">PATCH-MANAGEMENT-AUTOMATION-WITH-ANSIBLE/automatelynis.yml at main · yvesstan/PATCH-MANAGEMENT-AUTOMATION-WITH-ANSIBLE</a> |</p>
<p><a target="_blank" href="https://github.com/yvesstan/PATCH-MANAGEMENT-AUTOMATION-WITH-ANSIBLE/blob/main/automatelynis.yml">Scan results:</a> Here is the result that have been obtained from the scan performed by the discovery playbook, you can access it here —&gt; <a target="_blank" href="https://github.com/yvesstan/PATCH-MANAGEMENT-AUTOMATION-WITH-ANSIBLE/blob/main/automatelynis.yml">PATCH-MANAGEMENT-AUTOMATION-WITH-ANSIBLE/scan_results.txt at main · yvesstan/PATCH-MANAGEMENT-AUTOMAT</a><a target="_blank" href="https://github.com/yvesstan/PATCH-MANAGEMENT-AUTOMATION-WITH-ANSIBLE/blob/main/scan_results.txt">ION-WITH-ANSIBLE</a> |</p>
<p>ossec.yml —&gt; You ou have to install ossec to fix the error encounter at the section “Install Ossec“ of the discovery playbook, you can access it here —&gt; <a target="_blank" href="https://github.com/yvesstan/PATCH-MANAGEMENT-AUTOMATION-WITH-ANSIBLE/blob/main/ossec.yml">PATCH-MANAGEMENT-AUTOMATION-WITH-ANSIBLE/ossec.yml at main · yvesstan/PATCH-MANAGEMENT-AUTOMATION-WITH-ANSIBLE</a></p>
<p>automatelynis.yml —&gt; Here is the final playbook which main goal is to patch all the security weaknesses that have been discovered at the OS level, you can access it here —&gt; <a target="_blank" href="https://github.com/yvesstan/PATCH-MANAGEMENT-AUTOMATION-WITH-ANSIBLE/blob/main/automatelynis.yml">PATCH-MANAGEMENT-AUTOMATION-WITH-ANSIBLE/automatelynis.yml at main · yvesstan/PATCH-MANAGEMENT-AUTOMATION-WITH-ANSIBLE</a></p>
<h2 id="heading-step-1-security-audit-scan-playbookhttpsgithubcomyvesstanpatch-management-automation-with-ansibleblobmainautomatelynisyml"><a target="_blank" href="https://github.com/yvesstan/PATCH-MANAGEMENT-AUTOMATION-WITH-ANSIBLE/blob/main/automatelynis.yml"><strong>Step 1: Security Audit Scan Playbook</strong></a></h2>
<p><a target="_blank" href="https://github.com/yvesstan/PATCH-MANAGEMENT-AUTOMATION-WITH-ANSIBLE/blob/main/automatelynis.yml">The first step involves creating an <strong>Ansible playbook</strong> to automate <strong>CVE discovery</strong></a> <a target="_blank" href="https://github.com/yvesstan/PATCH-MANAGEMENT-AUTOMATION-WITH-ANSIBLE/blob/main/vul_scan_automation.yml">on a L</a>inux system using the <strong>Lynis tool</strong>. This playbook is designed for enterprise environments, ensuring professionalism and efficiency.</p>
<h3 id="heading-playbook-vulscanautomationyml"><strong>📜 Playbook:</strong> <code>vul_scan_automation.yml</code></h3>
<h3 id="heading-workflow"><strong>🔄 Workflow:</strong></h3>
<ol>
<li><p><strong>Update the package list</strong>: Ensures all repositories and packages are up to date.</p>
</li>
<li><p><strong>Install required packages</strong>: Installs Lynis and other necessary tools for CVE scanning.</p>
</li>
<li><p><strong>Run vulnerabilities scan using Lynis</strong>: Executes a system scan with Lynis and captures the results.</p>
</li>
<li><p><strong>Save vulnerabilities scan results to a file</strong>: Logs scan results for later review.</p>
</li>
<li><p><strong>Notify the administrator</strong>: Sends an email notification with scan completion details and log file location <em>(not yet implemented)</em>.</p>
</li>
<li><p><strong>Clean up unused packages</strong>: Removes unnecessary packages and dependencies.</p>
</li>
<li><p><strong>Reboot the system if required</strong>: Applies updates and reboots the system if necessary.</p>
</li>
</ol>
<p>This playbook ensures automated security weaknesses discovery at the OS Kernel level and logs results for administrators to review and take the appropriate actions.</p>
<h3 id="heading-log-file-location"><strong>📂 Log File Location</strong></h3>
<p>In my setup, scan results are stored at:</p>
<pre><code class="lang-plaintext">/home/master/lynis_cve_scan.log
</code></pre>
<p>on both the Ansible master and slave nodes.</p>
<h2 id="heading-viewing-scan-results"><strong>Viewing Scan Results</strong></h2>
<p>To review the CVE scan results, you can use various methods:</p>
<h3 id="heading-terminal-commands"><strong>Terminal Commands:</strong></h3>
<ul>
<li><p><strong>Using</strong> <code>cat</code>:</p>
<pre><code class="lang-plaintext">  cat /home/master/lynis_cve_scan.log
</code></pre>
</li>
<li><p><strong>Using</strong> <code>less</code>:</p>
<pre><code class="lang-plaintext">  less /home/master/lynis_cve_scan.log
</code></pre>
<p>  (Use arrow keys to navigate, press <code>q</code> to quit.)</p>
</li>
<li><p><strong>Using a text editor</strong>:</p>
<pre><code class="lang-plaintext">  nano /home/master/lynis_cve_scan.log
</code></pre>
<p>  or</p>
<pre><code class="lang-plaintext">  vim /home/master/lynis_cve_scan.log
</code></pre>
</li>
<li><h3 id="heading-remote-access"><strong>Remote Access:</strong></h3>
<ul>
<li><strong>Using</strong> <code>scp</code> to transfer the file to your local machine:</li>
</ul>
</li>
</ul>
<pre><code class="lang-plaintext">    scp user@remote_host:/home/master/lynis_cve_scan.log /path/to/local/directory
</code></pre>
<ul>
<li><strong>Viewing in a web browser</strong>:</li>
</ul>
<pre><code class="lang-plaintext">sudo mv /home/master/lynis_cve_scan.log /var/www/html/
</code></pre>
<p>Then access: <a target="_blank" href="http://your_server_ip/lynis_cve_scan.log"><code>http://your_server_ip/lynis_cve_scan.log</code></a></p>
<p><strong>Converting Scan Results to HTML</strong></p>
<p>If you prefer an HTML format, install <code>aha</code> (ANSI-to-HTML converter):</p>
<pre><code class="lang-plaintext">sudo apt-get install aha
</code></pre>
<p>Convert the scan results:</p>
<pre><code class="lang-plaintext">cat /home/master/lynis_cve_scan.log | aha &gt; /home/master/lynis_cve_scan.html
</code></pre>
<p><img src="https://github.com/yvesstan/Cloud-Projects/raw/main/LabPic/videoframe_9645.png" alt /></p>
<h2 id="heading-step-2-automating-security-remediation"><strong>Step 2: Automating Security Remediation</strong></h2>
<p>Once vulnerabilities are identified, we can automate the remediation process by writing another playbook.</p>
<h3 id="heading-playbook-automatelynisyml"><strong>📜 Playbook:</strong> <code>automatelynis.yml</code></h3>
<p>Check the contents of this file in the repository for the remediation steps implemented.</p>
<p><img src="https://github.com/yvesstan/Cloud-Projects/raw/main/LabPic/automatelynis.png" alt /></p>
<h3 id="heading-possible-errors-amp-fixes"><strong>Possible Errors &amp; Fixes</strong></h3>
<p>If you encounter an error in the task <code>Install OSSEC</code>, you will find a separate playbook named <code>ossec.yml</code> that resolves this issue.</p>
<p><img src="https://github.com/yvesstan/Cloud-Projects/raw/main/LabPic/ossec.png" alt /></p>
<h2 id="heading-conclusion"><strong>Conclusion</strong></h2>
<p>This project demonstrates how <strong>Ansible</strong> can be leveraged to <strong>automate security audits and vulnerability remediation</strong> in an enterprise environment. By integrating these playbooks into your security workflow, you can enhance <strong>efficiency, consistency, and response time</strong> in patch management.</p>
<p>Feel free to <strong>contribute, suggest improvements, or reach out</strong> for discussions!</p>
]]></content:encoded></item><item><title><![CDATA[OpenSCAP for security compliance and vulnerability scanning]]></title><description><![CDATA[As a Security Architect within a Bank , the Chief Security Officer (CSO) of our organization has requested that a compliance scan be conducted to meet the…]]></description><link>https://yvesstan.space/openscap-for-security-compliance-and-vulnerability-scanning</link><guid isPermaLink="true">https://yvesstan.space/openscap-for-security-compliance-and-vulnerability-scanning</guid><category><![CDATA[cybersecurity]]></category><category><![CDATA[automation]]></category><category><![CDATA[compliance ]]></category><dc:creator><![CDATA[Yves Stanislas ADANI]]></dc:creator><pubDate>Wed, 21 Jan 2026 14:55:18 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1769008278395/a8ca4ef6-51bc-4760-b679-d87263c5134b.webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-main-objectives"><strong>Main objectives</strong></h2>
<p>As a Security Architect within a Bank , the Chief Security Officer (CSO) of our organization has requested that a compliance scan be conducted to meet the PCI-DSS requirements.</p>
<p>Let’s do that !</p>
<h3 id="heading-the-main-stages-of-the-procedure-adopted"><strong>The main stages of the procedure adopted</strong></h3>
<p>As a security Architect, where can we start or how can we proceed ?</p>
<p>We will then run tools based on the Security Content Automation Protocol (SCAP) standard for compliance and vulnerability scanning to perform our task(s) and at the end generate a comprehensive report to the C level which include our Chief Security Officer.</p>
<p>Let’s see the workflow which will be used to perform our task:</p>
<ul>
<li><p>Download the packages necessary for OpenSCAP and the SCAP security guide</p>
</li>
<li><p>Explore the scanning profiles available to use</p>
</li>
<li><p>Run the scan and generate an HTML report</p>
</li>
<li><p>Remediate an issue found during the scan</p>
</li>
<li><p>Re-run the scan to ensure the issue is remediated</p>
</li>
</ul>
<h3 id="heading-step-1"><strong>Step 1</strong></h3>
<p>We have to start by installing the SCAP packages SCAP (Security Content Automation Protocol) which is a NIST project that standardizes the language for describing assessment criteria and findings. In our situation we’ll choose OpenSCAP, available in RHEL, which is a SCAP based compliance toolkit that includes policies and tools that can allow us to scan and evaluate host machines.</p>
<p>Prior to getting started, we will install the package that consists of the command line interface of the OpenSCAP scanner (oscap). OpenSCAP also has a graphical tool called SCAP workbench, but in this lab, we will only be using the command line interface. We will also install the SCAP Security guide, which implements security guidance rules and remediation scripts by respective authorities, namely PCI DSS, STIG, etc. In this lab, we will scan the system against the PCI DSS profile.</p>
<p>Ensure that apache server, OpenSCAP scanner and definitions are installed with the command below; it’s safe to run even if the packages already exist. OpenSCAP is not dependant on apache server, however it is needed in this lab for the purposes of viewing the HTML report generated by OpenSCAP.</p>
<p><strong><mark>yum install -y httpd openscap-scanner scap-security-guide</mark></strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1739276462243/feaefe31-e9d0-4d32-94e3-68ea1de54d8c.png" alt /></p>
<p>After the installation, all SCAP Security Guide security policies are in the /usr/share/xml/scap/ssg/content/ directory.</p>
<p>We can verify that by executing this command —&gt; <strong><mark>ls /usr/share/xml/scap/ssg/content</mark></strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1739276572848/d806a5ba-cdd6-4a19-863a-d601108a27c3.png" alt /></p>
<h3 id="heading-step-2"><strong>Step 2</strong></h3>
<p>Now let’s continue by displaying available profiles. We can display all available profiles in the datastream file using the openscap info command. For this lab, you will be using the RHEL9 datastream file.</p>
<p><strong><mark>oscap info /usr/share/xml/scap/ssg/content/ssg-rhel9-ds.xml</mark></strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1739276835916/b18f014a-f3e2-4b23-9228-7a9fe5a878b4.png" alt /></p>
<blockquote>
<p><strong><em>&lt;&lt; OUTPUT ABRIDGED &gt;&gt; Profiles: Title: ANSSI-BP-028 (enhanced) Id: xccdf_org.ssgproject.content_profile_anssi_bp28_enhanced Title: ANSSI-BP-028 (high) Id: xccdf_org.ssgproject.content_profile_anssi_bp28_high Title: ANSSI-BP-028 (intermediary) Id: xccdf_org.ssgproject.content_profile_anssi_bp28_intermediary Title: ANSSI-BP-028 (minimal) Id: xccdf_org.ssgproject.content_profile_anssi_bp28_minimal Title: CCN Red Hat Enterprise Linux 9 - Advanced Id: xccdf_org.ssgproject.content_profile_ccn_advanced Title: CCN Red Hat Enterprise Linux 9 - Basic Id: xccdf_org.ssgproject.content_profile_ccn_basic Title: CCN Red Hat Enterprise Linux 9 - Intermediate Id: xccdf_org.ssgproject.content_profile_ccn_intermediate Title: CIS Red Hat Enterprise Linux 9 Benchmark for Level 2 - Server Id: xccdf_org.ssgproject.content_profile_cis Title: CIS Red Hat Enterprise Linux 9 Benchmark for Level 1 - Server Id: xccdf_org.ssgproject.content_profile_cis_server_l1 Title: CIS Red Hat Enterprise Linux 9 Benchmark for Level 1 - Workstation Id: xccdf_org.ssgproject.content_profile_cis_workstation_l1 Title: CIS Red Hat Enterprise Linux 9 Benchmark for Level 2 - Workstation Id: xccdf_org.ssgproject.content_profile_cis_workstation_l2 Title: [DRAFT] Unclassified Information in Non-federal Information Systems and Organizations (NIST 800-171) Id: xccdf_org.ssgproject.content_profile_cui Title: Australian Cyber Security Centre (ACSC) Essential Eight Id: xccdf_org.ssgproject.content_profile_e8 Title: Health Insurance Portability and Accountability Act (HIPAA) Id: xccdf_org.ssgproject.content_profile_hipaa Title: Australian Cyber Security Centre (ACSC) ISM Official Id: xccdf_org.ssgproject.content_profile_ism_o Title: Protection Profile for General Purpose Operating Systems Id: xccdf_org.ssgproject.content_profile_ospp Title: PCI-DSS v3.2.1 Control Baseline for Red Hat Enterprise Linux 9 Id: xccdf_org.ssgproject.content_profile_pci-dss Title: [DRAFT] DISA STIG for Red Hat Enterprise Linux 9 Id: xccdf_org.ssgproject.content_profile_stig Title: [DRAFT] DISA STIG with GUI for Red Hat Enterprise Linux 9 Id: xccdf_org.ssgproject.content_profile_stig_gui Referenced check files: ssg-rhel9-oval.xml system:</em></strong> <a target="_blank" href="http://oval.mitre.org/XMLSchema/oval-definitions-5"><strong><em>http://oval.mitre.org/XMLSchema/oval-definitions-5</em></strong></a> <strong><em>ssg-rhel9-ocil.xml system:</em></strong> <a target="_blank" href="http://scap.nist.gov/schema/ocil/2"><strong><em>http://scap.nist.gov/schema/ocil/2</em></strong></a> <a target="_blank" href="http://security-data-oval-v2-rhel9-rhel-9.oval.xml.bz/"><strong><em>security-data-oval-v2-RHEL9-rhel-9.oval.xml.bz</em></strong></a><strong><em>2 system:</em></strong> <a target="_blank" href="http://oval.mitre.org/XMLSchema/oval-definitions-5"><strong><em>http://oval.mitre.org/XMLSchema/oval-definitions-5</em></strong></a> <strong><em>&lt;&lt; OUTPUT ABRIDGED &gt;&gt;</em></strong></p>
</blockquote>
<p>We have to note that each profile in the output has a title which describes the profile and corresponding Id. For this lab, we are interested in the PCI-DSS profile, and the corresponding Id is xccdf_org.ssgproject.content_profile_pci-dss.</p>
<p>A profile contains generic security recommendations that apply to all Red Hat Enterprise Linux installations and additional security recommendations that are specific to the intended usage of a system. To obtain information about a specific profile, specify the profile Id using the --profile option.</p>
<p><strong><mark>oscap info --profile xccdf_org.ssgproject.content_profile_pci-dss /usr/share/xml/scap/ssg/content/ssg-rhel9-ds.xml</mark></strong></p>
<p>The datastream file makes references to remote OVAL content that is regularly updated. During scanning, OpenSCAP attempts to download the resources locally if --fetch-remote-resources option is provided.</p>
<h3 id="heading-step-3"><strong>Step 3</strong></h3>
<p>At this level we will scan and generate a report</p>
<p>A XCCDF document is a structured collection of security configuration rules for some set of target system. In this case, it has the configuration rules that meet the PCI regulation.</p>
<p>To start scanning using OpenSCAP, we will use the oscap xccdf eval command with the profile Id, option to fetch remote resources, output XML results file, and the datastream file.</p>
<p><strong><mark>oscap xccdf eval --fetch-remote-resources --profile xccdf_org.ssgproject.content_profile_pci-dss --results /tmp/scan-xccdf-results.xml /usr/share/xml/scap/ssg/content/ssg-rhel9-ds.xml</mark></strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1739279291850/f5ed36ff-0563-4bf3-878b-5cf9270d9baa.png" alt /></p>
<p>This scan can take a few minutes to complete as it has to evaluate all the rules, and generate a XML file that has the results.</p>
<p>Once the scan completes, you can look at the pass/fail status of each rule in the output . The XML results file can be transformed into HTML or plain-text format for easier readability</p>
<p><strong><mark>oscap xccdf generate report /tmp/scan-xccdf-results.xml &gt; /var/www/html/index.html</mark></strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1739279460305/5dc2fe39-6671-4331-a978-b789872e4174.png" alt /></p>
<p>Now Let's see our result in HTML format</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1739279548097/ecbe19eb-d3a9-4f3e-b0be-65b8ce980fbe.png" alt /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1739279562485/15ec296d-8935-445c-9fe7-50b2c9d9ca53.png" alt /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1739279588178/1a3c8d4c-32c7-4b37-9f35-cd12a6509817.png" alt /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1739279604111/052ce9b1-3a27-48ae-bd5f-0ea6f80710b5.png" alt /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1739279635762/ae89d8f8-4c62-41a8-afe7-9e2e8307be36.png" alt /></p>
<h3 id="heading-step-4"><strong>Step 4</strong></h3>
<p>Now let’s remediating and rescanning against a profile. One of the many failed rules in the scan previously done was related to IPSec support. In this step, we will remediate a single failed rule related to IPSec support.</p>
<p>It is really important to note that many of the remediations involve restarting the host to be effective.</p>
<p>Re-scan the host passing the --remediation option to carry out an online remediation. Additionally, provide the Rule ID from the previous step (xccdf_org.ssgproject.content_rule_package_libreswan_installed) to remediate the specific rule. If no Rule ID is provided, oscap attempts to remediate all the failed rules.</p>
<p><strong><mark>oscap xccdf eval --profile xccdf_org.ssgproject.content_profile_pci-dss --remediate --fetch-remote-resources --results scan-xccdf-results.xml --rule xccdf_org.ssgproject.content_rule_package_libreswan_installed /usr/share/xml/scap/ssg/content/ssg-rhel9-ds.xml</mark></strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1739279832796/1563be63-0973-4fea-a661-ccc8a8ba213f.png" alt /></p>
<p>To verify that the issue is remediated, we have to re-run the previous command. Oscap only attempts to fix what is broken, so it will not remediate an already fixed rule.</p>
<p><strong><mark>oscap xccdf eval --profile xccdf_org.ssgproject.content_profile_pci-dss --remediate --fetch-remote-resources --results scan-xccdf-results.xml --rule xccdf_org.ssgproject.content_rule_package_libreswan_installed /usr/share/xml/scap/ssg/content/ssg-rhel9-ds.xml</mark></strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1739279919392/95afa863-3000-432e-baa8-930ede3e38cb.png" alt /></p>
<p>The remediation starts but there is no work left to be done.</p>
<p>And guest what ? We have done</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1739280376370/89c4e23e-f043-42e7-95f2-ddae24fbbc97.jpeg" alt /></p>
]]></content:encoded></item><item><title><![CDATA[Hunting Infostealers with PowerShell: A Practical Guide to Building a Forensic Triage Script]]></title><description><![CDATA[PowerShell malware hunting: capture processes, autoruns, network IOCs, and suspicious files. A practical workflow for blue teams & forensic analysts.]]></description><link>https://yvesstan.space/hunting-infostealers-with-powershell-a-practical-guide-to-building-a-forensic-triage-script</link><guid isPermaLink="true">https://yvesstan.space/hunting-infostealers-with-powershell-a-practical-guide-to-building-a-forensic-triage-script</guid><dc:creator><![CDATA[Yves Stanislas ADANI]]></dc:creator><pubDate>Wed, 17 Sep 2025 12:56:12 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1758113294324/5b025043-3371-4250-96c7-d39f41bb4320.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1 id="heading-introduction">Introduction</h1>
<p>Infostealers remain one of the most prevalent malware families in the wild. They aim to harvest browser credentials, cookies, crypto wallets, and sensitive files before exfiltrating them to command-and-control (C2) infrastructure.<br />In enterprise environments, where endpoints are diverse and visibility might be partial, having a lightweight, PowerShell-based triage tool is invaluable for security analysts and forensic responders.</p>
<p>In this article, I’ll share the full process I followed to <strong>design, troubleshoot, and refine</strong> a PowerShell script that detects infostealer behavior, collects forensic artefacts, and generates HTML/JSON reports that analysts can immediately consume.</p>
<hr />
<h2 id="heading-why-powershell">Why PowerShell?</h2>
<ul>
<li><p><strong>Native availability</strong>: PowerShell is installed on all modern Windows systems — no extra agents or binaries required.</p>
</li>
<li><p><strong>Rapid prototyping</strong>: Easy to iterate, test, and extend.</p>
</li>
<li><p><strong>Enterprise fit</strong>: Can run locally or remotely (<code>Invoke-Command</code>), integrates with Active Directory environments, and outputs both machine-readable (JSON) and human-readable (HTML) formats.</p>
</li>
<li><p><strong>Minimal dependencies</strong>: The final version does not rely on external tools like YARA, making it portable.</p>
</li>
</ul>
<hr />
<h2 id="heading-step-1-defining-the-scope">Step 1 — Defining the Scope</h2>
<p>I wanted the script to cover <strong>key forensic questions</strong> relevant to infostealers:</p>
<ol>
<li><p><strong>What processes are running?</strong><br /> Are any executing from suspicious locations (AppData, Temp, etc.)?</p>
</li>
<li><p><strong>What network connections are active?</strong><br /> Are there external (non-private) established connections?</p>
</li>
<li><p><strong>What persistence mechanisms exist?</strong><br /> Registry Run keys, suspicious services, scheduled tasks.</p>
</li>
<li><p><strong>What evidence is on disk?</strong><br /> Recent files in drop zones, suspicious extensions (<code>.exe</code>, <code>.dll</code>, <code>.bat</code>, <code>.ps1</code>, etc.).</p>
</li>
<li><p><strong>What system metadata is useful?</strong><br /> Hostname, boot time, user, OS version, DNS cache.</p>
</li>
<li><p><strong>How do we make this consumable?</strong><br /> Produce an HTML dashboard and a JSON artefact, alongside raw CSVs and copied files.</p>
</li>
</ol>
<hr />
<h2 id="heading-step-2-building-the-script-core">Step 2 — Building the Script Core</h2>
<p>The initial draft gathered processes, connections, autoruns, services, event logs, and files. It also exported CSVs for easy analysis in Excel.</p>
<p>Evidence collection logic included:</p>
<ul>
<li><p>Copy suspicious files to an <strong>Evidence</strong> directory.</p>
</li>
<li><p>Optionally compute <strong>SHA256 hashes</strong> for each file.</p>
</li>
<li><p>Support matching against a <strong>known bad hash list</strong> if available.</p>
</li>
</ul>
<p>At this stage, the script already worked but needed refinement.</p>
<hr />
<h2 id="heading-step-3-overcoming-powershell-gotchas">Step 3 — Overcoming PowerShell Gotchas</h2>
<p>As I iterated, I hit common PowerShell pitfalls:</p>
<h3 id="heading-1-reserved-variables">1. Reserved variables</h3>
<ul>
<li><p><code>$Host</code> and <code>$PID</code> are built-in read-only variables.</p>
</li>
<li><p>Attempting to reuse them caused errors:</p>
<ul>
<li><p><em>“Cannot overwrite variable Host because it is read-only or constant”</em></p>
</li>
<li><p><em>“Cannot overwrite variable PID because it is read-only or constant”</em></p>
</li>
</ul>
</li>
<li><p><strong>Fix</strong>: rename to <code>$Hostname</code>, <code>$OwningPid</code>, <code>$nsPid</code>.</p>
</li>
</ul>
<h3 id="heading-2-strictmode-property-errors">2. StrictMode property errors</h3>
<ul>
<li><p>Accessing <code>.EvidencePath</code> on objects where the property hadn’t been set caused:<br />  <em>“The property ‘EvidencePath’ cannot be found…”</em></p>
</li>
<li><p><strong>Fix</strong>: initialize optional properties (<code>EvidencePath</code>, <code>SHA256</code>, <code>KnownBadMatch</code>) during object creation.</p>
</li>
</ul>
<h3 id="heading-3-long-path-copying">3. Long path copying</h3>
<ul>
<li><p><code>Copy-Item</code> failed on certain Windows paths.</p>
</li>
<li><p><strong>Fix</strong>: fallback to <code>robocopy</code> for long path support.</p>
</li>
</ul>
<blockquote>
<p><strong>Key lesson:</strong> Forensic automation is as much about robustness as detection. A script that fails mid-run in the field is unusable.</p>
</blockquote>
<hr />
<h2 id="heading-step-4-adding-reporting">Step 4 — Adding Reporting</h2>
<p>For analysts, raw CSVs are valuable, but reports drive action. I implemented:</p>
<ul>
<li><p><strong>HTML report</strong>:</p>
<ul>
<li><p>Summary counts (suspicious processes, external connections, suspicious files).</p>
</li>
<li><p>IOC table (type, value, description, confidence, evidence path).</p>
</li>
<li><p>Sectioned tables for processes, services, autoruns, etc.</p>
</li>
<li><p>Analyst notes and recommended next steps.</p>
</li>
</ul>
</li>
<li><p><strong>JSON report</strong>:<br />  Machine-readable format for pipeline integration or later aggregation across hosts.</p>
</li>
<li><p><strong>Evidence ZIP</strong>:<br />  Auto-compressed archive of the full evidence folder for easy transfer.</p>
</li>
</ul>
<hr />
<h2 id="heading-step-5-executing-the-script">Step 5 — Executing the Script</h2>
<p>To run on a host:</p>
<pre><code class="lang-powershell">.\InfostealerHunt_PSOnly.ps1 `
  <span class="hljs-literal">-OutputHtmlPath</span> <span class="hljs-string">"C:\Users\Administrator\Desktop\HuntReport.html"</span> `
  <span class="hljs-literal">-EvidenceRoot</span>   <span class="hljs-string">"C:\Users\Administrator\Desktop\Evidence"</span>
</code></pre>
<p>The script outputs:</p>
<ul>
<li><p><code>HuntReport.html</code> → open in a browser for IOC insights.</p>
</li>
<li><p><code>HuntReport.json</code> → structured data for advanced queries.</p>
</li>
<li><p><code>Evidence\</code> → folder with CSVs, logs, copied files, and metadata.</p>
</li>
<li><p><a target="_blank" href="http://Evidence.zip"><code>Evidence.zip</code></a> → compressed archive of the above.</p>
</li>
</ul>
<p>Sample console output:</p>
<pre><code class="lang-plaintext">HTML report: C:\Users\Administrator\Desktop\HuntReport.html
JSON report: C:\Users\Administrator\Desktop\HuntReport.json
Evidence dir: C:\Users\Administrator\Desktop\Evidence
Evidence ZIP : C:\Users\Administrator\Desktop\Evidence.zip
Suspicious Processes: 12; External Conns: 27; Suspicious Files: 41; IOCs: 80
</code></pre>
<hr />
<h2 id="heading-step-6-visualizing-amp-triaging">Step 6 — Visualizing &amp; Triaging</h2>
<ol>
<li><p><strong>Open the HTML report</strong>: quick overview of suspicious artifacts.</p>
</li>
<li><p><strong>Investigate High-confidence IOCs</strong>:</p>
<ul>
<li><p>Processes/services in AppData/Temp.</p>
</li>
<li><p>Files matching known bad hashes.</p>
</li>
<li><p>External connections to untrusted IPs.</p>
</li>
</ul>
</li>
<li><p><strong>Review raw CSVs</strong>: deeper pivoting in Excel or PowerShell.</p>
</li>
<li><p><strong>Inspect collected files</strong>: hash them, analyze in a sandbox, or escalate to a malware lab.</p>
</li>
<li><p><strong>At the end you’ll have something like this :</strong></p>
</li>
<li><p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1758111385249/b5d25e65-aea7-4b39-b045-4b393cb2bdc6.gif" alt="Demo" class="image--center mx-auto" /></p>
</li>
</ol>
<hr />
<h2 id="heading-key-lessons-learned">Key Lessons Learned</h2>
<ul>
<li><p><strong>PowerShell quirks matter</strong>: reserved variables and strict property access can break scripts in production.</p>
</li>
<li><p><strong>Robustness &gt; detection</strong>: triage scripts must fail gracefully, initialize properties, and handle long paths.</p>
</li>
<li><p><strong>Reporting is half the battle</strong>: a clear HTML report makes evidence accessible for managers and SOC analysts, not just forensics.</p>
</li>
<li><p><strong>Iterative debugging is essential</strong>: each error refined the tool into a resilient utility.</p>
</li>
</ul>
<hr />
<h2 id="heading-conclusion">Conclusion</h2>
<p>By walking through the process of <strong>design → debugging → reporting → execution</strong>, I ended up with a <strong>portable, PowerShell-only hunting script</strong>.<br />It allows forensic analysts to quickly triage a potentially compromised endpoint, gather high-value evidence, and generate actionable reports — all with no external dependencies.</p>
<p>In an age where infostealers evolve rapidly, having such lightweight forensic tools at hand empowers incident responders to contain threats faster and with greater confidence.</p>
<hr />
<h2 id="heading-whats-next">What’s Next</h2>
<p>Future improvements could include:</p>
<ul>
<li><p>Remote execution across multiple hosts with aggregated reporting.</p>
</li>
<li><p>Integration with SIEM/EDR APIs to enrich IOC context.</p>
</li>
<li><p>Automated submission of suspicious hashes/files to internal sandbox systems.</p>
</li>
</ul>
<hr />
<p><em>Do you use PowerShell for forensic triage or malware hunting? Let me know your experience in the comments, I’d love to hear how others adapt lightweight scripts in their workflows.</em></p>
]]></content:encoded></item><item><title><![CDATA[Automate Your Wazuh Alert Enhancement Process]]></title><description><![CDATA[Learn how to enrich Wazuh alerts with agent group data in OpenSearch to build a scalable multitenant SOC architecture for client-level visibility]]></description><link>https://yvesstan.space/automate-your-wazuh-alert-enhancement-process</link><guid isPermaLink="true">https://yvesstan.space/automate-your-wazuh-alert-enhancement-process</guid><category><![CDATA[detection engineering ]]></category><category><![CDATA[DevSecOps]]></category><category><![CDATA[SIEM]]></category><dc:creator><![CDATA[Yves Stanislas ADANI]]></dc:creator><pubDate>Fri, 08 Aug 2025 19:35:32 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1754680761451/28ba1817-64a6-4205-9e7e-0418cd7ca4a9.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<hr />
<h2 id="heading-introduction">Introduction</h2>
<p>While building a multitenant SOC architecture using Wazuh and OpenSearch, I quickly ran into a critical issue:</p>
<blockquote>
<p><strong>Wazuh alerts do not include the agent group(s) by default.</strong></p>
</blockquote>
<p>In a setup where each client is represented by a group of agents, this missing field becomes a major obstacle for filtering, visualizing, and correlating events effectively.</p>
<p>This post walks through the entire process I followed to solve this limitation by creating a smart ingestion pipeline that enriches alerts with the <code>agent_group</code> field.</p>
<hr />
<h2 id="heading-technical-architecture">Technical Architecture</h2>
<p>Here are the key components of the system:</p>
<ul>
<li><p><strong>Wazuh Manager</strong>: collects and analyzes security events</p>
</li>
<li><p><strong>Filebeat</strong>: lightweight forwarder that ships alerts to OpenSearch</p>
</li>
<li><p><strong>OpenSearch</strong>: search and analytics engine</p>
</li>
<li><p><strong>OpenSearch Dashboards</strong>: visualization interface</p>
</li>
<li><p><strong>Ingest Pipeline</strong>: custom pipeline to enrich incoming documents</p>
</li>
</ul>
<p>At the end to implement our pipeline, in the logic architecture view we can have something like this :</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1754653015215/99422094-5677-4a45-aa25-823dfaa837d8.png" alt class="image--center mx-auto" /></p>
<hr />
<h2 id="heading-initial-problem">Initial Problem</h2>
<p>Wazuh alerts include fields like <a target="_blank" href="http://agent.id"><code>agent.id</code></a> and <a target="_blank" href="http://agent.name"><code>agent.name</code></a>, but <strong>not</strong> <a target="_blank" href="http://agent.group.name"><code>agent.group.name</code></a>, even when agents are assigned to groups in the Wazuh Manager.</p>
<p>This makes it impossible to:</p>
<ul>
<li><p>Filter alerts by client in Discover</p>
</li>
<li><p>Build multitenant dashboards</p>
</li>
<li><p>Automate alerting per group</p>
</li>
</ul>
<hr />
<h2 id="heading-resolution-steps">Resolution Steps</h2>
<h3 id="heading-1-inspecting-the-data">1. Inspecting the Data</h3>
<p>I started by querying OpenSearch:</p>
<pre><code class="lang-json">GET wazuh-alerts-*/_search
{
  <span class="hljs-attr">"size"</span>: <span class="hljs-number">1</span>,
  <span class="hljs-attr">"_source"</span>: [<span class="hljs-string">"agent.id"</span>, <span class="hljs-string">"agent.name"</span>, <span class="hljs-string">"agent.group.name"</span>]
}
</code></pre>
<p>Result: <a target="_blank" href="http://agent.group.name"><code>agent.group.name</code></a> was missing.</p>
<hr />
<h3 id="heading-2-attempts-on-the-wazuh-side">2. Attempts on the Wazuh Side</h3>
<p>I tried assigning agents to groups:</p>
<pre><code class="lang-bash">/var/ossec/bin/agent_groups -a -i 001 -g clientA
/var/ossec/bin/agent_control -i 001
</code></pre>
<p>Then modified <code>ossec.conf</code>:</p>
<pre><code class="lang-xml"><span class="hljs-tag">&lt;<span class="hljs-name">agent_info</span>&gt;</span>yes<span class="hljs-tag">&lt;/<span class="hljs-name">agent_info</span>&gt;</span>
</code></pre>
<p>Restarted the manager:</p>
<pre><code class="lang-bash">sudo systemctl restart wazuh-manager
</code></pre>
<p>Still, the field didn’t appear in the alerts.</p>
<hr />
<h3 id="heading-3-solution-manual-enrichment-via-filebeat">3. Solution: Manual Enrichment via Filebeat</h3>
<p>I added a conditional enrichment block in <code>filebeat.yml</code>:</p>
<pre><code class="lang-yaml"><span class="hljs-attr">processors:</span>
  <span class="hljs-bullet">-</span> <span class="hljs-attr">add_fields:</span>
      <span class="hljs-attr">when:</span>
        <span class="hljs-attr">equals:</span>
          <span class="hljs-attr">agent.name:</span> <span class="hljs-string">"clientA-agent"</span>
      <span class="hljs-attr">fields:</span>
        <span class="hljs-attr">agent_group:</span> <span class="hljs-string">"clientA"</span>
      <span class="hljs-attr">target:</span> <span class="hljs-string">""</span>
</code></pre>
<p>This adds the <code>agent_group</code> field to each matching document.</p>
<p>We can then have something like the following screenshot during the configuration :</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1754680920647/03fdd7eb-bcf7-449b-b4f5-7c789c6bc9cf.png" alt class="image--center mx-auto" /></p>
<hr />
<h3 id="heading-4-testing-and-validation">4. Testing and Validation</h3>
<p>Now we have to restart Filebeat by executing the following command:</p>
<pre><code class="lang-bash">sudo systemctl restart filebeat
</code></pre>
<p>Triggered an alert on the agent.<br />We can now check in Discover: <code>agent_group</code> was present and correctly populated.</p>
<hr />
<h3 id="heading-5-reindexing-historical-data">5. Reindexing Historical Data</h3>
<p>To enrich past alerts:</p>
<pre><code class="lang-json">POST _reindex
{
  <span class="hljs-attr">"source"</span>: {
    <span class="hljs-attr">"index"</span>: <span class="hljs-string">"wazuh-alerts-2025.06.18"</span>
  },
  <span class="hljs-attr">"dest"</span>: {
    <span class="hljs-attr">"index"</span>: <span class="hljs-string">"wazuh-alerts-2025.06.18-reindexed"</span>,
    <span class="hljs-attr">"pipeline"</span>: <span class="hljs-string">"add-agent-group"</span>
  }
}
</code></pre>
<hr />
<h3 id="heading-6-visualization-in-opensearch-dashboards">6. Visualization in OpenSearch Dashboards</h3>
<ul>
<li><p>Created a new index pattern for the reindexed data</p>
</li>
<li><p>Verified <code>agent_group</code> in Discover</p>
</li>
<li><p>Built dashboards with filters by group</p>
</li>
</ul>
<p>You can notice tis beautiful enrichement on the following screenshot of my home lab after completing the implementation of my pipelines:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1754653262965/559a4ca7-0bf8-49e0-bef8-b6098f051e1e.png" alt class="image--center mx-auto" /></p>
<hr />
<h2 id="heading-final-outcome">Final Outcome</h2>
<p>Thanks to this pipeline:</p>
<ul>
<li><p>Alerts are automatically enriched with agent group data</p>
</li>
<li><p>Client-based filtering and visualization is now possible</p>
</li>
<li><p>The SOC can operate in true multitenant mode</p>
</li>
</ul>
<hr />
<h2 id="heading-future-improvements">Future Improvements</h2>
<p>This pipeline can be extended to:</p>
<ul>
<li><p>Handle hundreds of agents</p>
</li>
<li><p>Use external mapping files (JSON, YAML)</p>
</li>
<li><p>Apply advanced enrichment via OpenSearch scripting (Painless)</p>
</li>
</ul>
<hr />
<h2 id="heading-conclusion">Conclusion</h2>
<p>This project turned a technical limitation into an architectural opportunity.<br />By mastering data ingestion and enrichment, I made Wazuh + OpenSearch truly multitenant — ready for SOC-as-a-Service.</p>
<blockquote>
<p>Data means nothing without context.<br />And context is what we build.</p>
</blockquote>
<hr />
<p><em>Follow me for more posts on cybersecurity, SOC engineering, and DevSecOps automation!</em></p>
<p>Here is my linkedin post related to this article —&gt; <a target="_blank" href="https://www.linkedin.com/posts/yves-stanislas-adani_wazuh-socasaservice-multitenancy-activity-7341279532831674368-Y0T5?utm_source=share&amp;utm_medium=member_desktop&amp;rcm=ACoAADlkl3EB5_DFg8rmXKh81v-v_UYFaetVO-w">https://www.linkedin.com/posts/yves-stanislas-adani_wazuh-socasaservice-multitenancy-activity-7341279532831674368-Y0T5?utm_source=share&amp;utm_medium=member_desktop&amp;rcm=ACoAADlkl3EB5_DFg8rmXKh81v-v_UYFaetVO-w</a></p>
<hr />
]]></content:encoded></item></channel></rss>