Hi Lucio!
Please correct me if i’m wrong: your app PRUEBA use your DB and you need to audit what’s doing with it by running periodically (five minutes) and querying (db trigger? external app/script?) the SECURITY_LOG view. If this statement is right, could you please tell me where the db query output is going to?
By other hand, there’s a interesting option check_diff that allow to trigger an alert if the content of it was different from the previous one. This is really useful if the whole query is treated as a whole and no line-by-line.
Thank you and I wait for this information to move forward.
Nico
Lucio,
First of all, sorry for the delay in the response.
I thinks that, despite there’s multiple solutions to solve this, one of them is the best in terms of amount of disk space needed and processing time for Wazuh agent, but this option relies on customizing your SECURITY_LOG view in order to query/filter only the results for the last 5 minutes. This way we can append every output to a single log and avoid creating one file every 5 minutes and sending duplicate information to the manager (despite this could be ignored in the manager).
Both trigger mechanism are fine, but IMHO i prefer your proposal 2.2 but appending to the same file i.e \var\log\messages\PRUEBA_SecurityLog.txt. Then a simple localfile as you mention will do the job
<localfile>
<location>\var\log\messages\PRUEBA_SecurityLog.txt</location>
<log_format>syslog</log_format>
</localfile>
I hope this works for you. Please let me know if I can help you with anything else.
Regards,
Nico
Lucio,
Agent’s wazuh-logcollector
process, responsable of fetching logs over all localfile
sections defined in ossec.conf
, move the reading pointer to the end of the log file (for EventChannel depends on only-future-events option) during startup and start reading in realtime from that point.
Remember that is important that the results of the DB query are filtered to get only the new DB entries in the last 5 minues.This way we can avoid duplicates.
As an example, the next scenario will explain how this will work
BTW, there’s a already developed feature (coming in a future version) that will allow to use only-future-events for any location
. This is really helpful in case the agent stops/restarts for some reason.
Please don’t hesitate to contact me if you have further questions.
Regards,
Nico