Definition
The CDB (constant database) feature allows Wazuh to look up key values extracted from rule-matching log entries, to use as criteria in rules
CDB rule:
<rule id="100334" level="10">
<!-- child rule of rule 100330 which matches the DNS query log from your
corporate DNS server -->
<if_sid>100330</if_sid>
<list field="domain" lookup="match_key">lists/baddomains</list>
<description>DNS query for malicious domain!</description>
</rule>
Lab Exercise 5A: Basic CDB IP Lookups
| Lab Objective: | Escalate the severity level of ssh login failures when the client’s IP is in a known-attackers CDB IP list. |
|---|
We are not limited to only checking fields for their presence or absence in a given list. CDB Lists can contain both a key (the part to look up) and a value (the part to return). The looked up values can then be used as criteria in rules.
Lab Exercise 5B: Advanced CDB IP Lookups
| Lab Objective: | Use a CDB list containing attacker IPs and attacker severity level values for more granular ssh failure alert escalation. |
|---|
Definition
AR is an automated remediation to security violations and threats
Configured primarily on manager in:
- /var/ossec/etc/ossec.conf
On agents, AR can be enabled/disabled in:
- /var/ossec/etc/ossec.conf
AR has its own log (on manager and agents):
- /var/ossec/logs/active-responses.log
A number of useful AR scripts are included in Wazuh.
Handle with care!
<rules_id>.<level>.<rules_group>.An active response has several parts:
- The criteria that triggers the response.
- The command that we want to execute as the response.
- The location(s) where to execute the command.
- The length of time until the action is optionally undone (like unblocking an attacking IP)
AR is more than just for reacting to attacks or abuse. Use it wherever you want to take a custom action in response to events that trigger specific Wazuh rules.
Commands Configuration Example:
<command>
<name>firewall-drop</name>
<executable>firewall-drop</executable>
<timeout_allowed>yes</timeout_allowed>
</command>
Response Configuration example:
<active-response>
<command>firewall-drop</command>
<location>local</location>
<rules_id>5712</rules_id>
<timeout>600</timeout>
</active-response>
Lab Exercise 5C: Linux active response
| Lab Objective: | Set up Wazuh to have your Linux agents block ssh brute force attackers, and then test the setup. |
|---|
<integration>
<name> </name>
<hook_url> </hook_url> <!-- Required for Slack -->
<api_key> </api_key> <!-- Required for PagerDuty and VirusTotal -->
<!-- Optional filters -->
<rule_id> </rule_id>
<level> </level>
<group> </group>
<event_location> </event_location>
</integration>
tcpdump
- For troubleshooting network connectivity
lsof
- For troubleshooting when files are actually accessed
strace
- Advanced analysis of inter-process messages
ss (formerly netstat)
- For determining which ports are open and established connections
Wazuh built the SCA scanner as a major refactor of the legacy OSSEC rootcheck policy scanning module, vastly improving it.
The SCA scanning engine can look for patterns in:
- registry keys, values, and data
- text files
- directories
- the list of running processes
- output of custom commands
- compound, regex, & numeric value comparisons supported
Lab Exercise 6A: Osquery integration with Wazuh
| Lab Objective: | Configure Osquery on both linux and windows and manage it through Wazuh centralized configuration. |
|---|
Lab Exercise 6B: Sysmon integration with Wazuh
| Lab Objective: | Configure Sysmon on your Windows machine to gain further security awareness over this endpoint. |
|---|
Lab Exercise 6C: Monitoring docker activity
| Lab Objective: | Install a docker server on the indexer instance and monitor its activity with Wazuh |
|---|
- Wazuh is capable of monitoring the accounts of cloud based services such as AWS, GCP, Azure, Office 365 and GitHub.
- Privilege separation is highly encouraged, so a dedicated account with only the powers needed to collect the logs should be created.
- Wazuh periodically collect the logs and analyze them.
- Monitoring cloud based assets and security alerts is crucial.