You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 8ea64fd
Browse filesBrowse the repository at this point in the historyBrowse files
feat(update): enforce the min_supported floor in v1 (#130)
* feat(update): enforce the min_supported floor in v1
The manifest has always carried min_supported and nothing read it: it was
parsed into Manifest and never consulted, and the min_supported_baseline
file baked into greffer-updater has no reader in cli/ at all.
Per the trust model the floor exists to "block below-floor reintroduction"
-- an update must never land the node on a release withdrawn as known-bad.
v1 was meant to have it: hld-v2-per-container-recreate section 7 says v1
"reads the manifest over HTTPS for the downgrade floor". It never did.
v2 is deliberately untouched. The :latest updater drops the floor BY
CONSTRUCTION (section 11), replacing it with verify-then-pull plus a
pre-run no-downgrade refusal. Adding it there would reverse a recorded
architectural decision, so this is v1-only.
Semantics, distinct from the downgrade guard added in #129: is_downgrade
is about DIRECTION relative to what is running; below_floor is about an
absolute bound. 0.9 -> 0.8 is a downgrade that may still be above the
floor, and a fresh install of a below-floor version is not a downgrade at
all yet is still refused.
NOT overridable by --to. A downgrade is a legitimate operator choice; a
below-floor release is withdrawn, so an explicit request for one is
exactly what this refuses. --check reports it too.
Also fixes a live crash in version_tuple, which #129 already merged.
str.isdigit() is not enough to make int() safe on manifest-supplied text:
it is True for non-ASCII digits ('²'.isdigit() is True, int('²') raises)
and for digit runs past CPython's 4300-char int-string limit. Either
turned a malformed manifest into a traceback out of `greffer update`.
Now requires plain ASCII digits with a bounded length. Found by Codex.
Honest scope: v1 fetches the manifest over HTTPS but does not verify its
signature, and there is no /data ratchet, so a hostile or rolled-back
origin can serve a LOWER floor. This is a safety guard against landing on
a known-bad release, not a security control against a hostile origin. The
signed-manifest + ratchet half (HLD section 11) remains unbuilt and is
stated as such in the docstring.
294 tests pass (21 added). Both the floor tests and the hostile-input
tests were verified to FAIL with their fix removed.
* docs(update): state that the floor is tag-based, not content-based
Codex flagged that below_floor() compares the requested tag, so a tag
moved or mispublished to below-floor content passes.
Correct, and left unimplemented on purpose. Closing it needs the pulled
image's version label, which v1 has no machinery to read, and that label
is forgeable (v2 trust model section 7) so it would not close the case
against a hostile registry either. v1 does not cosign-verify images at all
and is operator-trust by design, so tag-trust is already its baseline.
Documenting rather than silently leaving the reader to assume the floor is
content-based.
0 commit comments