-
Notifications
You must be signed in to change notification settings - Fork 696
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
fix(ossec): run "disconnected submissions" checks from systemd timers; report on saved output #7009
Conversation
45499e0
to
be542a0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor nitpick, otherwise code LGTM. Running through the test plan now...
...drop/debian/app-code/lib/systemd/system/securedrop-check-disconnected-db-submissions.service
Outdated
Show resolved
Hide resolved
...drop/debian/app-code/lib/systemd/system/securedrop-check-disconnected-fs-submissions.service
Outdated
Show resolved
Hide resolved
Step 8 of the test plan worked properly, but I'm running into issues on step 10. On my app server:
but on my mon server no rules match:
|
OK but I just checked my email and a little over an hour after I posted that comment I got the following OSSEC alert in my inbox:
|
…; report on saved output This should prevent OSSEC from having to sudo to run these commands directly, which adds noise to "/var/log/auth.log" and thus OSSEC's own daily "Successful Logins" report.
"manage.py check-disconnected-fs-{db,fs}-submissions" has output whether or not there are disconnected submissions, so OSSEC matches on the actual output, not just the presence of it. Here we test both cases for both checks, since they have different output.
31d9762
to
154b0bc
Compare
Oops; that's my omission in the test plan, @legoktm. The
Apply something like... --- a/securedrop/debian/ossec-agent/var/ossec/etc/ossec.conf
+++ b/securedrop/debian/ossec-agent/var/ossec/etc/ossec.conf
@@ -131,13 +131,13 @@
<localfile>
<log_format>command</log_format>
<command>cat /var/lib/securedrop/disconnected_db_submissions.txt</command>
- <frequency>90000</frequency>
+ <frequency>60</frequency>
</localfile>
<localfile>
<log_format>command</log_format>
<command>cat /var/lib/securedrop/disconnected_fs_submissions.txt</command>
- <frequency>90000</frequency>
+ <frequency>60</frequency>
</localfile>
<localfile> ...and do... root@app:/home/sdadmin# /var/ossec/bin/ossec-control reload ...and then you should be able to |
Perfect! And it definitely worked because I started getting 2 OSSEC alerts every minute :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great, test plan checked out too. Will merge once staging build passes!
Status
Ready for review
Description of Changes
Fixes #6982 by preventing OSSEC from having to
sudo
to runmanage.py check-disconnected-{db,fs}-submissions
directly, which adds noise to/var/log/auth.log
and thus OSSEC's own daily "Successful Logins" report. Instead, likemanage.py were-there-submissions-today
, these commands now:/var/lib/securedrop/
;Testing
make build-debs
on this branch.securedrop-app-code
securedrop-ossec-agent
securedrop-ossec-server
sudo -s
session. (If you accidentally exit it between here and step the end of step 10, you'll have to factor this into your count ofauthentication_success
entries. Or you can start over from here.)sudo -s
session (If you accidentally exit it between here and step the end of step 10, you'll have to factor this into your count ofauthentication_success
entries. Or you can start over from here.)cat /var/ossec/logs/alerts/alerts.log | /var/ossec/bin/ossec-reportd -f group authentication_success
authentication_success
entries.systemctl start securedrop-check-disconnected-db-submissions.service
cat /var/ossec/logs/alerts/alerts.log | /var/ossec/bin/ossec-reportd -f rule 400800
Report completed and zero alerts post-filter.
systemctl start securedrop-check-disconnected-fs-submissions.service
cat /var/ossec/logs/alerts/alerts.log | /var/ossec/bin/ossec-reportd -f rule 400801
Report completed and zero alerts post-filter.
cat /var/ossec/logs/alerts/alerts.log | /var/ossec/bin/ossec-reportd -f group authentication_success
authentication_success
entries as in step 8.1.sqlite3
, leaving it on the filesystem) and another from the filesystem (viarm
, leaving it in the database).cat /var/ossec/logs/alerts/alerts.log | /var/ossec/bin/ossec-reportd -f group authentication_success
authentication_success
entries.systemctl start securedrop-check-disconnected-db-submissions.service
cat /var/ossec/logs/alerts/alerts.log | /var/ossec/bin/ossec-reportd -f rule 400800
400800
.systemctl start securedrop-check-disconnected-fs-submissions.service
cat /var/ossec/logs/alerts/alerts.log | /var/ossec/bin/ossec-reportd -f rule 400801
400801
.cat /var/ossec/logs/alerts/alerts.log | /var/ossec/bin/ossec-reportd -f group authentication_success
authentication_success
entries as in step 10.1.400800
and400801
.Daily report: Successful logins
report.Deployment
After #6780, upgrades should get the new systemd units automatically when
secuerdrop-app-codes
is upgraded. We should check that the newossec-agent
ossec.conf
andossec-server
local_rules.xml
are also applied on upgrade.Checklist
If you made changes to the system configuration:
If you made non-trivial code changes:
Choose one of the following: