-
Notifications
You must be signed in to change notification settings - Fork 1k
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
localfile command frequency is ignored when logcollector restarts #1415
Comments
This problem only exists on startup? If Frequency isn't something that's recorded at shutdown. I don't think it would be difficult to track this state between shutdown and startup, but it wasn't really on my roadmap. |
Yes. |
@ddpbsd thanks for the confirmation. Knowing it works this way is helpful: I thought maybe I missed something ;-) |
The app server is rebooted every 24h and will send a notification at boot time. The ossec server is also rebooted and will immediately send the email to the journalist, regardless of when the previous mail was sent (mail frequency is not a feature of ossec-maild). Always running the localfile command at boot time is an undocumented OSSEC behavior ossec/ossec-hids#1415 in 2.8.2 as well as 2.9.3. This guarantees exactly one mail will be sent daily. Setting the 25 hours frequency element is a safeguard: * against the following race a) command runs because the 24h period expires, b) the server reboots shortly after because it reboots every 24h, c) command runs again after the server is rebooted, causing two notifications to be sent in a row * in case the server does not reboot for some reason, the notification will still be sent every 25h Fixes: freedomofpress/securedrop#3367 (cherry picked from commit 16716d5)
The app server is rebooted every 24h and will send a notification at boot time. The ossec server is also rebooted and will immediately send the email to the journalist, regardless of when the previous mail was sent (mail frequency is not a feature of ossec-maild). Always running the localfile command at boot time is an undocumented OSSEC behavior ossec/ossec-hids#1415 in 2.8.2 as well as 2.9.3. This guarantees exactly one mail will be sent daily. Setting the 25 hours frequency element is a safeguard: * against the following race a) command runs because the 24h period expires, b) the server reboots shortly after because it reboots every 24h, c) command runs again after the server is rebooted, causing two notifications to be sent in a row * in case the server does not reboot for some reason, the notification will still be sent every 25h Fixes: freedomofpress/securedrop#3367 (cherry picked from commit 16716d5)
When restarted, logcollector will run the command below unconditionally, effectively ignoring the frequency element:
When logcollector starts, the
logff[i]->size
field is set to zeroand the daemon loop checks this field to compare it with the current time
The text was updated successfully, but these errors were encountered: