Hello M.Ali,
we are glad you started to use Wazuh.
Let me introduce some details regarding the Rules:
The
Ruleset, included in the
Wazuh Manager installation by default, is a set of XML files called Decoders and Rules. The Decoders are used by the
Analysis Daemon to extract the required fields and values from the incoming events or log messages. Then, the Rules are used to generate an alert based on the fields extracted by the corresponding Decoder. The alerts will follow the
data flow and they will be finally displayed on the Kibana web.
As you properly mentioned, there is a
wazuh-ruleset repository in GitHub where we can find all of the Decoders and Rules that are currently available in the corresponding version of Wazuh.
The /var/ossec/bin/update_ruleset is used to update the current ruleset on your system in case of a possible out-of-date.
Finally, regarding the rules creation process, you requested, please, take a look at
Custom rules and decoders. It is used when we have a specific log message or event with a format that is not ready to be managed by the current Ruleset. In those cases, we firstly create a custom Decoder to extract the fields we need and their values. Then, we create the corresponding custom Rule to generate the alert according to our requirements. It is recommended to use the
/var/ossec/etc/decoders/ and
/var/ossec/etc/rules to place the custom XML files instead of using the /var/ossec/ruleset as this is overwritten when we upgrade the wazuh-manager installation.
The XML files can be created/edited directly from the CLI with any text editor, or you do it on your local system and then upload them to the wazuh-manager server. And also, they can be created/edited from the Kibana Wazuh App:
Every change requires to restart the wazuh-manager service to update the changes.
Also, you can use the
/var/ossec/bin/ossec-logtest to
test the logs you want to parse.
I hope this helps you.
Don't hesitate to ask us for further information.
Best regards,
Jose M.