Skip to content

Detect a provider Ubuntu mirror in cmax audit - #225

Merged
aliencaocao merged 3 commits into
masterfrom
ubuntu-mirror-criterion
Dec 3, 2026
Merged

aliencaocao merged 3 commits into
masterfrom
ubuntu-mirror-criterion

Conversation

@aliencaocao

@aliencaocao aliencaocao commented Dec 3, 2026 •

Copy link
Copy Markdown
Member

Adds ubuntu-mirror, a recommended (partial coverage) Software Stack check.

  • host-check.sh reads the worker apt sources (one-line and deb822). It reports custom when Ubuntu archive entries (found by the restricted, universe or multiverse component, so snapshot suites count) use a host other than archive|ports|security.ubuntu.com (with optional country prefix), default when they use only those hosts, unknown when no archive entries are found, and not_applicable on non-Ubuntu hosts.
  • The fact lands in software.ubuntuMirror.{status,archiveHosts} for Slurm, standalone and K8s (host-root value wins).
  • default gives a CONFIG warning that tells the auditor to ask the provider about a DNS-based or proxy mirror, because such a mirror keeps the default hostnames.
  • Adds ubuntu-mirror to criteria-checks.json after lmod.

Tests: tests/audit/test_ubuntu_mirror.py; full suite passes locally.


Note

Low Risk
Read-only apt source inspection and advisory grading only; no changes to package installs or cluster mutation paths.

Overview
Adds a recommended Software Stack check (ubuntu-mirror, partial coverage) that inspects Ubuntu workers’ apt sources and surfaces whether the Ubuntu archive is served from a provider mirror or still points at Canonical’s public hosts.

Collection: host-check.sh gains collect_ubuntu_mirror, which scans one-line deb entries and deb822 .sources files for hosts tied to restricted / universe / multiverse, then emits WORKER_APT_MIRROR (custom, default, unknown, not_applicable) and WORKER_APT_ARCHIVE_HOSTS. Those facts fold into software.ubuntuMirror via merge_audit.py, Slurm audit-common.sh JSON, and Kubernetes host-root merging (WORKER_APT_* added to HOST_ROOT_FACT_KEYS).

Grading: A new finding rule treats default (only archive / security / country-coded Canonical hosts) as a CONFIG warning with guidance to confirm DNS/proxy mirroring with the provider; custom passes. Wiring includes criteria-checks.json, criteria links (lifecycle), report pass text, reproduction grep, and tailored finding guidance listing observed archive hosts.

Tests: tests/audit/test_ubuntu_mirror.py covers apt parsing edge cases, K8s merge, and report grades.

Reviewed by Cursor Bugbot for commit add3e17. Bugbot is set up for automated code reviews on this repo. Configure here.

Copy link
Copy Markdown
Member Author

Live run of this branch with real cmax audit:

  • K8s (CoreWeave yolo-new): first run gave unknown, because the host sources use a provider snapshot mirror with suites like noble-20260710. The fix in the last commit finds Ubuntu archive entries by component. After the fix: PASS, custom.
  • Slurm (CoreWeave SUNK, salloc, 1 H100 node): WARNING, default (archive.ubuntu.com, security.ubuntu.com). The srun step runs in the slurmd container with stock sources, so the auditor asks the provider.

Copy link
Copy Markdown
Member Author

Live standalone run (Ubuntu 26.04 VM): PASS, custom (a cloud-region Ubuntu archive host plus security.ubuntu.com).

@aliencaocao
aliencaocao marked this pull request as ready for review December 3, 2026 12:45
@aliencaocao
aliencaocao merged commit 8a7a6d3 into master Dec 3, 2026
6 checks passed
@aliencaocao
aliencaocao deleted the ubuntu-mirror-criterion branch December 3, 2026 12:54
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.

1 participant