Skip to content

Install updates from the Vulnerabilities extension: Linux, Windows and whole resources - #173

Merged
mbomb67 merged 8 commits into
mainfrom
vulnerabilities-install-updates-clean
Nov 25, 2026
Merged

mbomb67 merged 8 commits into
mainfrom
vulnerabilities-install-updates-clean

Conversation

@mbomb67

@mbomb67 mbomb67 commented Nov 25, 2026 •

Copy link
Copy Markdown
Owner

What changes

The Vulnerabilities extension (extensions/XUI-wqrj0e3p) can now fix what it finds. A new setting, off by default, adds two actions:

  • Install Updates on a server: installs every update the server's own source offers, restarts it when that is needed and allowed, removes old kernels, rescans, and shows the counts before and after on the Vulnerabilities tab.
  • Install Updates on All Servers on a resource: the same, one server at a time, stopping at the first failure.

Both are ordinary CloudBolt actions that the extension creates, so role permissions, Requires approval, bulk runs and MCP apply. The tab buttons open the actions' own dialogs. Nothing runs while the setting is off, and never on a server in an Unassigned group.

System How updates are installed
RHEL, Oracle Linux 8-10 dnf -y --refresh upgrade
Amazon Linux 2023 the same with --releasever=latest (its repositories are locked to the image's release)
Ubuntu 22.04, 24.04 apt-get update, then a non-interactive dist-upgrade
Windows Server 2022, 2025 the built-in Windows Update Agent, from WSUS when policy sets one, otherwise Windows Update

How it works:

  • Detached in the guest. The install runs as a transient systemd unit (Linux) or a SYSTEM scheduled task (Windows) and the job polls it, so a restarted SSH service or a transport timeout does not end it. The Windows Update Agent refuses download and install from a remote session, which is why the task runs as SYSTEM.
  • Restart from inside the guest, then wait for a new boot identifier. CloudBolt has no wait-for-SSH or wait-for-WinRM helper.
  • Old kernels are removed once the server runs its newest kernel. On Ubuntu this is by package name, because apt protects the previous kernel and its vulnerabilities would stay listed. A setting turns it off.
  • Refused before any change: a Configuration Manager client, a Windows workstation, another Windows version, another Linux distribution.

New settings: Offer Install updates (off), Remove old kernels after a restart (on), minutes to wait for a restarted server (60), minutes allowed for installing (90). vuln_api.py gives plug-ins scan_and_wait, install_updates and install_updates_on_resource.

Testing

967 unit tests pass (python -B -m unittest discover -s extensions/XUI-wqrj0e3p/tests -p "test_*.py"). Each step was reviewed independently before it was tested live.

Live on a development appliance:

Server Run Known vulnerabilities With a fix
Windows Server 2025, over WinRM 3 updates, restarted, 31 min, build 26100.33650 to 33822 631 → 0 631 → 0
Ubuntu 22.04, fresh 218 packages, restarted, 6 old kernel packages removed, 9.5 min 9,509 → 3,242 7,493 → 101
Amazon Linux 2023, two months old 242 packages, restarted, 1 old kernel removed, 5 min 2,637 → 335 2,637 → 335
Amazon Linux 2023, current image no updates were available 28 → 28 28 → 28
Two patched servers, one bulk job no updates were available on both unchanged unchanged
Resource with three RHEL 9 VMs first VM failed in dnf (the lab's repository mix); the other two were not attempted unchanged unchanged

Also seen live: the setting creates both actions and the dialogs show the restart option; the action is not offered on a server in an Unassigned group; Scan all servers is refused while a resource update runs, and so is a second resource run; the tab shows the running step and the result line.

What remains after updating is software the package manager does not own (libraries bundled inside agents and tools). It stays listed with a fix version.

Not verified

  • A resource-wide run that completes across several servers. The only resource with servers in the lab is three unregistered RHEL VMs on CentOS Stream repositories, which fail dnf's transaction test. Its refusals, stop-at-first-failure and result line are verified live; the per-server engine it calls is verified on Ubuntu, Amazon Linux and Windows.
  • Requires approval, and a non-admin role granted the actions.
  • WSUS, a real Configuration Manager client, Windows Server 2022.
  • Oracle Linux upgrades.
  • AWS Systems Manager.
  • Cancelling a job mid-update.

Added after the first review: bulk updates from Vulnerability Search

The Servers view of the admin page now:

  • Filters by group, OS build, owner and environment, plus "With a fix only"; sorts on every column; adds Owner and With a fix columns.
  • Has a checkbox column and an "Install updates on N servers" button with a confirmation panel. The run starts through the Install Updates action itself, so Requires approval, per-server permission and the display condition still apply. One job that works on several servers at a time (new setting "Servers updated at the same time", 1 to 20, default 5; the rest wait their turn), continuing past a failed server. The scan after each update still runs one at a time unless "Vulnerability matches at once" is raised, because each match can use more than a gigabyte of memory. Cancelling the job stops it before the next step on every server. A second setting caps a selection (default 30).
  • Never lists a server that is archived or gone in CloudBolt, and removes its stored results when the page loads. Before, that only happened in the nightly job, whose schedule is off by default.
  • Store schema 4 adds owner and OS build; an existing store upgrades in place.

Tested live for this part:

  • Filters, sorting, selection and the purge of an archived server, in the browser.
  • A four-server run from the page on AWS: two fresh Ubuntu servers (218 packages each, restarted, old kernels removed, 7,493 to 101 with a fix), one RHEL (1 package), one Amazon Linux (nothing to install). One job, 23.5 minutes, SUCCESS.
  • RHEL 9.4 to 9.9 on a pay-as-you-go AWS image: 379 packages, restarted, old kernels removed.
  • Ubuntu 24.04 on Azure through Run Command: 20 packages updated. The scan could not run there because the lab's Azure network cannot reach the appliance.
  • A server that did not come back from its restart: reported as failed after the 60 minute wait.
  • Several servers at a time, with the default of five: six servers from the page, five started together and the sixth when the first finished; four Ubuntu servers updated 218 packages each and restarted at the same time; the six scans ran one after the other. One job, 23.5 minutes, SUCCESS.
  • A two-server run cancelled while packages were installing: the job ended seven seconds later, with no restart, kernel removal or scan started after the cancel. The same two servers then ran again to a clean finish.

Not tested for this part: more than one page of servers and "Select all N matching" (the lab has 12 scanned servers), Requires approval on a bulk run, more than one scan after an update at the same time, a run that reaches the job's time limit, a VMware server (the lab appliance cannot reach the ESXi hosts for guest scripts), and a successful update on OpenShift Virtualization (the lab's only image there is unregistered RHEL on CentOS Stream repositories).

After merge

Sync extensions/XUI-wqrj0e3p from main and recycle the web workers. The actions do not exist until an administrator turns on Offer Install updates in Vulnerability Settings.

🤖 Generated with Claude Code

…d whole resources

A new setting, off by default, adds two CloudBolt actions that the
extension creates, so role permissions, Requires approval, bulk runs and
MCP apply:

- Install Updates on a server: installs every update the server's own
  source offers, restarts it when that is needed and allowed, removes
  old kernels, rescans, and shows the counts before and after on the
  Vulnerabilities tab.
- Install Updates on All Servers on a resource: the same, one server at
  a time, stopping at the first failure.

RHEL and Oracle Linux 8-10 and Amazon Linux 2023 use dnf, Ubuntu 22.04
and 24.04 use apt-get dist-upgrade, Windows Server 2022 and 2025 use the
built-in Windows Update Agent from the configured source.

- The install runs detached in the guest (a transient systemd unit, or
  a SYSTEM scheduled task because the Windows Update Agent refuses
  download and install from a remote session) and the job polls it.
- The restart is issued from inside the guest; the job waits for a new
  boot identifier.
- Old kernels are removed once the server runs its newest kernel; on
  Ubuntu by package name, because apt protects the previous kernel and
  its vulnerabilities would stay listed. A setting turns this off.
- On Ubuntu the worker excludes its own unit from needrestart for the
  run; otherwise needrestart restarts it after libc6 is upgraded.
- Refused before any change: a Configuration Manager client, a Windows
  workstation, another Windows version, another Linux distribution, a
  server in an Unassigned group, and everything while the setting is
  off.
- vuln_api.py gives plug-ins scan_and_wait, install_updates and
  install_updates_on_resource.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
mbomb67 and others added 2 commits November 25, 2026 09:41
…eason; record the RHEL test

A Red Hat cloud image that is not registered prints the subscription-manager
plug-in's lines before every dnf answer, and they were taken as the reason a
restart is needed. The README now states what dnf remove --oldinstallonly keeps
and lists what Install updates was tested on.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…s in bulk, drop archived servers

The Servers view gets filters for group, OS build, owner and environment, a
With a fix column and filter, sortable headers, and a checkbox column that
starts Install updates on the selected servers through the action itself, so
approval, permissions and the display condition still apply. Servers that are
archived or gone in CloudBolt are removed from the findings store when the page
loads and are never listed. Store schema 4 adds owner and OS build.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
mbomb67 and others added 2 commits November 25, 2026 10:48
…st's script filter

Both were flagged by code scanning. The page header already carries the
Vulnerability settings button, so the bulk bar no longer builds a second link
from a page attribute.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… shown as queued

Also says "1 of 1 server" in the pager line.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
mbomb67 and others added 3 commits November 25, 2026 13:20
…sts covered

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A new setting, Servers updated at the same time (default 5), throttles how many
servers a bulk run updates and restarts together; the scan after each update
still follows the matches-at-once limit. A single server and the resource-wide
run are unchanged. A cancel now stops every server before its next step.

Also widens a test's script-tag filter that code scanning flagged.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… and of cancelling a run

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@mbomb67
mbomb67 merged commit ec09848 into main Nov 25, 2026
9 checks passed
@mbomb67
mbomb67 deleted the vulnerabilities-install-updates-clean branch November 25, 2026 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants