Checks / Updates

Security updates are not installed automatically

Check
updates.auto_security
Severity
medium
Runs
on the server, in the daily run of the agent
Looks at
unattended-upgrades, dnf-automatic or an apk cron job is not active
Updated 26 Nov 2026

What the check looks at

The agent looks for an active automatic update setup:

  • Debian and Ubuntu: unattended-upgrades installed, with APT::Periodic::Unattended-Upgrade "1" and the apt-daily-upgrade.timer enabled.
  • RHEL, Rocky Linux, AlmaLinux and Amazon Linux: a dnf-automatic timer enabled, and for dnf-automatic.timer the setting apply_updates = yes.
  • Alpine: a job in /etc/periodic/ or a crontab entry that runs apk upgrade, with crond running.

Why it matters

Many vulnerabilities on a server have a fix that the distribution has already published as a package update. Without automatic updates, the fix waits until someone logs in and runs the upgrade, which on a quiet server can take weeks. Debian, Ubuntu and the RHEL family keep security updates within a stable release small: they apply the fix to the version you have instead of moving to a new upstream release. That makes a daily automatic install the safer default.

How to fix it

Debian and Ubuntu

sudo apt install unattended-upgrades
sudo dpkg-reconfigure -plow unattended-upgrades
apt-config dump APT::Periodic::Unattended-Upgrade

The last command must print APT::Periodic::Unattended-Upgrade "1";. On Debian 12, Debian 13 and Ubuntu 24.04, installing the package already turns it on.

RHEL, Rocky Linux and AlmaLinux

sudo dnf install dnf-automatic
sudo sed -i 's/^upgrade_type.*/upgrade_type = security/; s/^apply_updates.*/apply_updates = yes/' /etc/dnf/automatic.conf
sudo systemctl enable --now dnf-automatic.timer

The shipped automatic.conf downloads updates but does not install them, so apply_updates = yes is the line that matters.

Alpine

cat > /etc/periodic/daily/apk-upgrade <<'EOF'
#!/bin/sh
apk update --quiet && apk upgrade --quiet 2>&1 | logger -t apk-upgrade
EOF
chmod 755 /etc/periodic/daily/apk-upgrade
rc-update add crond default
rc-service crond start

The crontab of root runs /etc/periodic/daily at 02:00.

How to check the fix

systemctl list-timers 'apt-daily*' 'dnf-automatic*'

Then look at the logs after the next run: /var/log/unattended-upgrades/unattended-upgrades.log on Debian and Ubuntu, journalctl -u dnf-automatic.service on the RHEL family, grep apk-upgrade /var/log/messages on Alpine.

When a warning is fine

When updates go out through another tool that runs on a schedule, such as Ansible, Salt or a patch management service, or when servers are replaced by new images built every day. Make sure the schedule runs: the check updates.pending shows whether updates pile up.

Sources