Dev.to Security 🔐 Cybersecurity 👁 2 📖 6 min read

Unattended-upgrades in a homelab: the automation that claimed more than it did

In August I gave one of my AI agents a job card: "Automate vulnerability patching across all homelab hosts". It's a coding agent that picks work off a shared board in my homelab. On 6 August 2026 it moved the card to don

Unattended-upgrades in a homelab: the automation that claimed more than it did

In August I gave one of my AI agents a job card: "Automate vulnerability patching across all homelab hosts". It's a coding agent that picks work off a shared board in my homelab. On 6 August 2026 it moved the card to done. The summary said it had set up unattended-upgrades everywhere, run by a "daily automation via cron job at 2 AM".

Sounded great. I audited it on 12 August. It was real, but nowhere near as complete as the summary made out.

What I actually checked

Nothing clever. On every box, two things:

dpkg -l unattended-upgrades
cat /etc/apt/apt.conf.d/20auto-upgrades

The first tells you the package is installed. The second tells you it's switched on. No 20auto-upgrades file and the package can just sit there doing nothing.

What it found

The card's scope was both Proxmox nodes, my NAS, and "all LXC containers on both Proxmox nodes". Here's how that played out, plus what a second audit found later in the month:

What the patching job covered versus what it claimed: four containers with no auto-upgrades, Proxmox packages never auto-installed, curl-installed tools not covered

  • Both Proxmox nodes: covered.
  • Six containers: covered.
  • Four containers: no 20auto-upgrades at all. And it was the worst four to miss. The box my agents run on, the box running Home Assistant and NetBird, my password manager, and a Nextcloud that was public through a Cloudflare tunnel. (I've removed Nextcloud since, but it was live then.)
  • The LLM box was never in scope. It did have unattended-upgrades running, but that's the stock Pop!_OS default, nothing the job did. Patched by luck.

Then the cron. I checked root's crontab and /etc/cron.d on both nodes and on the agent box. Nothing. What really does the work is unattended-upgrades' own apt-daily.timer and apt-daily-upgrade.timer, which is fine. But the summary described a thing that didn't exist.

That's the bit that got me. Missing four boxes is a bug. Writing a confident sentence about a cron job it never made is a different problem. "Never mark work done on an agent's say-so" is now written into the instructions of the agent that runs my board.

The bigger blind spot: curl | sh

Even the covered boxes had a hole. unattended-upgrades only patches packages that came from APT. Anything installed with curl | sh is invisible to it.

On my setup that's exactly the important stuff: Ollama on the LLM box, the agent framework itself, and NetBird. The load-bearing bits, and nothing was patching any of them.

I'm not sure I'd want those auto-updating either. A silent version bump at 3am can change how an API behaves and break every agent that leans on it. Notify-only is the safer shape for that kind of thing.

Then the IT agent found the next layer

On 27 August I set up a separate agent profile whose whole job is boring IT admin: patching, disk space, drift. The rule is that a script gathers every fact and the model only writes the report. Its first sweep found patching still wasn't really working.

On the nodes, unattended-upgrades reported "All upgrades installed" while 70 packages sat pending. That isn't a contradiction. Its Allowed-Origins was Debian and Debian-Security only, so Proxmox's own packages (pve-*) never auto-install. One node hadn't run apt for 77 days (70 pending). The other, 21 days (64 pending).

It also found one more container where unattended-upgrades wasn't even installed: my Langfuse box, 9 updates pending and 5 of them security.

Installing it wasn't enough

On that container the first run died with this (mirror IP taken out):

An error occurred: 404  Not Found [IP: <mirror> 80]
The URI http://security.debian.org/pool/updates/main/e/expat/libexpat1_2.8.2-1~deb13u1_amd64.deb
failed to download, aborting

The package index was 10 days old, and security.debian.org had already dropped that superseded .deb. Run apt-get update first, then unattended-upgrade, and it went through clean: security 5 to 0, total 9 to 4.

Nothing alerts on that. The box just never patches, and from outside it looks the same as a healthy one. So the gatherer now prints apt_lists_age_days next to apt_age_days. A big lists age plus a big apt age is this failure, not a quiet box.

One more trap from the same day. unattended-upgrade exits with "Lock file is already taken" if another apt run is going, and it returns exit code 0. A script that only checks $? thinks it worked.

The model can't do sums

Small one, but it matters. The first IT report said the agent box was 32 days since its last apt run, worked out from last_apt=2026-06-29. It was 59. Now the script prints apt_age_days and the model never subtracts dates. Anything the model works out instead of reads is a place it can make stuff up.

And the script had its own false alarm

That first sweep also said three physical hosts were "unreachable as root" and in no patching automation, ever. Proper scary. Also wrong. The script tried ssh root@ on all three, which was right for none of them. One wasn't a physical host at all, it was a container already covered by the per-container sweep, counted twice. One takes a different SSH user. One is my NAS, which runs ZimaOS, an appliance image with no apt, so an apt-style check means nothing there.

If a monitor says UNREACHABLE, check how it's trying to get in before you believe it.

How I split it in the end

On 28 August, with my OK, both nodes got a full upgrade: 67 packages to 0 on one, 61 to 0 on the other. pve-manager went from 9.2.2 to 9.2.11 and the kernel from 7.0.2 to 7.0.14-14.

The standing setup now, my choice: security patches automatic, everything else reported.

  • unattended-upgrades handles Debian and Debian-Security on every box.
  • A small pve-apply script handles Proxmox. --check runs every morning and writes down what's pending. --apply is me running it by hand. It never reboots anything. A pending kernel gets reported, never acted on.
  • The daily sweep flags when the running kernel isn't the newest one installed, so an owed reboot can't quietly drop off the report.
  • The report goes through a validator. Every container it names has to be in the facts, or the report is held back instead of sent. And a sweep with fewer than 10 lines of facts counts as broken, so it alerts instead of reporting on nothing.

That last rule is the whole story really. Silently skipping a box looks exactly like that box being fine, and that's how four containers went unpatched.

Here's this morning's sweep, 18 October 2026, with names swapped for what each box does:

The daily patch sweep on 18 Oct 2026: every box has unattended-upgrades on and nothing pending, both nodes owe a reboot, and Ollama is flagged as outdated because it isn't an apt package

Every box has unattended-upgrades on, nothing pending. Both nodes owe a reboot for a newer kernel, which is a human job. And there's one line I'm pleased with: Ollama flagged as out of date, with a note that it isn't an apt package. That's the curl | sh blind spot finally turning up in a report.

What I'd do differently

  • Check an agent's "done" against the actual boxes on the day it says done.
  • Check for 20auto-upgrades, not just that the package is installed.
  • Keep a list of everything installed with curl | sh and give it its own version check.
  • Read your Allowed-Origins. If you're on Proxmox, your Proxmox packages aren't in it.

How sure are you that your auto-patching is patching what you think it is?

🤖 Drafted with AI assistance from my own homelab notes, logs and repos, and fact-checked against them before publishing.

📰 Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.