From 67daae06cc9a305da1d7c853fd196929a31a7573 Mon Sep 17 00:00:00 2001 From: Anthony Volk <14987227+anth-volk@users.noreply.github.com> Date: Thu, 26 Nov 2026 21:57:28 +0400 Subject: [PATCH 1/5] Test that the UK Chronicle rebuild's image distrusts the eMudhra roots The rebuild's Modal image must drop the compromised eMudhra (emSign) certificate authorities before it downloads anything, as the US Modal image does: ca-certificates in apt_install, the hash-pinned pip 26.2.2 in place of the base's pip 25.3, then uv 0.13.4 and certifi 2026.10.19 or later beside huggingface_hub. The test compares those steps with tools/modal_us_stage_plan.py's values. It fails on an assertion now. Refs #1768 Co-Authored-By: Claude Opus 5.5 --- ...est_modal_rebuild_uk_chronicle_artifact.py | 94 +++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 packages/microcosm-build/tests/engine_free/uk/test_modal_rebuild_uk_chronicle_artifact.py diff --git a/packages/microcosm-build/tests/engine_free/uk/test_modal_rebuild_uk_chronicle_artifact.py b/packages/microcosm-build/tests/engine_free/uk/test_modal_rebuild_uk_chronicle_artifact.py new file mode 100644 index 0000000000..f1b526f62c --- /dev/null +++ b/packages/microcosm-build/tests/engine_free/uk/test_modal_rebuild_uk_chronicle_artifact.py @@ -0,0 +1,94 @@ +"""tools/modal_rebuild_uk_chronicle_artifact.py's image, against a stub ``modal``. + +The app's credential tests are in ``test_modal_uk_cut.py``; these check the +image the rebuild runs in. Nothing here builds an image or contacts Modal. +""" + +from __future__ import annotations + +import importlib.util +import sys +from pathlib import Path +from unittest.mock import MagicMock + +ROOT = Path(__file__).resolve().parents[5] +REBUILD_TOOL = ROOT / "tools" / "modal_rebuild_uk_chronicle_artifact.py" +US_PLAN_TOOL = ROOT / "tools" / "modal_us_stage_plan.py" + + +def _load_rebuild_app(monkeypatch): + """The rebuild app as the launcher sees it: ``modal.is_local()`` is true.""" + + modal_stub = MagicMock(name="modal") + modal_stub.is_local.return_value = True + modal_stub.App.return_value.function.side_effect = lambda **options: ( + lambda function: setattr(function, "modal_options", options) or function + ) + modal_stub.App.return_value.local_entrypoint.side_effect = lambda **_: ( + lambda function: function + ) + monkeypatch.setitem(sys.modules, "modal", modal_stub) + spec = importlib.util.spec_from_file_location( + "modal_rebuild_uk_chronicle_artifact_under_test", REBUILD_TOOL + ) + module = importlib.util.module_from_spec(spec) + assert spec.loader is not None + spec.loader.exec_module(module) + return module, modal_stub + + +def _load_us_plan(monkeypatch): + """The US Modal stage runner's plan module, loaded by path like the tools.""" + + spec = importlib.util.spec_from_file_location( + "modal_us_stage_plan_beside_chronicle_rebuild", US_PLAN_TOOL + ) + module = importlib.util.module_from_spec(spec) + assert spec.loader is not None + # dataclasses resolve string annotations through sys.modules. + monkeypatch.setitem(sys.modules, spec.name, module) + spec.loader.exec_module(module) + return module + + +def _image_chain(modal_stub): + """Each image-definition call as (step name, arguments), in order.""" + + return [ + (call_name.rsplit(".", 1)[-1], call_args) + for call_name, call_args, _ in modal_stub.mock_calls + if call_name.startswith("Image.debian_slim") + ] + + +def test_the_rebuild_image_trusts_no_compromised_certificate_authority(monkeypatch): + """As the US Modal image does, before anything else is downloaded. + + The compromised eMudhra (emSign) roots: uv before 0.13.4 compiles them in, + the cached base's pip 25.3 bundles them, and the base's CA store, which + git's clone of Chronicle and the standard library read, holds them until + it is upgraded. The upload's Hub client checks the Hub's certificate + against certifi on the image's own Python. + """ + + us_plan = _load_us_plan(monkeypatch) + module, modal_stub = _load_rebuild_app(monkeypatch) + chain = _image_chain(modal_stub) + assert [step_name for step_name, _ in chain] == [ + "debian_slim", + "apt_install", + "run_commands", + "pip_install", + "run_commands", + "env", + ] + assert "ca-certificates" in chain[1][1] + # The hash-pinned pip replaces the base's before pip downloads anything else. + assert chain[2][1] == (us_plan.image_pip_bootstrap_command(),) + assert chain[3][1] == ( + f"uv=={us_plan.IMAGE_UV_VERSION}", + f"huggingface_hub=={module.HF_HUB_VERSION}", + f"certifi>={us_plan.RUNNER_CERTIFI_MINIMUM_VERSION}", + ) + # The rebuild's own Python comes from the upgraded uv. + assert chain[4][1] == (f"uv python install {module.PYTHON_VERSION}",) From 822341cec1a569ab889c236e6f6a6f3628c90e50 Mon Sep 17 00:00:00 2001 From: Anthony Volk <14987227+anth-volk@users.noreply.github.com> Date: Thu, 26 Nov 2026 21:58:41 +0400 Subject: [PATCH 2/5] Distrust the eMudhra roots in the UK Chronicle rebuild's Modal image As the US Modal image does, the rebuild's image now drops the compromised eMudhra (emSign) certificate authorities before it downloads anything else: apt_install names ca-certificates, a hash-pinned pip 26.2.2 replaces the cached base's pip 25.3, and uv 0.13.4 (was 0.11.7) and certifi 2026.10.19 or later are installed beside huggingface_hub. The upload's Hub client, which carries HF_TOKEN, checks the Hub's certificate against that certifi. The app keeps its own constants; the test compares them with tools/modal_us_stage_plan.py's. Closes #1768 Co-Authored-By: Claude Opus 5.5 --- ...1768-uk-chronicle-rebuild-emudhra.fixed.md | 1 + docs/uk-cut-anyone.md | 7 +++ tools/modal_rebuild_uk_chronicle_artifact.py | 58 ++++++++++++++++++- 3 files changed, 63 insertions(+), 3 deletions(-) create mode 100644 changelog.d/1768-uk-chronicle-rebuild-emudhra.fixed.md diff --git a/changelog.d/1768-uk-chronicle-rebuild-emudhra.fixed.md b/changelog.d/1768-uk-chronicle-rebuild-emudhra.fixed.md new file mode 100644 index 0000000000..701e381f53 --- /dev/null +++ b/changelog.d/1768-uk-chronicle-rebuild-emudhra.fixed.md @@ -0,0 +1 @@ +The UK Chronicle rebuild's Modal image (`tools/modal_rebuild_uk_chronicle_artifact.py`) stops trusting the compromised eMudhra (emSign) CA certificates, as the US Modal image does (`emudhra-ca-trust.fixed.md`). Before any other download it upgrades `ca-certificates` and replaces the cached `debian_slim` base's pip 25.3 with a hash-pinned pip 26.2.2; it then installs uv 0.13.4 instead of 0.11.7 and requires certifi 2026.10.19 or later beside `huggingface_hub`. So neither the packages an upload runs with `HF_TOKEN` nor the upload's connection to the Hub depends on those authorities. diff --git a/docs/uk-cut-anyone.md b/docs/uk-cut-anyone.md index ce82d62e4e..fefbd7e931 100644 --- a/docs/uk-cut-anyone.md +++ b/docs/uk-cut-anyone.md @@ -235,6 +235,13 @@ the private repositories, is attached only with ephemeral secret for that run; no named workspace secret keeps it. A rebuild without `--upload` sends no credential at all. +As the US Modal image does, the rebuild's image drops the compromised eMudhra +(emSign) certificate authorities before it downloads anything else: it +upgrades `ca-certificates`, replaces the base's pip with a hash-pinned pip +26.2.2, and installs uv 0.13.4 and certifi 2026.10.19 or later beside +`huggingface_hub`. uv 0.13.4 may install a newer Python 3.14 release than the +2026-10-22 rebuild ran on; the receipt records the one it used. + ### The reference build A cut checks and certifies its candidate against the current build of the diff --git a/tools/modal_rebuild_uk_chronicle_artifact.py b/tools/modal_rebuild_uk_chronicle_artifact.py index d653068cd5..f2a20e30e5 100644 --- a/tools/modal_rebuild_uk_chronicle_artifact.py +++ b/tools/modal_rebuild_uk_chronicle_artifact.py @@ -14,6 +14,12 @@ files against the pin. Results go to the ``microcosm-uk-chronicle`` Modal volume under ``//``, with a receipt beside them. +As in the US Modal image, the image first drops the compromised eMudhra +certificate authorities (an upgraded CA store, a hash-pinned pip, uv 0.13.4 +and a certifi floor) before it downloads anything else, so neither the +packages an upload runs with ``HF_TOKEN`` nor the upload's own connection to +the Hub depends on them. + Check the pin and print the plan (plain Python; contacts no Modal service and sends nothing):: @@ -44,6 +50,7 @@ import json import os import resource +import shlex import shutil import subprocess import sys @@ -59,8 +66,25 @@ HF_REPO = "policyengine/microcosm-uk-build-inputs" CHRONICLE_URL = "https://github.com/PolicyEngine/chronicle.git" PYTHON_VERSION = "3.14" -UV_VERSION = "0.11.7" +# The compromised eMudhra (emSign) roots, whose intermediate keys were +# disclosed on 2026-10-20, are dropped as in the US Modal image +# (tools/modal_us_stage_plan.py, whose values the tests compare with these). +# uv verifies HTTPS against a CA list compiled into it, and 0.13.4 is the +# first release whose list drops them. +UV_VERSION = "0.13.4" +# Modal's cached debian_slim base carries pip 25.3, whose bundled certifi +# still contains emSign ECC Root CA - G3, so the image replaces it with this +# pip before downloading anything else. The wheel's sha256, as PyPI publishes +# it, not the connection, makes that one download authentic. +PIP_VERSION = "26.2.2" +PIP_WHEEL_SHA256 = "fd7f4dfa8190e014013b9f08f3e973f4e4c26ffd179a204895533a7254813a70" +PIP_BOOTSTRAP_REQUIREMENTS = "/tmp/pip-bootstrap.txt" HF_HUB_VERSION = "1.18.0" +# The upload's Hub client checks the Hub's certificate against certifi's CA +# list on the image's own Python, and 2026.10.19 is the first certifi release +# without the eMudhra roots. Stated, since Modal reuses a cached layer while +# its definition is unchanged. +CERTIFI_MINIMUM_VERSION = "2026.10.19" FEED_PIN = Path(__file__).resolve().parents[1] / ( "packages/microcosm-build/src/microcosm/build/uk/chronicle_feed.json" ) @@ -91,10 +115,38 @@ def _secrets() -> list[modal.Secret]: return [modal.Secret.from_dict({"HF_TOKEN": token})] if token else [] +def pip_bootstrap_command() -> str: + """The shell step that replaces the base's pip before any package download. + + ``--require-hashes`` refuses any file whose sha256 is not + ``PIP_WHEEL_SHA256``, whatever index or certificate answers the request. + """ + + requirement = f"pip=={PIP_VERSION} --hash=sha256:{PIP_WHEEL_SHA256}" + path = shlex.quote(PIP_BOOTSTRAP_REQUIREMENTS) + return ( + f"printf '%s\\n' {shlex.quote(requirement)} > {path}" + f" && python -m pip install --require-hashes --no-deps -r {path}" + f" && rm {path}" + ) + + image = ( modal.Image.debian_slim(python_version=PYTHON_VERSION) - .apt_install("git", "curl", "time") - .pip_install(f"uv=={UV_VERSION}", f"huggingface_hub=={HF_HUB_VERSION}") + # Naming ca-certificates upgrades the base's CA store, which git's clone + # of Chronicle and the standard library's ssl module verify against, to + # Debian's current release, which drops the eMudhra roots. + .apt_install("git", "curl", "time", "ca-certificates") + # Before the base's pip downloads anything else. + .run_commands(pip_bootstrap_command()) + # The upload runs huggingface_hub on the image's own Python. + .pip_install( + f"uv=={UV_VERSION}", + f"huggingface_hub=={HF_HUB_VERSION}", + f"certifi>={CERTIFI_MINIMUM_VERSION}", + ) + # The upgraded uv checks the Python it downloads against the sha256 it + # carries for that release. .run_commands(f"uv python install {PYTHON_VERSION}") .env( { From d616d4adcb5a82d867cec9f302312442a88ab09e Mon Sep 17 00:00:00 2001 From: Anthony Volk <14987227+anth-volk@users.noreply.github.com> Date: Thu, 26 Nov 2026 22:25:05 +0400 Subject: [PATCH 3/5] Check the rebuild image's step options too Review round 1 of #1769: the test compared only each image step's positional arguments, so an index URL or a trusted-host option on pip_install would have passed it. It now requires that no step before the environment passes options, and its docstring names emSign ECC Root CA - G3, the root the image stops trusting. Refs #1768 Co-Authored-By: Claude Opus 5.5 --- ...est_modal_rebuild_uk_chronicle_artifact.py | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/packages/microcosm-build/tests/engine_free/uk/test_modal_rebuild_uk_chronicle_artifact.py b/packages/microcosm-build/tests/engine_free/uk/test_modal_rebuild_uk_chronicle_artifact.py index f1b526f62c..aa3d5dab88 100644 --- a/packages/microcosm-build/tests/engine_free/uk/test_modal_rebuild_uk_chronicle_artifact.py +++ b/packages/microcosm-build/tests/engine_free/uk/test_modal_rebuild_uk_chronicle_artifact.py @@ -52,11 +52,11 @@ def _load_us_plan(monkeypatch): def _image_chain(modal_stub): - """Each image-definition call as (step name, arguments), in order.""" + """Each image-definition call as (step name, arguments, options), in order.""" return [ - (call_name.rsplit(".", 1)[-1], call_args) - for call_name, call_args, _ in modal_stub.mock_calls + (call_name.rsplit(".", 1)[-1], call_args, call_options) + for call_name, call_args, call_options in modal_stub.mock_calls if call_name.startswith("Image.debian_slim") ] @@ -64,17 +64,18 @@ def _image_chain(modal_stub): def test_the_rebuild_image_trusts_no_compromised_certificate_authority(monkeypatch): """As the US Modal image does, before anything else is downloaded. - The compromised eMudhra (emSign) roots: uv before 0.13.4 compiles them in, - the cached base's pip 25.3 bundles them, and the base's CA store, which - git's clone of Chronicle and the standard library read, holds them until - it is upgraded. The upload's Hub client checks the Hub's certificate - against certifi on the image's own Python. + emSign ECC Root CA - G3, the eMudhra root removed after the 2026-10-20 + key disclosure: uv before 0.13.4 compiles it in, the cached base's pip 25.3 + bundles it, and the base's CA store, which git's clone of Chronicle and the + standard library read, holds it until it is upgraded. The upload's Hub + client checks the Hub's certificate against certifi on the image's own + Python. """ us_plan = _load_us_plan(monkeypatch) module, modal_stub = _load_rebuild_app(monkeypatch) chain = _image_chain(modal_stub) - assert [step_name for step_name, _ in chain] == [ + assert [step_name for step_name, _, _ in chain] == [ "debian_slim", "apt_install", "run_commands", @@ -92,3 +93,6 @@ def test_the_rebuild_image_trusts_no_compromised_certificate_authority(monkeypat ) # The rebuild's own Python comes from the upgraded uv. assert chain[4][1] == (f"uv python install {module.PYTHON_VERSION}",) + # No step before the environment passes options such as another index or + # a trusted host. + assert [step_options for _, _, step_options in chain[1:5]] == [{}, {}, {}, {}] From fad867845494e369c9222f1f76733185c5eebb42 Mon Sep 17 00:00:00 2001 From: Anthony Volk <14987227+anth-volk@users.noreply.github.com> Date: Thu, 26 Nov 2026 22:25:05 +0400 Subject: [PATCH 4/5] Name the eMudhra root the rebuild image stops trusting Review round 1 of #1769: uv 0.13.4, pip 26.2.2's certifi and certifi 2026.10.19 drop only emSign ECC Root CA - G3, the root certifi and Debian removed after the 2026-10-20 disclosure, so the comments, docstring, guide paragraph and changelog fragment now name it rather than "the eMudhra roots". The guide and the fragment also give the Python release uv 0.13.4 installs (3.14.8; uv 0.11.7 installed 3.14.4). Refs #1768 Co-Authored-By: Claude Opus 5.5 --- ...1768-uk-chronicle-rebuild-emudhra.fixed.md | 2 +- docs/uk-cut-anyone.md | 13 +++++---- tools/modal_rebuild_uk_chronicle_artifact.py | 28 ++++++++++--------- 3 files changed, 23 insertions(+), 20 deletions(-) diff --git a/changelog.d/1768-uk-chronicle-rebuild-emudhra.fixed.md b/changelog.d/1768-uk-chronicle-rebuild-emudhra.fixed.md index 701e381f53..2c00ad2008 100644 --- a/changelog.d/1768-uk-chronicle-rebuild-emudhra.fixed.md +++ b/changelog.d/1768-uk-chronicle-rebuild-emudhra.fixed.md @@ -1 +1 @@ -The UK Chronicle rebuild's Modal image (`tools/modal_rebuild_uk_chronicle_artifact.py`) stops trusting the compromised eMudhra (emSign) CA certificates, as the US Modal image does (`emudhra-ca-trust.fixed.md`). Before any other download it upgrades `ca-certificates` and replaces the cached `debian_slim` base's pip 25.3 with a hash-pinned pip 26.2.2; it then installs uv 0.13.4 instead of 0.11.7 and requires certifi 2026.10.19 or later beside `huggingface_hub`. So neither the packages an upload runs with `HF_TOKEN` nor the upload's connection to the Hub depends on those authorities. +The UK Chronicle rebuild's Modal image (`tools/modal_rebuild_uk_chronicle_artifact.py`) stops trusting emSign ECC Root CA - G3, the eMudhra CA certificate removed after the 2026-10-20 key disclosure, as the US Modal image does (`emudhra-ca-trust.fixed.md`). Before any other download it upgrades `ca-certificates` and replaces the cached `debian_slim` base's pip 25.3 with a hash-pinned pip 26.2.2; it then installs uv 0.13.4 instead of 0.11.7 and requires certifi 2026.10.19 or later beside `huggingface_hub`. So neither the packages an upload runs with `HF_TOKEN` nor the upload's connection to the Hub depends on that root. uv 0.13.4 installs Python 3.14.8 for the rebuild, where uv 0.11.7 installed 3.14.4. diff --git a/docs/uk-cut-anyone.md b/docs/uk-cut-anyone.md index fefbd7e931..f2ed877350 100644 --- a/docs/uk-cut-anyone.md +++ b/docs/uk-cut-anyone.md @@ -235,12 +235,13 @@ the private repositories, is attached only with ephemeral secret for that run; no named workspace secret keeps it. A rebuild without `--upload` sends no credential at all. -As the US Modal image does, the rebuild's image drops the compromised eMudhra -(emSign) certificate authorities before it downloads anything else: it -upgrades `ca-certificates`, replaces the base's pip with a hash-pinned pip -26.2.2, and installs uv 0.13.4 and certifi 2026.10.19 or later beside -`huggingface_hub`. uv 0.13.4 may install a newer Python 3.14 release than the -2026-10-22 rebuild ran on; the receipt records the one it used. +As the US Modal image does, the rebuild's image stops trusting emSign ECC Root +CA - G3, the eMudhra root that certifi and Debian removed after eMudhra +intermediate keys were disclosed on 2026-10-20, before it downloads anything +else. It upgrades `ca-certificates`, replaces the base's pip with a +hash-pinned pip 26.2.2, and installs uv 0.13.4 and certifi 2026.10.19 or +later beside `huggingface_hub`. uv 0.13.4 installs Python 3.14.8, where the +app's earlier uv 0.11.7 installed 3.14.4; the receipt records the one used. ### The reference build diff --git a/tools/modal_rebuild_uk_chronicle_artifact.py b/tools/modal_rebuild_uk_chronicle_artifact.py index f2a20e30e5..d25bbb6e13 100644 --- a/tools/modal_rebuild_uk_chronicle_artifact.py +++ b/tools/modal_rebuild_uk_chronicle_artifact.py @@ -14,11 +14,12 @@ files against the pin. Results go to the ``microcosm-uk-chronicle`` Modal volume under ``//``, with a receipt beside them. -As in the US Modal image, the image first drops the compromised eMudhra -certificate authorities (an upgraded CA store, a hash-pinned pip, uv 0.13.4 -and a certifi floor) before it downloads anything else, so neither the -packages an upload runs with ``HF_TOKEN`` nor the upload's own connection to -the Hub depends on them. +As in the US Modal image, before it downloads anything else the image stops +trusting emSign ECC Root CA - G3, the eMudhra root that certifi and Debian +removed after the disclosure of eMudhra intermediate keys on 2026-10-20 (an +upgraded CA store, a hash-pinned pip, uv 0.13.4 and a certifi floor). So +neither the packages an upload runs with ``HF_TOKEN`` nor the upload's own +connection to the Hub depends on that root. Check the pin and print the plan (plain Python; contacts no Modal service and sends nothing):: @@ -66,11 +67,11 @@ HF_REPO = "policyengine/microcosm-uk-build-inputs" CHRONICLE_URL = "https://github.com/PolicyEngine/chronicle.git" PYTHON_VERSION = "3.14" -# The compromised eMudhra (emSign) roots, whose intermediate keys were -# disclosed on 2026-10-20, are dropped as in the US Modal image -# (tools/modal_us_stage_plan.py, whose values the tests compare with these). -# uv verifies HTTPS against a CA list compiled into it, and 0.13.4 is the -# first release whose list drops them. +# emSign ECC Root CA - G3, the eMudhra root removed after eMudhra +# intermediate keys were disclosed on 2026-10-20, is dropped as in the US +# Modal image (tools/modal_us_stage_plan.py, whose values the tests compare +# with these). uv verifies HTTPS against a CA list compiled into it, and +# 0.13.4 is the first release whose list drops it. UV_VERSION = "0.13.4" # Modal's cached debian_slim base carries pip 25.3, whose bundled certifi # still contains emSign ECC Root CA - G3, so the image replaces it with this @@ -82,8 +83,8 @@ HF_HUB_VERSION = "1.18.0" # The upload's Hub client checks the Hub's certificate against certifi's CA # list on the image's own Python, and 2026.10.19 is the first certifi release -# without the eMudhra roots. Stated, since Modal reuses a cached layer while -# its definition is unchanged. +# without emSign ECC Root CA - G3. Stated, since Modal reuses a cached layer +# while its definition is unchanged. CERTIFI_MINIMUM_VERSION = "2026.10.19" FEED_PIN = Path(__file__).resolve().parents[1] / ( "packages/microcosm-build/src/microcosm/build/uk/chronicle_feed.json" @@ -135,7 +136,8 @@ def pip_bootstrap_command() -> str: modal.Image.debian_slim(python_version=PYTHON_VERSION) # Naming ca-certificates upgrades the base's CA store, which git's clone # of Chronicle and the standard library's ssl module verify against, to - # Debian's current release, which drops the eMudhra roots. + # Debian's current release, whose security fix distrusts emSign ECC Root + # CA - G3. .apt_install("git", "curl", "time", "ca-certificates") # Before the base's pip downloads anything else. .run_commands(pip_bootstrap_command()) From 8b84e55ffc5d26b2438f8b582113354bf0b5b2ba Mon Sep 17 00:00:00 2001 From: Anthony Volk <14987227+anth-volk@users.noreply.github.com> Date: Thu, 26 Nov 2026 22:45:54 +0400 Subject: [PATCH 5/5] Correct when certifi dropped the eMudhra G3 root Review round 2 of #1769: certifi 2026.10.18 already left out every emSign root, and 2026.10.19 restored the three certifi judged unaffected, so 2026.10.19 is not the first release without emSign ECC Root CA - G3, and that removal did not follow a 2026-10-20 disclosure. The comments, docstrings, guide paragraph and changelog fragment no longer order the events by date; the certifi comment says what each release holds. The floor stays 2026.10.19, as in the US image. Refs #1768 Co-Authored-By: Claude Opus 5.5 --- ...1768-uk-chronicle-rebuild-emudhra.fixed.md | 2 +- docs/uk-cut-anyone.md | 12 ++++----- ...est_modal_rebuild_uk_chronicle_artifact.py | 12 ++++----- tools/modal_rebuild_uk_chronicle_artifact.py | 25 ++++++++++--------- 4 files changed, 26 insertions(+), 25 deletions(-) diff --git a/changelog.d/1768-uk-chronicle-rebuild-emudhra.fixed.md b/changelog.d/1768-uk-chronicle-rebuild-emudhra.fixed.md index 2c00ad2008..f6d50a4f04 100644 --- a/changelog.d/1768-uk-chronicle-rebuild-emudhra.fixed.md +++ b/changelog.d/1768-uk-chronicle-rebuild-emudhra.fixed.md @@ -1 +1 @@ -The UK Chronicle rebuild's Modal image (`tools/modal_rebuild_uk_chronicle_artifact.py`) stops trusting emSign ECC Root CA - G3, the eMudhra CA certificate removed after the 2026-10-20 key disclosure, as the US Modal image does (`emudhra-ca-trust.fixed.md`). Before any other download it upgrades `ca-certificates` and replaces the cached `debian_slim` base's pip 25.3 with a hash-pinned pip 26.2.2; it then installs uv 0.13.4 instead of 0.11.7 and requires certifi 2026.10.19 or later beside `huggingface_hub`. So neither the packages an upload runs with `HF_TOKEN` nor the upload's connection to the Hub depends on that root. uv 0.13.4 installs Python 3.14.8 for the rebuild, where uv 0.11.7 installed 3.14.4. +The UK Chronicle rebuild's Modal image (`tools/modal_rebuild_uk_chronicle_artifact.py`) stops trusting emSign ECC Root CA - G3, the eMudhra CA certificate that certifi and Debian distrust over eMudhra's disclosed intermediate keys, as the US Modal image does (`emudhra-ca-trust.fixed.md`). Before any other download it upgrades `ca-certificates` and replaces the cached `debian_slim` base's pip 25.3 with a hash-pinned pip 26.2.2; it then installs uv 0.13.4 instead of 0.11.7 and requires certifi 2026.10.19 or later beside `huggingface_hub`. So neither the packages an upload runs with `HF_TOKEN` nor the upload's connection to the Hub depends on that root. uv 0.13.4 installs Python 3.14.8 for the rebuild, where uv 0.11.7 installed 3.14.4. diff --git a/docs/uk-cut-anyone.md b/docs/uk-cut-anyone.md index f2ed877350..5abf38d029 100644 --- a/docs/uk-cut-anyone.md +++ b/docs/uk-cut-anyone.md @@ -236,12 +236,12 @@ ephemeral secret for that run; no named workspace secret keeps it. A rebuild without `--upload` sends no credential at all. As the US Modal image does, the rebuild's image stops trusting emSign ECC Root -CA - G3, the eMudhra root that certifi and Debian removed after eMudhra -intermediate keys were disclosed on 2026-10-20, before it downloads anything -else. It upgrades `ca-certificates`, replaces the base's pip with a -hash-pinned pip 26.2.2, and installs uv 0.13.4 and certifi 2026.10.19 or -later beside `huggingface_hub`. uv 0.13.4 installs Python 3.14.8, where the -app's earlier uv 0.11.7 installed 3.14.4; the receipt records the one used. +CA - G3, the eMudhra root that certifi and Debian distrust over eMudhra's +disclosed intermediate keys, before it downloads anything else. It upgrades +`ca-certificates`, replaces the base's pip with a hash-pinned pip 26.2.2, and +installs uv 0.13.4 and certifi 2026.10.19 or later beside `huggingface_hub`. +uv 0.13.4 installs Python 3.14.8, where the app's earlier uv 0.11.7 installed +3.14.4; the receipt records the one used. ### The reference build diff --git a/packages/microcosm-build/tests/engine_free/uk/test_modal_rebuild_uk_chronicle_artifact.py b/packages/microcosm-build/tests/engine_free/uk/test_modal_rebuild_uk_chronicle_artifact.py index aa3d5dab88..f6cd686f59 100644 --- a/packages/microcosm-build/tests/engine_free/uk/test_modal_rebuild_uk_chronicle_artifact.py +++ b/packages/microcosm-build/tests/engine_free/uk/test_modal_rebuild_uk_chronicle_artifact.py @@ -64,12 +64,12 @@ def _image_chain(modal_stub): def test_the_rebuild_image_trusts_no_compromised_certificate_authority(monkeypatch): """As the US Modal image does, before anything else is downloaded. - emSign ECC Root CA - G3, the eMudhra root removed after the 2026-10-20 - key disclosure: uv before 0.13.4 compiles it in, the cached base's pip 25.3 - bundles it, and the base's CA store, which git's clone of Chronicle and the - standard library read, holds it until it is upgraded. The upload's Hub - client checks the Hub's certificate against certifi on the image's own - Python. + emSign ECC Root CA - G3, the eMudhra root distrusted over eMudhra's + disclosed intermediate keys: uv before 0.13.4 compiles it in, the cached + base's pip 25.3 bundles it, and the base's CA store, which git's clone of + Chronicle and the standard library read, holds it until it is upgraded. + The upload's Hub client checks the Hub's certificate against certifi on + the image's own Python. """ us_plan = _load_us_plan(monkeypatch) diff --git a/tools/modal_rebuild_uk_chronicle_artifact.py b/tools/modal_rebuild_uk_chronicle_artifact.py index d25bbb6e13..71f7e3f55e 100644 --- a/tools/modal_rebuild_uk_chronicle_artifact.py +++ b/tools/modal_rebuild_uk_chronicle_artifact.py @@ -16,10 +16,10 @@ As in the US Modal image, before it downloads anything else the image stops trusting emSign ECC Root CA - G3, the eMudhra root that certifi and Debian -removed after the disclosure of eMudhra intermediate keys on 2026-10-20 (an -upgraded CA store, a hash-pinned pip, uv 0.13.4 and a certifi floor). So -neither the packages an upload runs with ``HF_TOKEN`` nor the upload's own -connection to the Hub depends on that root. +distrust over eMudhra's disclosed intermediate keys (an upgraded CA store, a +hash-pinned pip, uv 0.13.4 and a certifi floor). So neither the packages an +upload runs with ``HF_TOKEN`` nor the upload's own connection to the Hub +depends on that root. Check the pin and print the plan (plain Python; contacts no Modal service and sends nothing):: @@ -67,11 +67,11 @@ HF_REPO = "policyengine/microcosm-uk-build-inputs" CHRONICLE_URL = "https://github.com/PolicyEngine/chronicle.git" PYTHON_VERSION = "3.14" -# emSign ECC Root CA - G3, the eMudhra root removed after eMudhra -# intermediate keys were disclosed on 2026-10-20, is dropped as in the US -# Modal image (tools/modal_us_stage_plan.py, whose values the tests compare -# with these). uv verifies HTTPS against a CA list compiled into it, and -# 0.13.4 is the first release whose list drops it. +# emSign ECC Root CA - G3, the eMudhra root distrusted over eMudhra's +# disclosed intermediate keys, is dropped as in the US Modal image +# (tools/modal_us_stage_plan.py, whose values the tests compare with these). +# uv verifies HTTPS against a CA list compiled into it, and 0.13.4 is the +# first release whose list drops it. UV_VERSION = "0.13.4" # Modal's cached debian_slim base carries pip 25.3, whose bundled certifi # still contains emSign ECC Root CA - G3, so the image replaces it with this @@ -82,9 +82,10 @@ PIP_BOOTSTRAP_REQUIREMENTS = "/tmp/pip-bootstrap.txt" HF_HUB_VERSION = "1.18.0" # The upload's Hub client checks the Hub's certificate against certifi's CA -# list on the image's own Python, and 2026.10.19 is the first certifi release -# without emSign ECC Root CA - G3. Stated, since Modal reuses a cached layer -# while its definition is unchanged. +# list on the image's own Python. certifi 2026.10.19 and later leave out +# emSign ECC Root CA - G3 (2026.10.18 left out every emSign root, and +# 2026.10.19 restored the three certifi judged unaffected). Stated, since +# Modal reuses a cached layer while its definition is unchanged. CERTIFI_MINIMUM_VERSION = "2026.10.19" FEED_PIN = Path(__file__).resolve().parents[1] / ( "packages/microcosm-build/src/microcosm/build/uk/chronicle_feed.json"