How to add Freeradius logs in Wazuh SIEM

TL;DR A quick and dirty tutorial how to configure Wazuh SIEM to collect Freeradius event logs

Wazuh is a poweful open source SIEM solution. To be honest, is something more than a SIEM: integrating with its OSSEC agents, it became a flexible XDR solution to protect your digital assets in real-time.

One of the most challenging steps in configuring a SIEM is setting up the log decoders and rules. While pre-built decoders are available for most common log formats, there may be times when you need to add a new decoder to allow Wazuh to correctly parse messages.

As you may have noticed, Freeradius logs are not yet included by default in Wazuh’s decoder collection. Therefore, before you can collect and correlate events from the Freeradius RADIUS server, you will need to create a new decoder.

But before doing that, don’t forget to install wazuh-agent in Freeradius server and make the necessary changes to the ‘/var/ossec/etc/ossec.conf’ to monitor ‘radius.log‘:


Then restart wazuh-agent:

systemctl restart wazuh-agent

After completing the previous steps, return to the Wazuh SIEM console and begin adding the Freeradius decoder and rules.

Next, navigate to the ‘/var/ossec/etc/decoders‘ directory, which houses custom decoder definitions. Create a new file called ‘freeradius_decoder.xml‘ (or choose a name of your preference) and include the following content within the file::

FreeRadius Wazuh decoder

based on Asier Gonzalez Diaz work (

reviewed by Michele <> Pinassi
<decoder name="freeradius_auth">
    <prematch>Auth: \((\d+)\)\s+Login OK</prematch>

<decoder name="freeradius_auth_fail">
    <prematch>Auth: \((\d+)\)\s+Login incorrect</prematch>

<decoder name="FREERADIUS_OK">
    <regex>Login OK: [(\S+)] \(from client (\S+) port \d+ cli (\w+-\w+-\w+-\w+-\w+-\w+)</regex>
    <order>username, authenticator, mac-address</order>

<decoder name="FREERADIUS_FAIL">
    <regex>Login incorrect \((\S+): \.*: [(\S+)/\.* \(from client (\S+) port \d+ cli (\w+-\w+-\w+-\w+-\w+-\w+)</regex>
    <order>eap_method, username, authenticator, mac-address</order>

Decoders are build with a PCRE2 regular expression syntax. You can build it using tools like and test with wazuh-regex utility before using in production.

After creating the Freeradius decoder, the next step is to add rules that will enable the correct usage of events.

To do this, move to the ‘/var/ossec/etc/rules/‘ directory. Once inside the directory, create a new file named ‘freeradius_rules.xml‘ and include the following content within the file:

FreeRadius Wazuh rules 

<group name="freeradius_auth_group">
    <rule id="100800" level="0" noalert="1">
        <description>Freeradius messages grouped.</description>
    <rule id="100801" level="0" noalert="1">
        <description>Freeradius fail message grouped.</description>

    <rule id="100811" level="3">
        <match>Login OK</match>
        <description>Freeradius correct login.</description>

    <rule id="100812" level="8">
        <match>Login incorrect</match>
        <description>Freeradius incorrect login.</description>

then restart wazuh-manager:

systemctl restart wazuh-manager

and test it with:


with a line from radius.log. You can test with those two samples:

Auth: (169017) Login OK: [] (from client radiustest port 1 cli FF-11-22-33-44-55)

Auth: (169027) Login incorrect (eap: Failed continuing EAP TTLS (21) session.  EAP sub-module failed): [<via Auth-Type = eap>] (from client radiustest port 1 cli FF-11-22-33-44-55)

note decoded fields (Phase 2): authenticator, mac-address and username. These fields will be populated in securty alert entries and can be utilized for visualization, alerting and other purposes.

So, if all were correct, in Security events page the incoming events from Freeradius should appear (here’s my dashboard):

and for each alert, you’ll have the decoded data:

Hope this article could be useful and feel free to ask, leaving a comment below.

Hai trovato utile questo articolo?

Questo articolo è stato visto 352 volte (Oggi 1 visite)
Lascia un commento

Il tuo indirizzo email non sarà pubblicato. I campi obbligatori sono contrassegnati *

Questo sito usa Akismet per ridurre lo spam. Scopri come i tuoi dati vengono elaborati.