-
-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mechanism for tracing direct machine logins #3212
Comments
The following is an example of a successful login via ssh in Wazuh.. ` @timestamp | 2023-10-31T10:43:45.143Z ` |
Below is how I've configured a custom decoder for extracting additional information from the auth.log in Wazuh. This example works for a log file that is already ingested by Wazuh. If reading in a new log file, additional steps will be needed...
|
I have this configured and working for ssh logins in Wazuh, not using the custom rule above, as that doesn't work in practice, though it does in test :), there is a difference between adding a new custom decoder ( as shown in the example above ) and extending an existing decoder and alert.. the process is subtly different... here's how I got this to work... the process below should ensure that the custom rules do not get overwritten by future updates... This example shows the extension to the existing sshd-success decoder
<decoder_exclude>ruleset/decoders/0310-ssh_decoders.xml</decoder_exclude>
Replace this:
With this:
Which should highlight any issues with file syntax, permissions etc
And then paste in a full log line to be checked, e.g..
Which should return the expected output.. and you can see the new keysum field being captured by Wazuh
|
For Linux/UNIX-based systems we use ssh keys to control log-ins to the server. Currently we do not log the keys used to log into the system which is beneficial from an audit perspective.
A SHA256 fingerprint of the keys used for successful connections are typically written to the SSH log file (e.g.
/var/log/auth.log
).ssh-keygen -l -f [keys_file]
can be used to show the fingerprints of each key in the authorized_keys file. We can therefore tell which keys were used to log into the machines and potentially store them in a central location for analysis to identify unexpected access patterns. Wazuh could be likely be ideal for tracking this #3162.The text was updated successfully, but these errors were encountered: