Skip to content
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

[0.7.0] Journalist notification sends email every time the app server is manually restarted #3367

Closed
emkll opened this issue May 4, 2018 · 2 comments

Comments

@emkll
Copy link
Contributor

emkll commented May 4, 2018

Bug

Description

Every time a SecureDrop instance running 0.7.0~rc2 is rebooted, a journalist notification indicating that there's a new submission is sent, despite there not being any new submissions. Note that this particular instance was upgraded from 0.6.

Steps to Reproduce

  • Install 0.7.0~rc2 and enable journalist notifications
  • Press the power button on the instance to initiate shutdown of the app server
  • Press the power button again to start the app server
  • Observe an email in the journalist inbox stating that There has been submission activity in the past 24 hours.

Expected Behavior

The email should only be sent at a regular interval to minimize information leakage and the information sent to journalists should be accurate.

Actual Behavior

The email is sent at every instance reboot and the information sent to the journalist is not accurate.

@redshiftzero
Copy link
Contributor

Really good catch @emkll. Defect #3368 is my reproducing this issue along with another issue: alerts continuing to be grouped. Investigating...

@redshiftzero
Copy link
Contributor

redshiftzero commented May 4, 2018

Ah, indeed, I've been rebooting a bunch of times, and sometimes I get the journalist notification alert separate from the regular netstat alert that appears on boot (for admins), reproducing this bug. Sometimes I get the two alerts grouped, which produces the submissions error in #3368. The intermittent nature of this is why the resolution of alert grouping described here appeared to be sufficient during review.

@ghost ghost self-assigned this May 4, 2018
eloquence pushed a commit to freedomofpress/securedrop-docs that referenced this issue Sep 9, 2020
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)
eloquence pushed a commit to freedomofpress/securedrop-docs that referenced this issue Sep 11, 2020
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants