A deliberately unexciting system update utility.
TheUpd8r is a hardened, root-only APT update runner designed for environments where:
- 🔐 integrity matters,
- 🧼 secrets must not linger,
- 🎊 and surprises are unwelcome.
It runs unattended, verifies its own integrity, decrypts proxy credentials only at runtime, applies system updates, and exits quietly.
No interaction is required. No interaction is offered. This is working as intended.
Most update automation assumes:
- trusted environments,
- stable filesystems,
- cooperative users.
TheUpd8r assumes none of that.
It is designed to run in hostile-by-default conditions and will refuse to operate if:
- 🚫 files are writable when they shouldn’t be,
- 🔍 binaries do not match pinned hashes,
- 🔗 symlinks appear where they shouldn’t,
⚠️ execution conditions deviate from expectations.
-
🔒 Root-only execution
-
🧾 Self-hash verification (pinned via systemd environment)
-
🧷 Pinned binary verification
apt-getand TheUpd8r itself- Explicit, opt-in re-pinning only during maintenance
-
🧠 TOCTOU-safe file handling
O_NOFOLLOW,fstat, FD-based reads
-
📁 Strict directory and permission validation
-
🔐 Encrypted proxy credentials
- Decrypted only in memory, only when needed
-
🧹 No plaintext secrets on disk
-
⚙️ Runtime-only APT proxy configuration
- Root-only (
0600) config under/run, passed viaAPT_CONFIG - Removed after every run; nothing under
/etc/apt - Credentials never appear on the command line (
/proc/<pid>/cmdline)
- Root-only (
-
🧪 Minimal, sanitised execution environment
-
🔁 Concurrency protection
- Prevents overlapping runs
-
⏱️ Systemd-native
- Timer-driven, sandboxed, predictable
-
🧑💻 Ensures it is running as root
-
🔐 Acquires an execution lock
-
🔎 Verifies its own SHA256 hash
-
📖 Loads and validates configuration securely
-
🧷 Verifies pinned binaries
-
🔓 Decrypts proxy credentials in memory
-
📦 Runs:
apt-get update apt-get -y dist-upgrade
using a root-only, run-scoped
APT_CONFIGproxy file -
🧼 Clears sensitive values and removes the proxy file
-
🤫 Exits quietly
The unattended (timer) run cannot apply kernel updates — the boot mount is read-only in that context, and a failed kernel upgrade would leave dpkg in a broken state.
Instead, when a kernel update is pending, the timer run:
-
⏸️ defers the upgrade entirely (nothing is partially applied),
-
📢 leaves a login notice (motd + profile.d):
*** Kernel update required *** Run: sudo theUpd8r
Running sudo theUpd8r from a login shell applies the full
dist-upgrade (kernel included) in the user's context, then clears
the notice on success.
If anything looks wrong at any point, it stops.
.
├── TheUpd8r.py # Runtime updater (executed by systemd)
├── Setup.py # Installer / updater / remover
└── README.md
sudo python3 Setup.pyYou will be prompted once for proxy details. These are:
- 🔐 encrypted using Fernet,
- 💾 stored on disk encrypted,
- 🚫 never written in plaintext.
On completion:
- TheUpd8r is installed to
/usr/local/sbin/TheUpd8r.py - Configuration is stored under
/etc/theupd8r - Secrets are stored under
/var/lib/theupd8r - ⏰ A systemd timer is enabled to run daily at midnight
sudo python3 Setup.py --updateYou may choose to:
- ✅ keep existing encrypted proxy credentials, or
- 🔁 replace them.
Binary hashes and the systemd unit will be updated automatically.
sudo python3 Setup.py --removeThis will:
- ⛔ stop and disable the timer and service,
- 🧹 remove installed files and configuration,
- 📴 leave no background activity behind.
By default, binary hash changes are fatal 💥
If you are intentionally updating system components and need to re-pin hashes:
-
✏️ Edit the systemd service:
Environment=THEUPD8R_ALLOW_REPIN=1
-
▶️ Run TheUpd8r once -
🧽 Remove the flag afterwards
Silent drift is not permitted.
TheUpd8r defends against:
- accidental misconfiguration
- symlink and TOCTOU attacks
- filesystem permission abuse
- unattended secret exposure
- unintended binary replacement
It does not attempt to protect against:
- a fully compromised root environment
- malicious kernel or init systems
At that point, you have larger problems 🔥
- 🐧 Debian-based system
- 🐍 Python 3
- 🔐
python3-cryptography - ⚙️ systemd
TheUpd8r is:
- not clever
- not fast
- not flexible
It is:
- predictable
- verifiable
- difficult to trick
Which is rather the point ☕
Choose whatever fits your organisation. TheUpd8r will not have opinions about it.