Repository navigation
Detect a provider Ubuntu mirror in cmax audit - #225
Merged
Merged
Conversation
Member
Author
|
Live run of this branch with real
|
Member
Author
|
Live standalone run (Ubuntu 26.04 VM): PASS, |
aliencaocao
marked this pull request as ready for review
December 3, 2026 12:45
aliencaocao
requested review from
JordanNanos,
Prathmesh234 and
samharshe
as code owners
December 3, 2026 12:45
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
ubuntu-mirror, a recommended (partial coverage) Software Stack check.host-check.shreads the worker apt sources (one-line and deb822). It reportscustomwhen Ubuntu archive entries (found by the restricted, universe or multiverse component, so snapshot suites count) use a host other thanarchive|ports|security.ubuntu.com(with optional country prefix),defaultwhen they use only those hosts,unknownwhen no archive entries are found, andnot_applicableon non-Ubuntu hosts.software.ubuntuMirror.{status,archiveHosts}for Slurm, standalone and K8s (host-root value wins).defaultgives 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.ubuntu-mirrortocriteria-checks.jsonafterlmod.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.shgainscollect_ubuntu_mirror, which scans one-linedebentries and deb822.sourcesfiles for hosts tied torestricted/universe/multiverse, then emitsWORKER_APT_MIRROR(custom,default,unknown,not_applicable) andWORKER_APT_ARCHIVE_HOSTS. Those facts fold intosoftware.ubuntuMirrorviamerge_audit.py, Slurmaudit-common.shJSON, and Kubernetes host-root merging (WORKER_APT_*added toHOST_ROOT_FACT_KEYS).Grading: A new finding rule treats
default(onlyarchive/security/ country-coded Canonical hosts) as a CONFIG warning with guidance to confirm DNS/proxy mirroring with the provider;custompasses. Wiring includescriteria-checks.json, criteria links (lifecycle), report pass text, reproductiongrep, and tailored finding guidance listing observed archive hosts.Tests:
tests/audit/test_ubuntu_mirror.pycovers 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.