-
Notifications
You must be signed in to change notification settings - Fork 690
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
Disable do-release-upgrade OSSEC notification #3546
Conversation
At least one instance accidentally upgraded to Xenial due to the now weekly alerts being sent to administrators. This addition to postinst of the securedrop OSSEC packages will suppress that notification.
Apologies for the novella in the testing plan here, but it's a little annoying to test this so I erred on the side of more detailed. Let me know if anything is confusing |
Codecov Report
@@ Coverage Diff @@
## develop #3546 +/- ##
========================================
Coverage 85.12% 85.12%
========================================
Files 37 37
Lines 2367 2367
Branches 260 260
========================================
Hits 2015 2015
Misses 289 289
Partials 63 63 Continue to review full report at Codecov.
|
❤️ the detailed test plan .. stepping thru now |
@@ -18,6 +18,8 @@ set -e | |||
|
|||
case "$1" in | |||
configure) | |||
# Disable do-release-upgrade notification | |||
sed -i 's/Prompt=.*/Prompt=never/' /etc/update-manager/release-upgrades |
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.
Just a quick observation.. i think it would make more sense to drop this in securedrop-config
since that package already goes on both servers. thoughts @redshiftzero ?
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.
Ahhh, yep - that is probably better
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.
👍 k i can make that change locally and test against it and commit when all is well
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.
👍
@redshiftzero did some great work at debugging and preventing ubuntu from emailing out update alerts. This is a tiny tweak to that logic to stuff it in the securedrop-config package which already executes on both servers.
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 was a pain in the butt to test... thanks for the detailed guidance @redshiftzero . I did tweak my testing to utilize the upgrade testing scenario.. i really want to get that on virtualbox for ya. I think it'll help out your local debugging a ton
on a side note.. you dont have to wait for cron to fire... if you execute the same cron command as root with the same arguments.. just verify no output is shown.. like this: $ cd /
$ SHELL=/bin/sh PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin run-parts --report /etc/cron.weekly |
Thanks for the review! and definitely, looking forward to getting that upgrade testing on VirtualBox 😍 |
Just to be clear.. i super appreciated the full testing plan :) |
mergin' and backportin'... |
[0.8.0] Backports #3546 disabling the do-release-upgrade notification
Status
Ready for review
Description of Changes
Fixes #3205
Changes proposed in this pull request:
postinst
scripts of the securedrop OSSEC packages will suppress that notification.Testing
These instructions assume that you are testing this in staging VMs.
Setup
Make sure you're getting OSSEC emails
First, since the alert does not appear in vagrant VMs, and it actually only appears once per week, we should address both of those things as setup.
Now make sure you have prod like creds and modify your
staging.yml
group vars to enable postfix (i.e. apply this diff):Now ensure OSSEC alerts are flowing.
Make the
do-release-upgrade
alert happen, and frequentlyOn each machine, SSH in and in
/etc/update-manager/release-upgrades
replacePrompt=never
withPrompt=lts
(this is what is set on hardware).Also delete the flag file at
/var/lib/ubuntu-release-upgrader/release-upgrade-available
if it exists.Finally for easy testing, in
/etc/crontab
run the weekly job every 5 mins:At this point you should be getting the alert about
do-release-upgrade
to your OSSEC email address every 5 minutes. Wait and verify this is the case.Note: I only ever get the alert from mon on both hardware and prod VMs. However I think it is best to apply this change to both hosts to ensure this alert doesn't pop up in the future for anyone.
Test the fix
/etc/update-manager/release-upgrades
now hasPrompt=never
At this point, the alert will continue to fire, because the weekly job is running
/usr/lib/ubuntu-release-upgrader/release-upgrade-motd
, and the logic there is to only update the "do we need to do an upgrade" status every 24 hours. This is tracked via the flag file that we deleted earlier, so you need to do one of the following:/usr/lib/ubuntu-release-upgrader/release-upgrade-motd
to expire the flag file more rapidly OR/var/lib/ubuntu-release-upgrader/release-upgrade-available
so the check (the actual checking for a new release is done in/usr/lib/ubuntu-release-upgrader/check-new-release
) is performed again (this is what I did)Once one of these three things is done:
Deployment
Will be automatically deployed when SD OSSEC packages update
Checklist
If you made changes to the system configuration:
If you made non-trivial code changes: