quot;>%WINDIR%</directories> <directories recursion_level="0" restrict="at.exe$|attrib.exe$|cacls.exe$|cmd.exe$|eventcreate.exe$|ftp.exe$|lsass.exe$|net.exe$|net1.exe$|netsh.exe$|reg.exe$|regedt32.exe|regsvr32.exe|runas.exe|sc.exe|schtasks.exe|sethc.exe|subst.exequot;>%WINDIR%\SysNative</directories> <directories recursion_level="0">%WINDIR%\SysNative\drivers\etc</directories> <directories recursion_level="0" restrict="WMIC.exequot;>%WINDIR%\SysNative\wbem</directories> <directories recursion_level="0" restrict="powershell.exequot;>%WINDIR%\SysNative\WindowsPowerShell\v1.0</directories> <directories recursion_level="0" restrict="winrm.vbsquot;>%WINDIR%\SysNative</directories> <!-- 32-bit programs. --> <directories recursion_level="0" restrict="at.exe$|attrib.exe$|cacls.exe$|cmd.exe$|eventcreate.exe$|ftp.exe$|lsass.exe$|net.exe$|net1.exe$|netsh.exe$|reg.exe$|regedit.exe$|regedt32.exe$|regsvr32.exe$|runas.exe$|sc.exe$|schtasks.exe$|sethc.exe$|subst.exequot;>%WINDIR%\System32</directories> <directories recursion_level="0">%WINDIR%\System32\drivers\etc</directories> <directories recursion_level="0" restrict="WMIC.exequot;>%WINDIR%\System32\wbem</directories> <directories recursion_level="0" restrict="powershell.exequot;>%WINDIR%\System32\WindowsPowerShell\v1.0</directories> <directories recursion_level="0" restrict="winrm.vbsquot;>%WINDIR%\System32</directories> <directories realtime="yes">%PROGRAMDATA%\Microsoft\Windows\Start Menu\Programs\Startup</directories> <ignore>%PROGRAMDATA%\Microsoft\Windows\Start Menu\Programs\Startup\desktop.ini</ignore> <ignore type="sregex">.log$|.htm$|.jpg$|.png$|.chm$|.pnf$|.evtxlt;/ignore> <!-- Windows registry entries to monitor. --> <windows_registry>HKEY_LOCAL_MACHINE\Software\Classes\batfile</windows_registry> <windows_registry>HKEY_LOCAL_MACHINE\Software\Classes\cmdfile</windows_registry> <windows_registry>HKEY_LOCAL_MACHINE\Software\Classes\comfile</windows_registry> <windows_registry>HKEY_LOCAL_MACHINE\Software\Classes\exefile</windows_registry> <windows_registry>HKEY_LOCAL_MACHINE\Software\Classes\piffile</windows_registry> <windows_registry>HKEY_LOCAL_MACHINE\Software\Classes\AllFilesystemObjects</windows_registry> <windows_registry>HKEY_LOCAL_MACHINE\Software\Classes\Directory</windows_registry> <windows_registry>HKEY_LOCAL_MACHINE\Software\Classes\Folder</windows_registry> <windows_registry arch="both">HKEY_LOCAL_MACHINE\Software\Classes\Protocols</windows_registry> <windows_registry arch="both">HKEY_LOCAL_MACHINE\Software\Policies</windows_registry> <windows_registry>HKEY_LOCAL_MACHINE\Security</windows_registry> <windows_registry arch="both">HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer</windows_registry> <windows_registry>HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services</windows_registry> <windows_registry>HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\KnownDLLs</windows_registry> <windows_registry>HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\winreg</windows_registry> <windows_registry arch="both">HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run</windows_registry> <windows_registry arch="both">HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce</windows_registry> <windows_registry>HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnceEx</windows_registry> <windows_registry arch="both">HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\URL</windows_registry> <windows_registry arch="both">HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies</windows_registry> <windows_registry arch="both">HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Windows</windows_registry> <windows_registry arch="both">HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon</windows_registry> <windows_registry arch="both">HKEY_LOCAL_MACHINE\Software\Microsoft\Active Setup\Installed Components</windows_registry> <!-- Windows registry entries to ignore. --> <registry_ignore>HKEY_LOCAL_MACHINE\Security\Policy\Secrets</registry_ignore> <registry_ignore>HKEY_LOCAL_MACHINE\Security\SAM\Domains\Account\Users</registry_ignore> <registry_ignore type="sregex">\Enumlt;/registry_ignore> <registry_ignore>HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\MpsSvc\Parameters\AppCs</registry_ignore> <registry_ignore>HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\MpsSvc\Parameters\PortKeywords\DHCP</registry_ignore> <registry_ignore>HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\MpsSvc\Parameters\PortKeywords\IPTLSIn</registry_ignore> <registry_ignore>HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\MpsSvc\Parameters\PortKeywords\IPTLSOut</registry_ignore> <registry_ignore>HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\MpsSvc\Parameters\PortKeywords\RPC-EPMap</registry_ignore> <registry_ignore>HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\MpsSvc\Parameters\PortKeywords\Teredo</registry_ignore> <registry_ignore>HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\PolicyAgent\Parameters\Cache</registry_ignore> <registry_ignore>HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnceEx</registry_ignore> <registry_ignore>HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\ADOVMPPackage\Final</registry_ignore> <!-- Frequency for ACL checking (seconds) --> <windows_audit_interval>60</windows_audit_interval> <!-- Nice value for Syscheck module --> <process_priority>10</process_priority> <!-- Maximum output throughput --> <max_eps>100</max_eps> <!-- Database synchronization settings --> <synchronization> <enabled>yes</enabled> <interval>5m</interval> <max_interval>1h</max_interval> <max_eps>10</max_eps> </synchronization> </syscheck> <!-- System inventory --> <wodle name="syscollector"> <disabled>no</disabled> <interval>1h</interval> <scan_on_start>yes</scan_on_start> <hardware>yes</hardware> <os>yes</os> <network>yes</network> <packages>yes</packages> <ports all="no">yes</ports> <processes>yes</processes> <!-- Database synchronization settings --> <synchronization> <max_eps>10</max_eps> </synchronization> </wodle> <!-- CIS policies evaluation --> <wodle name="cis-cat"> <disabled>yes</disabled> <timeout>1800</timeout> <interval>1d</interval> <scan-on-start>yes</scan-on-start> <java_path>\\server\jre\bin\java.exe</java_path> <ciscat_path>C:\cis-cat</ciscat_path> </wodle> <!-- Osquery integration --> <wodle name="osquery"> <disabled>yes</disabled> <run_daemon>yes</run_daemon> <bin_path>C:\Program Files\osquery\osqueryd</bin_path> <log_path>C:\Program Files\osquery\log\osqueryd.results.log</log_path> <config_path>C:\Program Files\osquery\osquery.conf</config_path> <add_labels>yes</add_labels> </wodle> <!-- Active response --> <active-response> <disabled>no</disabled> <ca_store>wpk_root.pem</ca_store> <ca_verification>yes</ca_verification> </active-response> <!-- Log analysis --> <localfile> <location>Microsoft-Windows-Sysmon/Operational</location> <log_format>eventchannel</log_format> </localfile> <localfile> <location>Windows PowerShell</location> <log_format>eventchannel</log_format> </localfile> <localfile> <location>Microsoft-Windows-CodeIntegrity/Operational</location> <log_format>eventchannel</log_format> </localfile> <localfile> <location>Microsoft-Windows-TaskScheduler/Operational</location> <log_format>eventchannel</log_format> </localfile> <localfile> <location>Microsoft-Windows-PowerShell/Operational</location> <log_format>eventchannel</log_format> </localfile> <localfile> <location>Microsoft-Windows-Windows Firewall With Advanced Security/Firewall</location> <log_format>eventchannel</log_format> </localfile> <localfile> <location>Microsoft-Windows-Windows Defender/Operational</location> <log_format>eventchannel</log_format> </localfile> ``` Touch **Save* I can do the following with Linux as well, though I'm not going to do so on my box here, the Linux agent configuration would be the same except with these settings instead #### Linux Agent Configuration ```linux agent <client_buffer> <!-- Agent buffer options --> <disabled>no</disabled> <queue_size>5000</queue_size> <events_per_second>500</events_per_second> </client_buffer> <!-- Policy monitoring --> <rootcheck> <disabled>no</disabled> <!-- Frequency that rootcheck is executed - every 12 hours --> <frequency>43200</frequency> <rootkit_files>/var/ossec/etc/shared/rootkit_files.txt</rootkit_files> <rootkit_trojans>/var/ossec/etc/shared/rootkit_trojans.txt</rootkit_trojans> <system_audit>/var/ossec/etc/shared/system_audit_rcl.txt</system_audit> <system_audit>/var/ossec/etc/shared/system_audit_ssh.txt</system_audit> <system_audit>/var/ossec/etc/shared/cis_debian_linux_rcl.txt</system_audit> <skip_nfs>yes</skip_nfs> </rootcheck> <wodle name="open-scap"> <disabled>yes</disabled> <timeout>1800</timeout> <interval>1d</interval> <scan-on-start>yes</scan-on-start> <content type="xccdf" path="ssg-debian-8-ds.xml"> <profile>xccdf_org.ssgproject.content_profile_common</profile> </content> <content type="oval" path="cve-debian-oval.xml"/> </wodle> <!-- File integrity monitoring --> <syscheck> <disabled>no</disabled> <!-- Frequency that syscheck is executed default every 12 hours --> <frequency>43200</frequency> <scan_on_start>yes</scan_on_start> <!-- Directories to check (perform all possible verifications) --> <directories>/etc,/usr/bin,/usr/sbin</directories> <directories>/bin,/sbin,/boot</directories> <!-- Files/directories to ignore --> <ignore>/etc/mtab</ignore> <ignore>/etc/hosts.deny</ignore> <ignore>/etc/mail/statistics</ignore> <ignore>/etc/random-seed</ignore> <ignore>/etc/random.seed</ignore> <ignore>/etc/adjtime</ignore> <ignore>/etc/httpd/logs</ignore> <ignore>/etc/utmpx</ignore> <ignore>/etc/wtmpx</ignore> <ignore>/etc/cups/certs</ignore> <ignore>/etc/dumpdates</ignore> <ignore>/etc/svc/volatile</ignore> <ignore>/sys/kernel/security</ignore> <ignore>/sys/kernel/debug</ignore> <!-- File types to ignore --> <ignore type="sregex">.log$|.swplt;/ignore> <!-- Check the file, but never compute the diff --> <nodiff>/etc/ssl/private.key</nodiff> <skip_nfs>yes</skip_nfs> <skip_dev>yes</skip_dev> <skip_proc>yes</skip_proc> <skip_sys>yes</skip_sys> <!-- Nice value for Syscheck process --> <process_priority>10</process_priority> <!-- Maximum output throughput --> <max_eps>100</max_eps> <!-- Database synchronization settings --> <synchronization> <enabled>yes</enabled> <interval>5m</interval> <response_timeout>30</response_timeout> <queue_size>16384</queue_size> <max_eps>10</max_eps> </synchronization> </syscheck> <!-- Log analysis --> <localfile> <log_format>syslog</log_format> <location>/var/ossec/logs/active-responses.log</location> </localfile> <localfile> <log_format>syslog</log_format> <location>/var/log/messages</location> </localfile> <localfile> <log_format>syslog</log_format> <location>/var/log/auth.log</location> </localfile> <localfile> <log_format>syslog</log_format> <location>/var/log/syslog</location> </localfile> <localfile> <log_format>command</log_format> <command>df -P</command> <frequency>360</frequency> </localfile> <localfile> <log_format>full_command</log_format> <command>netstat -tan |grep LISTEN |grep -v 127.0.0.1 | sort</command> <frequency>360</frequency> </localfile> <localfile> <log_format>full_command</log_format> <command>last -n 5</command> <frequency>360</frequency> </localfile> <wodle name="osquery"> <disabled>yes</disabled> <run_daemon>yes</run_daemon> <log_path>/var/log/osquery/osqueryd.results.log</log_path> <config_path>/etc/osquery/osquery.conf</config_path> <add_labels>yes</add_labels> </wodle> <wodle name="syscollector"> <disabled>no</disabled> <interval>24h</interval> <scan_on_start>yes</scan_on_start> <packages>yes</packages> <os>yes</os> <hotfixes>yes</hotfixes> <ports all="no">yes</ports> <processes>yes</processes> </wodle> ``` ### (Optional) Advanced Rules Advanced rules are supplied by SOCFortress in a public repo on Github. You can copy these rules manually, or a script is also supplied to automatically download the rules, although you run the risk of having duplicate rule ID's if you already have your own custom rules. If you're interested, you can find the rules [here](https://github.com/socfortress/Wazuh-Rules) ## Deploying an Agent This part is gonna be great. We're going to use Wazuh's embedded agent creation to set it up for us. In **Wazuh**, under **Agent Managemet** and **Summary**, you'll have a bird's eye view of how your systems are doing. We can touch **Deploy New Agent** on the right side, choose the OS type, input the address of our Wazuh server, and use the **Windows** group that we've already created. Then we'll copy the generated commands to be able to download and install the agent. On my Windows client, I'm going to open up Powershell in ISE as an administrator, paste the commands and run the script. Then I'll run the command to start the service. Bam! My SIEM is watching my Windows client. But we're not done yet! Windows Event Manager don't see as much as we would like. What we want is Sysmon, which is Event Manager but on steroids. I wrote a quick guide on how to install Sysmon, using a specialized repo for even better event management [[Installing Sysmon on Windows|here]]. Now Wazuh can do a lot, but if we *really* want the next level (and we do, for sure), we're going to want to install Sysmon as well. I'm not going to outline how to install Sysmon on my machine in this post, but you can check out how to do so [[Installing Sysmon on Windows|here.]] ![[wazuh_agent.png]] ## ## Finishing Up At this point, we have: ✅ Graylog Input ready to receive logs ✅ Fluent-bit tailing Wazuh alerts and shipping them over ✅ Wazuh-indexer opened up so Graylog can save those logs ✅ Wazuh-Manager tuned for better security and vulnerability scanning ✅ Agents organized into useful groups with hardened configs And more importantly, we've set the foundation for a _real_, production-quality SIEM. You didn't just connect pieces together. You made sure they talk **securely** (with password auth), you **tuned** your detection coverage to actually spot important behaviors (not just "someone logged in"), and you **enabled proactive protection** with vulnerability scanning. Going forward, you’ll be able to build on this — adding detection rules, dashboards, alerts, even response automation if you want to get fancy. Next time, we’ll look at building out some **Dashboards** in Graylog and starting **Alerting**. That’s where the fun (and the real value) begins. --- ## References >Wazuh Agent Management Documentation: https://documentation.wazuh.com/current/user-manual/agent/agent-management/index.html >socfortress, *Wazuh-Rules*: https://github.com/socfortress/Wazuh-Rules >Taylor Walton, *# Part 3. Wazuh Manager Install — Log Analysis*: https://socfortress.medium.com/part-3-wazuh-manager-install-log-analysis-e819f28b0f9e