Hi
Romano
After testing the log, I found that the SSH key fingerprint was not being decoded. To fix this, we first need to update the decoder to extract the key properly. Start by copying the default decoder file into the custom decoder directory using:
Next, edit the Wazuh configuration file (/var/ossec/etc/ossec.conf) to exclude the default decoder so the custom one takes precedence. Add the following inside the <ruleset> block:
<ruleset>Now open the copied decoder file:
vi /var/ossec/etc/decoders/0310-ssh_decoders.xmlReplace the existing sshd-success decoder block with the following:
<decoder name="sshd-success">Once decoding is handled, create a CDB list file:
touch /var/ossec/etc/lists/linux-serversSet the appropriate permissions:
chown wazuh:wazuh /var/ossec/etc/lists/linux-serversThen register the list in the Wazuh configuration file under the <ruleset> block:
<ruleset>
<list>etc/lists/linux-servers</list>
</ruleset>
Add entries to the list file in this format:
"TOuSrXFPThfBz8ntfNTFWUEbX/T3fX2kX/RmXz/CEy4":Each key fingerprint should be on a separate line. You can modify the list as per your requirement
Refer to https://documentation.wazuh.com/current/user-manual/ruleset/cdb-list.html
Now add the following rule block to /var/ossec/etc/rules/local_rules.xml:
<group name="sshd">Rule 100003 will trigger if the key from the log matches an entry in the CDB list. Rule 100004 will trigger if there's no match.
refer https://documentation.wazuh.com/current/user-manual/ruleset/ruleset-xml-syntax/rules.html


Let me rephrase this differently to clarify the use case.
When an administrator connects via SSH to a server using their unique key, the host logs show an entry like this:
Jul 31 10:16:38 wazuh-siem sshd[139481]: Accepted publickey for admin from 10.20.30.50 port 40304 ssh2: ED25519 SHA256:QAy+QC8qA+FiugXuCv4x+DEoR9g3PQpdxWyABk6VGU
rule.description: sshd: authentication success"
However, this log entry doesn’t reveal which specific administrator logged in. Currently, we manually copy the key fingerprint and search for it in a shared database that lists all administrator keys to identify the owner. The database follows this format:
QAy+QC8qA+FiugXuCv4x+DEoR9g3PQpdxWyABk6VGU:t.ashford
TOuSrXFPThfBz8ntfNTFWUEbX/T3fX2kX/RmXz/CEy4:b.crowley
(There are over 100 such entries.)
Desired Solution in Wazuh:
When an administrator logs into the server, Wazuh should:
Match the SSH key fingerprint from the log against the CDB database.
Display the administrator’s name (the value field from CDB) in the alert.
Example Alert Output:
rule.description: "sshd: authentication success – key owner: t.ashford"
If another admin logs in, it should show their name (e.g., "key owner: b.crowley").
If an administrator connects and their key fingerprint is not found in the CDB list, the system should:
Trigger a higher severity alert (e.g., level 12)
Generate a warning message: "Unauthorized SSH key detected: Fingerprint SHA256 not found in approved keys database"