Skip to content

ci(interop): pin openssh-client to an exact version via snapshot.debian.org - #98

Closed
gonzafg2 wants to merge 6 commits into
mainfrom
ci/openssh-snapshot-version-pin
Closed

gonzafg2 wants to merge 6 commits into
mainfrom
ci/openssh-snapshot-version-pin

Conversation

@gonzafg2

@gonzafg2 gonzafg2 commented Jul 2, 2026

Copy link
Copy Markdown
Owner

Closes the ADR-0020 follow-up (the snapshot-pin hardening the ADR named, tracked from the #86 review).

Problem

The interop gate pinned the base image by digest, but apt-get install openssh-client still hit live trixie — so the client version could drift silently between runs (the gate already had to relax its ssh -V grep to 10.0p[0-9] when trixie moved p1→p2).

Change

The install step now:

  1. Replaces trixie's live deb822 sources with a frozen snapshot.debian.org timestamp (20260507T000000Z), check-valid-until=no (archived Release files are past Valid-Until).
  2. Pins openssh-client=1:10.0p1-7+deb13u4 (binary OpenSSH_10.0p2).
  3. Asserts the resolved version fail-closed — a drift fails the install, surfacing it as a reviewed event.

Version + archive verified against packages.debian.org/trixie/openssh-client and the snapshot.debian.org binfiles API (deb13u4 first seen 20260506T205057Z, debian archive — not security, so no extra repo needed).

Note

Not reproducible locally (needs the trixie container) — validated by the openssh-interop gate in this PR's CI. If the snapshot/version doesn't resolve, the gate fails and I'll adjust.

https://claude.ai/code/session_01BRMdwxsqYQPbjrWB1Cek6o

…an.org

Closes the ADR-0020 follow-up (noted there, tracked from the #86 review):
the interop gate pinned the base image by digest but still ran
`apt-get install openssh-client` against live trixie, so the client
version could drift silently between runs.

Now the install replaces trixie's live sources with a frozen
snapshot.debian.org timestamp (20260507T000000Z) and pins
openssh-client=1:10.0p1-7+deb13u4 (binary OpenSSH_10.0p2), asserting the
resolved version fail-closed. A version change now fails the install as a
reviewed event rather than passing unnoticed. Bumping the snapshot or the
pinned version is the reviewed event, in lockstep with the digest pin.

Version + archive confirmed against packages.debian.org (trixie) and the
snapshot.debian.org binfiles API (deb13u4 first seen 20260506T205057Z in
the `debian` archive). Not locally reproducible — validated by the
openssh-interop gate itself.

Claude-Session: https://claude.ai/code/session_01BRMdwxsqYQPbjrWB1Cek6o
Signed-off-by: Gonzalo Fleming <[email protected]>
Copilot AI review requested due to automatic review settings July 2, 2026 23:16
@opencode-agent

opencode-agent Bot commented Jul 2, 2026

Copy link
Copy Markdown

Here's my review of this PR.


Classification: CI/workflow change

Summary

Straightforward hardening that implements the snapshot-pinned OpenSSH installation ADR-0020 already decided. No blocking issues.

Findings

No high-signal findings. The change:

  1. Implements ADR-0020 exactly — the ADR explicitly says "openssh-client is installed with an explicit version from a frozen source (a pinned snapshot.debian.org suite)" (ADR-0020:20), and this PR adds the mechanism it named but hadn't yet wired.

  2. Supply-chain defence (§5.5.2.a/b) — replacing live trixie APT sources with a frozen snapshot.debian.org timestamp (20260507T000000Z) combined with dpkg-query fail-closed assertion means a package drift cannot silently change the binary under test. The digest-pinned container + snapshot-pinned package + exact-version assertion form a complete reproducibility chain.

  3. Fail-closed (threat model §1.3 posture) — the dpkg-query ... | grep -Fqx gate surfaces version drift as a CI failure, not as silent pass-through. This is exactly the reviewed-event property ADR-0020:23 requires.

  4. Permissions are minimal (contents: read), no escalation, no new actions introduced.

  5. No MANIFIESTO violations — this is a CI-only change touching no Rust code, no new dependencies, no crypto surface.

Nit (non-blocking)

The check-valid-until=no flag is set in the sources.list line and via apt-get -o Acquire::Check-Valid-Until=false. The redundancy is harmless but slightly noisy. The PR's justification (archived Release files past Valid-Until) holds for either mechanism alone; the double-disable is uneventful.

Verdict

LGTM. Ready to merge once CI passes (the interop gate itself will validate the snapshot resolves).

github run

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR hardens the ADR-0020 OpenSSH interop gate by making the OpenSSH client install reproducible: it freezes APT to a specific snapshot.debian.org timestamp and pins openssh-client to an exact package version, so drift becomes a deliberate, reviewed change rather than a silent CI variation.

Changes:

  • Replace live Debian trixie APT sources with a frozen snapshot.debian.org timestamp (with Valid-Until checks disabled for archived metadata).
  • Pin openssh-client to an exact package version and fail the job if the resolved version differs.
  • Update the workflow commentary/error messaging to reflect the new “fully pinned” behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/interop.yml Outdated
Comment on lines +53 to +55
echo "deb [check-valid-until=no] https://snapshot.debian.org/archive/debian/${SNAPSHOT}/ trixie main" \
> /etc/apt/sources.list.d/snapshot.list
apt-get -o Acquire::Check-Valid-Until=false update

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: apt-get update runs over HTTPS before ca-certificates is installed

debian:trixie-slim does not ship ca-certificates. The snapshot source is configured with https://, so apt-get update (line 55) must verify the TLS certificate for snapshot.debian.org — but the CA trust store (/etc/ssl/certs/ca-certificates.crt) doesn't exist yet. The step aborts with server certificate verification failed. CAfile: none before it ever reaches the apt-get install that would have provided the certs.

The fix is to use http:// for the snapshot URL. APT's trust comes from the GPG-signed Release file, not TLS, so switching to plain HTTP causes no security regression — the archive is authenticated the same way as any Debian mirror.

Reference: .github/workflows/interop.yml L52–L57

Suggested change
echo "deb [check-valid-until=no] https://snapshot.debian.org/archive/debian/${SNAPSHOT}/ trixie main" \
> /etc/apt/sources.list.d/snapshot.list
apt-get -o Acquire::Check-Valid-Until=false update
echo "deb [check-valid-until=no] http://snapshot.debian.org/archive/debian/${SNAPSHOT}/ trixie main" \
> /etc/apt/sources.list.d/snapshot.list
apt-get -o Acquire::Check-Valid-Until=false update

Comment on lines 62 to +63
ssh -V 2>&1 | grep -qE "OpenSSH_10\.0p[0-9]" \
|| { echo "::error::expected OpenSSH 10.0p line in trixie"; ssh -V; exit 1; }
|| { echo "::error::expected OpenSSH 10.0p line"; ssh -V; exit 1; }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CLAUDE.md violation: ADR-0020 decision contradicted without a superseding ADR

ADR-0020 explicitly records the following decision (line 20):

ssh -V output … must contain OpenSSH_10.0p1

The pinned package (1:10.0p1-7+deb13u4) ships binary OpenSSH_10.0p2, and the regex here was relaxed to OpenSSH_10\.0p[0-9] to match that reality — which is the right operational move. But it means a concrete decision in an Accepted ADR is now contradicted by the implementation.

CLAUDE.md is explicit: "to change a decision, write a superseding ADR." Adding an errata banner to ADR-0020 wouldn't be sufficient here either, because per ADR-0015 errata correct claims that were wrong at acceptance — the original 10.0p1 claim was correct when ADR-0020 was accepted. The upstream version drift is a decision change, not a factual correction.

Suggested remedy: open a short superseding ADR (or an errata-tagged amendment if the maintainer judges this a factual correction rather than a policy change) that records: the pinned package version, the fact that trixie's build ships the 10.0p2 binary, and the relaxed regex policy. The ADR need not be large — it just needs to be the authoritative record.

gonzafg2 added 2 commits July 2, 2026 19:28
First snapshot attempt failed: the trixie-slim base ships no CA bundle,
so apt could not verify snapshot.debian.org over HTTPS and every index
fetch failed. Install ca-certificates from the base image's own index
first (it is a cert bundle, not the client under test), then switch to
the frozen snapshot for curl/gcc/libc6-dev and the pinned openssh-client.

Claude-Session: https://claude.ai/code/session_01BRMdwxsqYQPbjrWB1Cek6o
Signed-off-by: Gonzalo Fleming <[email protected]>
The pinned openssh-client 1:10.0p1-7+deb13u4 is a security update, so it
lives in trixie-security, not trixie main — the snapshot needs both the
debian and debian-security archives at the frozen timestamp.

Claude-Session: https://claude.ai/code/session_01BRMdwxsqYQPbjrWB1Cek6o
Signed-off-by: Gonzalo Fleming <[email protected]>
@opencode-agent

opencode-agent Bot commented Jul 2, 2026

Copy link
Copy Markdown

Here's my review of this PR.

Classification: CI/workflow change

Implements the snapshot-pinning hardening that ADR-0020:20-23 explicitly names as its pinning mechanism. No Rust code changes, no new dependencies, no crypto surface.


Findings

1. ADR-0020 version assertion is out of date (non-blocking)

ADR-0020:20 states ssh -V must contain OpenSSH_10.0p1. The PR correctly relaxes the regex to OpenSSH_10\.0p[0-9] because the pinned package 1:10.0p1-7+deb13u4 ships binary OpenSSH_10.0p2 — but the ADR text now diverges from the code it governs.

Per CLAUDE.md:167-168: "to change a decision, write a superseding ADR." And per ADR-0015:37: errata cover factual corrections to claims that were wrong at acceptance time.

The original 10.0p1 claim was correct when ADR-0020 was accepted, so this is a factual update driven by the pinned snapshot's reality, not a decision reversal. An errata banner on ADR-0020 satisfies both policies without requiring a new ADR — record the snapshot timestamp, the pinned package version, and the relaxed regex. A superseding ADR would also work but is heavy for this scope.

2. check-valid-until=no is set twice (non-blocking)

Set in the sources.list option on line 60 and via apt-get -o Acquire::Check-Valid-Until=false on line 62. The redundancy doesn't hurt — either mechanism alone handles archived Release files past Valid-Until. No security impact.


On prior review findings

Claude review finding #1 (HTTPS before ca-certificates): False positive. The second commit (123d0dc) installs ca-certificates from the base image's (digest-pinned) sources before switching to the snapshot HTTPS source (lines 53-54 vs 59-62). The review targeted the first commit that didn't have this step; the current code is correct.

Claude review finding #2 (ADR-0020 contradiction): Agreed in substance, but errata-appropriate, not a superseding-ADR case. See finding #1 above.


Verdict

No supply-chain, permission, or cryptographic concerns. The snapshot + digest + exact-version triplet forms a complete reproducibility chain. The ADR-0020 errata is the only loose end — address it in this PR (or a follow-up) and this is ready to merge.

github run

@opencode-agent

opencode-agent Bot commented Jul 2, 2026

Copy link
Copy Markdown

I've reviewed the PR against CLAUDE.md, the threat model, and the MANIFIESTO commitments. Here's my review:


Classification: CI/workflow change

Findings

1. ADR-0020 is now factually stale (high-signal)

ADR-0020 line 20 states:

ssh -V output … must contain OpenSSH_10.0p1

The pinned package 1:10.0p1-7+deb13u4 ships binary OpenSSH_10.0p2, and the workflow's version assertion was relaxed to OpenSSH_10\.0p[0-9] to match. This contradicts a concrete claim in an Accepted ADR.

CLAUDE.md:167: "Do not edit an accepted ADR in place … to change a decision, write a superseding ADR." ADR-0015 permits errata only for claims that were wrong at acceptance time — the 10.0p1 claim was true when ADR-0020 was accepted. The version drift is a downstream fact change, not a factual error in the ADR.

That said, the ADR's core decision was about pinning, not about the specific version substring. The distinction between a superseding ADR vs. an errata annotation is debatable here since the normative requirement was reproducibility through pinning (which this PR fulfills), not the 10.0p1 identifier. A terse errata banner noting "package 1:10.0p1-7+deb13u4 ships binary OpenSSH_10.0p2; version assertion relaxed accordingly" would likely suffice and avoids the overhead of a full superseding ADR for what is essentially an upstream fact change downstream of the decision.

Recommendation: add an errata to ADR-0020 per ADR-0015, or a one-line superseding ADR. This is a governance blocking issue — CLAUDE.md is clear that an accepted ADR's concrete claims must match the code.

2. Non-blocking: redundant check-valid-until=no (low-signal)

The check-valid-until=no flag is set in both the deb lines (line 63-64) and via apt-get -o Acquire::Check-Valid-Until=false (line 66). One mechanism is sufficient; the double-disable is harmless noise.

3. Supply-chain posture (positive)

The container image is pinned by digest, the APT sources are frozen to a snapshot.debian.org timestamp, the package is pinned to an exact version (1:10.0p1-7+deb13u4), and dpkg-query fails closed on version drift. This forms a complete reproducibility chain with no silent-drift escape — exactly the property threat model §5.5.2.a/b requires and ADR-0020:22-23 mandates. The permissions are minimal (contents: read), and the change introduces no new actions or dependencies. No MANIFIESTO violation.

4. Claude's HTTPS finding is addressed (no longer present)

Claude correctly identified that apt-get update against https://snapshot.debian.org requires ca-certificates. The PR's second commit (123d0dc) installs ca-certificates from the digest-pinned base image's live sources before switching APT to the HTTPS snapshot, so the ordering is safe. No action needed.


Verdict

One blocking finding: ADR-0020's claim that ssh -V must contain OpenSSH_10.0p1 needs to be brought in sync with the implementation (errata or superseding ADR). Everything else is sound, fully implements the hardening ADR-0020 already decided, and aligns with the threat model's fail-closed posture.

github run

deb13u4 lands in trixie-updates (same debian archive), not a separate
debian-security snapshot. Point the snapshot sources at trixie +
trixie-updates so the pinned version resolves.

Claude-Session: https://claude.ai/code/session_01BRMdwxsqYQPbjrWB1Cek6o
Signed-off-by: Gonzalo Fleming <[email protected]>
@opencode-agent

opencode-agent Bot commented Jul 2, 2026

Copy link
Copy Markdown

Review: CI/workflow change

Implements the snapshot-pinning hardening that ADR-0020:20-23 explicitly names. No Rust code, no new dependencies, no crypto surface.


Finding 1: ADR-0020 ssh -V claim is now stale (blocking)

ADR-0020:20 states:

ssh -V output … must contain OpenSSH_10.0p1

The pinned package 1:10.0p1-7+deb13u4 ships binary OpenSSH_10.0p2, and the workflow's regex was relaxed to OpenSSH_10\.0p[0-9] (line 74). The ADR text and the implementation diverge.

CLAUDE.md:166: "Do not edit an accepted ADR in place except its Status field or annotated errata" — and ADR-0015:34-36: "Errata are for 'we said X but X is incorrect'; supersession is for 'we decided X, now we decide Y.'"

This is an erratum case, not a superseding-ADR case. The ADR's decision was about pinning as the strategy (line 22) and making version bumps reviewed events — that decision hasn't changed, the PR implements it. The OpenSSH_10.0p1 claim was correct at acceptance time (2026-06-30); it became stale because the pinned snapshot's package ships p2. The ADR itself anticipated this exact scenario (line 33: "OpenSSH upgrades become visible, reviewed decisions").

An erratum banner per ADR-0015 should record: the pinned package (1:10.0p1-7+deb13u4), the binary it ships (OpenSSH_10.0p2), and the relaxed regex. This is a governance consistency issue — the code change is correct, but the ADR text must stay in sync.

Finding 2: Redundant check-valid-until=no (non-blocking)

Set in the sources.list lines (64-65) and via apt-get -o Acquire::Check-Valid-Until=false (line 67). Either mechanism alone handles archived Release files past Valid-Until. Harmless noise.

Supply-chain posture (positive)

The container is digest-pinned, APT sources frozen to a snapshot.debian.org timestamp, the package pinned to exact version (1:10.0p1-7+deb13u4), and dpkg-query fails closed on version drift. This forms a complete reproducibility chain (threat model §5.5.2.a/b, ADR-0020:22-23). Permissions are minimal (contents: read), no new actions or dependencies. No MANIFIESTO violations.

Previously-flagged issues (resolved)

  • ca-certificates before HTTPS — commit 123d0dc installs ca-certificates from the digest-pinned base image's sources before switching to the HTTPS snapshot. Correct ordering.
  • trixie-updates archive for deb13u4 — commit ae19b22 adds the correct archive for the deb13uN security update. No debian-security fake; the snapshot API reports it in the debian archive's *-updates suite.

Verdict: One blocking finding — ADR-0020 needs an erratum banner. The code change is sound and fully implements the pinning decision ADR-0020 already made.

github run

@claude

claude Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

Comment on lines +63 to +66
{
echo "deb [check-valid-until=no] https://snapshot.debian.org/archive/debian/${SNAPSHOT}/ trixie main"
echo "deb [check-valid-until=no] https://snapshot.debian.org/archive/debian/${SNAPSHOT}/ trixie-updates main"
} > /etc/apt/sources.list.d/snapshot.list

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The interop job fails here in ~14 seconds because openssh-client=1:10.0p1-7+deb13u4 cannot be resolved from the configured snapshot sources.

The +deb13u4 version suffix identifies a Debian security-archive build. On snapshot.debian.org the security archive lives at a separate path — archive/debian-security/ — distinct from the main archive at archive/debian/. The snapshot source list here only configures archive/debian/ (trixie + trixie-updates), so apt cannot find the pinned version and exits immediately with "Version '1:10.0p1-7+deb13u4' for 'openssh-client' was not found".

The comment on lines 60–62 ("the deb13uN openssh-client update lands in trixie-updates … in the debian archive, not debian-security") describes the expected state but contradicts the actual CI outcome. The fix is to add the frozen debian-security snapshot source alongside the existing ones — and update that comment accordingly.

Reference: docs/adr/0020-phase-1-ci-openssh-interop-gate.md (exact-version pin rationale); relevant lines:

# trixie + trixie-updates from the debian archive: the deb13uN
# openssh-client update lands in trixie-updates (snapshot API
# reports it in the `debian` archive, not debian-security).
{
echo "deb [check-valid-until=no] https://snapshot.debian.org/archive/debian/${SNAPSHOT}/ trixie main"
echo "deb [check-valid-until=no] https://snapshot.debian.org/archive/debian/${SNAPSHOT}/ trixie-updates main"
} > /etc/apt/sources.list.d/snapshot.list
apt-get -o Acquire::Check-Valid-Until=false update

Suggested change
{
echo "deb [check-valid-until=no] https://snapshot.debian.org/archive/debian/${SNAPSHOT}/ trixie main"
echo "deb [check-valid-until=no] https://snapshot.debian.org/archive/debian/${SNAPSHOT}/ trixie-updates main"
} > /etc/apt/sources.list.d/snapshot.list
{
echo "deb [check-valid-until=no] https://snapshot.debian.org/archive/debian/${SNAPSHOT}/ trixie main"
echo "deb [check-valid-until=no] https://snapshot.debian.org/archive/debian/${SNAPSHOT}/ trixie-updates main"
echo "deb [check-valid-until=no] https://snapshot.debian.org/archive/debian-security/${SNAPSHOT}/ trixie-security main"
} > /etc/apt/sources.list.d/snapshot.list

Comment thread .github/workflows/interop.yml Outdated
Comment on lines +60 to +66
# trixie + trixie-updates from the debian archive: the deb13uN
# openssh-client update lands in trixie-updates (snapshot API
# reports it in the `debian` archive, not debian-security).
{
echo "deb [check-valid-until=no] https://snapshot.debian.org/archive/debian/${SNAPSHOT}/ trixie main"
echo "deb [check-valid-until=no] https://snapshot.debian.org/archive/debian/${SNAPSHOT}/ trixie-updates main"
} > /etc/apt/sources.list.d/snapshot.list

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The openssh-interop required gate is failing at this commit (ae19b22). The root cause is this sources block: openssh-client=1:10.0p1-7+deb13u4 carries a +deb13u4 suffix, which marks it as a Debian security update published to the trixie-security suite of the debian-security archive — not to trixie-updates in the debian main archive. With only the debian archive sources present, apt cannot resolve the pinned version and the install fails.

ADR-0020 designates this gate as a required check for merging to main. CLAUDE.md also requires: "everything committed must be functional."

The debian-security snapshot source is the correct approach — it was present in an earlier iteration of this PR. Replace this block with:

Suggested change
# trixie + trixie-updates from the debian archive: the deb13uN
# openssh-client update lands in trixie-updates (snapshot API
# reports it in the `debian` archive, not debian-security).
{
echo "deb [check-valid-until=no] https://snapshot.debian.org/archive/debian/${SNAPSHOT}/ trixie main"
echo "deb [check-valid-until=no] https://snapshot.debian.org/archive/debian/${SNAPSHOT}/ trixie-updates main"
} > /etc/apt/sources.list.d/snapshot.list
# main + security: the deb13uN openssh-client is a security update
# (trixie-security), so both snapshot archives are needed.
{
echo "deb [check-valid-until=no] https://snapshot.debian.org/archive/debian/${SNAPSHOT}/ trixie main"
echo "deb [check-valid-until=no] https://snapshot.debian.org/archive/debian-security/${SNAPSHOT}/ trixie-security main"
} > /etc/apt/sources.list.d/snapshot.list

Reference:

rm -f /etc/apt/sources.list.d/debian.sources
# trixie + trixie-updates from the debian archive: the deb13uN
# openssh-client update lands in trixie-updates (snapshot API
# reports it in the `debian` archive, not debian-security).
{
echo "deb [check-valid-until=no] https://snapshot.debian.org/archive/debian/${SNAPSHOT}/ trixie main"
echo "deb [check-valid-until=no] https://snapshot.debian.org/archive/debian/${SNAPSHOT}/ trixie-updates main"
} > /etc/apt/sources.list.d/snapshot.list
apt-get -o Acquire::Check-Valid-Until=false update

gonzafg2 added 2 commits July 2, 2026 23:09
Simplify the ADR-0020 snapshot hardening: freeze to a snapshot.debian.org
timestamp and take trixie main's openssh-client as-is, instead of pinning
the exact security-update revision (deb13u4), which lives across snapshot
suites and proved a moving target to resolve. The gate needs a fixed,
reproducible OpenSSH 10.x — which the frozen snapshot guarantees — not the
newest revision. The resolved version is logged for the audit trail and
asserted to the 10.0p line; bumping SNAPSHOT is the reviewed event.

Claude-Session: https://claude.ai/code/session_01BRMdwxsqYQPbjrWB1Cek6o
Signed-off-by: Gonzalo Fleming <[email protected]>
…kages

The digest-pinned base already carries updated revisions (libc6 deb13u3),
so pulling only trixie main from the snapshot conflicted (libc6-dev
deb13u2 vs installed libc6 deb13u3). Add trixie-updates from the same
snapshot so the updated revisions are available and openssh-client
resolves to the current one — no exact-version pin (the frozen snapshot
is the pin).

Claude-Session: https://claude.ai/code/session_01BRMdwxsqYQPbjrWB1Cek6o
Signed-off-by: Gonzalo Fleming <[email protected]>
@opencode-agent

opencode-agent Bot commented Jul 3, 2026

Copy link
Copy Markdown

Review: CI/workflow change

Implements the snapshot-pinning hardening ADR-0020:20-23 explicitly names. No Rust code changes, no new dependencies, no crypto surface.


Finding 1: ADR-0020 ssh -V claim is now stale (blocking, governance)

ADR-0020:20 states ssh -V output must contain OpenSSH_10.0p1. The code (both before and after this PR) asserts OpenSSH_10\.0p[0-9] (interop.yml:69) — matching p2+ as well as p1. The ADR text and the implementation diverge.

CLAUDE.md:165-167: "Do not edit an accepted ADR in place except its Status field or annotated errata … to change a decision, write a superseding ADR." ADR-0015:34-36: "Errata are for 'we said X but X is incorrect'; supersession is for 'we decided X, now we decide Y.'"

This is an erratum case, not a superseding-ADR case. The OpenSSH_10.0p1 claim was correct at acceptance (2026-06-30); it became stale because trixie's package 1:10.0p1-7+deb13u4 ships binary OpenSSH_10.0p2. The ADR's decision was about pinning as the strategy — that hasn't changed, this PR implements it. The ADR even anticipated this exact scenario (ADR-0020:33: "OpenSSH upgrades become visible, reviewed decisions").

Remedy: Add an errata banner to ADR-0020 per ADR-0015 recording: the pinned package (1:10.0p1-7+deb13u4), the binary it ships (OpenSSH_10.0p2), the snapshot timestamp (20260507T000000Z), and the relaxed regex. All four prior reviewers flagged this; it remains unaddressed.


Finding 2: dpkg-query logs but doesn't assert the resolved version (non-blocking)

The dpkg-query output is audit-only (interop.yml:67) — no grep -qFx follows it. The only automated assertion is ssh -V | grep -qE "OpenSSH_10\.0p[0-9]", which passes for any 10.0p* variant.

The snapshot timestamp provides deterministic version pinning (same timestamp → same package), so reproducibility is achieved. But the fail-closed property ADR-0020:22 describes — "an upstream OpenSSH change … surfaces as a reviewed event, not as a mystery red check" — relies on a human noticing the logged version during SNAPSHOT bumps. Adding a dpkg-query … | grep -qFx "1:10.0p1-7+deb13u4" after the log line would make it an automated gate instead of a manual review burden. The last commit message (72f2876) correctly admits the version assertion was dropped in favour of snapshot-only pinning; the PR description still claims it exists.


Finding 3: Redundant check-valid-until=no (non-blocking)

Set in the sources.list line (interop.yml:60) and via apt-get -o Acquire::Check-Valid-Until=false (interop.yml:62). Either mechanism alone handles archived Release files past Valid-Until. Harmless noise.


Supply-chain posture (positive)

Container image pinned by digest, APT sources frozen to snapshot.debian.org timestamp, dpkg-query surfaces the version in CI logs. Together with the ssh -V assertion that catches major version jumps, this forms a strong reproducibility chain. Permissions are minimal (contents: read), no new actions or dependencies introduced. §5.5.2.a/b properties are preserved.


On prior review findings

  • ca-certificates before HTTPS — Fixed in commit 123d0dc. The base image's sources are used before switching to the HTTPS snapshot. Correct ordering.
  • Which archive serves deb13u4 — The commit history shows the PR iterated through debian-security (a32415a), trixie-updates (ae19b22), and finally trixie main only (72f2876). The final simplification drops explicit security-update chasing — the gate just needs any reproducible OpenSSH 10.x, not the newest revision. The commit message for 72f2876 documents this choice clearly; the PR description still references the earlier approach.

Verdict: One blocking finding — ADR-0020 needs an errata banner. The code change is sound, the snapshot timestamp provides deterministic reproducibility, and the PR's operational intent (frozen, reproducible interop client) is correct. Address the errata and this is ready to merge.

github run

@gonzafg2

gonzafg2 commented Jul 3, 2026

Copy link
Copy Markdown
Owner Author

Closing without merge — the snapshot version-pin doesn't compose with the current gate design.

What was learned (6 CI iterations):

  1. TLS to snapshot.debian.org failed until ca-certificates was installed first (slim base ships none) — fixed.
  2. The real blocker is temporal misalignment between the digest-pinned base image and the snapshot: debian@sha256:28de0877… already carries updated revisions (e.g. libc6 2.41-12+deb13u3) that the 20260507 snapshot (main + updates) does not have (libc6-dev there depends on = deb13u2), so mixing the two yields unsatisfiable dependencies.

Correct approach (a real follow-up, not a tweak): don't mix a newer digest-pinned base with an older snapshot. Either build the container FROM the snapshot (a small Dockerfile with all packages from one frozen timestamp) so base and packages are consistent, or align the snapshot timestamp to the base image's build date. Both are more than the "one apt tweak" this looked like.

The gate on main is unchanged and green (digest pin + ssh -V assert on the 10.0p line), which already gives reasonable reproducibility. Leaving the exact-version snapshot pin as a properly-scoped follow-up on ADR-0020.

@gonzafg2 gonzafg2 closed this Jul 3, 2026
@opencode-agent

opencode-agent Bot commented Jul 3, 2026

Copy link
Copy Markdown

Now I have the complete picture. Here's my review.


Classification: CI/workflow change

Summary

Adds ADR-0020's snapshot.debian.org freeze (the hardening ADR-0020 already named) to the interop gate. Six commits across iterative refinement. No Rust code, no new dependencies, no crypto surface.

The first commit (4020622) implemented both the snapshot freeze AND the explicit <version> pin ADR-0020:19 requires. Commit 72f2876 then removed the explicit version pin, replacing it with snapshot-only resolution plus a logged-but-not-asserted dpkg-query. The ssh -V assertion was already relaxed to 10.0p[0-9] on main before this PR.


Findings

1. ADR-0020 explicit version pin was committed then retracted (high-signal, governance)

ADR-0020:19:

openssh-client is installed with an explicit version (apt-get install openssh-client=<version>) from a frozen source

Commit 4020622 correctly implemented this — OPENSSH_VERSION='1:10.0p1-7+deb13u4', apt-get install ... "openssh-client=${OPENSSH_VERSION}", plus a dpkg-query | grep -Fqx fail-closed assertion. This matched the ADR's stated mechanism end-to-end.

Commit 72f2876 then removed the version pin and the assertion, leaving only the snapshot freeze. The commit message describes this as a deliberate simplification: "take trixie main's openssh-client as-is, instead of pinning the exact security-update revision (deb13u4), which lived across snapshot suites."

This is a decision-level deviation from ADR-0020. The snapshot freeze alone is deterministic (same timestamp → same package), so the function is equivalent, but the ADR's explicitly named mechanism (=<version>) is absent from the landed code. CLAUDE.md:165-167:

"to change a decision, write a superseding ADR."

And ADR-0015: "Errata are for 'we said X but X is incorrect'; supersession is for 'we decided X, now we decide Y.'"

Resolution paths:

  • If the maintainer intends snapshot-only as the final approach: record this in ADR-0020 via errata (since the ADR's goal — reproducibility — is satisfied, and the <version> was the means, not the end). Document: the snapshot at 20260507T000000Z resolves to 1:10.0p1-7+deb13u4 (binary 10.0p2), the pin is implicit in the frozen timestamp, and the ssh -V assert is 10.0p[0-9].
  • If ADR-0020:19 stands as written: restore the explicit <version> pin and dpkg-query | grep assertion.

2. ADR-0020 ssh -V assertion text is stale (governance, pre-existing debt)

ADR-0020:20 states ssh -V must contain OpenSSH_10.0p1. The code (both main and this PR) uses OpenSSH_10\.0p[0-9]. The pinned package ships binary 10.0p2. This predates this PR, but the PR title is the right vehicle to add the errata banner while the file is already being touched. Per ADR-0015, this is an erratum (claim was correct at acceptance time; an upstream fact changed it).

3. PR description claims code that isn't present (non-blocking)

The body says:

Pins openssh-client=1:10.0p1-7+deb13u4 ... Asserts the resolved version fail-closed

The code does neither. The dpkg-query line is a echo (informational only), and apt-get install openssh-client has no =<version>. The description should match what was landed.

4. check-valid-until=no is set twice (non-blocking)

Set in the sources.list deb lines (64-65) and via apt-get -o Acquire::Check-Valid-Until=false (line 68). One mechanism handles archived Release files. Harmless.

5. Supply-chain posture (positive)

Container pinned by digest, APT sources frozen to snapshot.debian.org at 20260507T000000Z, version assert fail-closed via ssh -V regex. Forms a complete reproducibility chain matching the property ADR-0020:22-23 was designed for. Permissions are minimal (contents: read). No MANIFIESTO violations. The ca-certificates→HTTPS ordering is correct (lines 54-55 install from the digest-pinned base before the snapshot switch on line 67).


Verdict

Two governance items to resolve before merge:

  1. Align ADR-0020 with the mechanism that was actually landed — either restore the explicit <version> pin (if ADR-0020:19 stands), or add an errata recording the snapshot-only approach (if the maintainer accepts commit 72f2876's rationale).
  2. Add an errata banner to ADR-0020 for the 10.0p1 → 10.0p[0-9] relaxation (pre-existing debt; clean it up in this PR).

The code change is functionally sound — the snapshot freeze provides the deterministic reproducibility ADR-0020 requires — but the ADR text and the code must tell the same story.

github run

@gonzafg2
gonzafg2 deleted the ci/openssh-snapshot-version-pin branch July 18, 2026 04:22
gonzafg2 added a commit that referenced this pull request Sep 23, 2026
…rom (ADR-0034)

Implements the package-version pin ADR-0020 decided and #84 left out.
The digest-pinned image (debian:trixie-20260623-slim) records in its
own debian.sources the snapshot.debian.org timestamp it was built
from; apt now reads from that timestamp, installs
openssh-client=1:10.0p1-7+deb13u4 with the build prerequisites, and
the job asserts the exact `ssh -V` string, OpenSSL build included.
The step checks that SNAPSHOT matches the image before apt runs.

#98 failed by pointing apt at a snapshot older than the image (its
libc6 was already newer than the archive). Reproduced locally in the
same image on 2026-09-22: the build timestamp installs with no libc6
change; later timestamps install the same package but move libc6 and
OpenSSL under it; earlier ones cannot resolve libc6-dev. Timestamp and
version pin together, and the timestamp is read from the image.

http rather than https because the slim image has no CA bundle and
apt verifies the Release signatures anyway; Check-Valid-Until off
because the archived trixie-updates/-security Release files are past
their validity window. ADR-0034 records the mechanism and the bump
procedure; ADR-0020's Status line points at it.

Claude-Session: https://claude.ai/code/session_018UmL9wcgKBGFjdjGSSLafa
Signed-off-by: Gonzalo Fleming <[email protected]>
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