GeezerVison is showing github.com — fix(images): package main diagnostic and verify compiled source prove… · arencloud/unf@98ca1a7
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: .containerignore +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -14,6 +14,7 @@ target/ | 14 | 14 | ebpf/unf-ebpf-tc/target/ | 15 | 15 | docs/ | 16 | 16 | hack/* | | 17 | +!hack/verify-main-locality-bridge.sh | 17 | 18 | !hack/verify-cni-workload-ownership.sh | 18 | 19 | !hack/verify-local-delivery-device-lifetime.sh | 19 | 20 | !hack/local-delivery-device-gate.jq | |
Collapse file Copy file name to clipboardExpand all lines: bins/unf-agent/src/main.rs +12Lines changed: 12 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -20158,6 +20158,18 @@ mod tests { | 20158 | 20158 | .expect("construct test controller client") | 20159 | 20159 | } | 20160 | 20160 |
| | 20161 | + #[test] | | 20162 | + #[ignore = "requires exact expected source revision from immutable diagnostic gate"] | | 20163 | + fn diagnostic_build_revision_matches_source() { | | 20164 | + let expected = | | 20165 | + std::env::var("UNF_EXPECT_BUILD_REVISION").expect("explicit expected source revision"); | | 20166 | + assert!(expected.len() == 40 && expected.bytes().all(|byte| byte.is_ascii_hexdigit())); | | 20167 | + assert_eq!( | | 20168 | + BUILD_REVISION, expected, | | 20169 | + "compiled source revision differs from immutable diagnostic provenance" | | 20170 | + ); | | 20171 | + } | | 20172 | + | 20161 | 20173 | #[tokio::test] | 20162 | 20174 | async fn unexpected_task_panic_is_a_supervised_failure() { | 20163 | 20175 | let mut tasks = JoinSet::new(); | |
Collapse file Copy file name to clipboard +30Lines changed: 30 additions & 0 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +# ADR 0433: Main diagnostic packaging and compiled provenance | | 2 | + | | 3 | +Date: 2026-09-21 | | 4 | + | | 5 | +Status: packaging repair implemented; rebuilt platform gate pending | | 6 | + | | 7 | +The `843d810` main-program diagnostic build failed at its final script COPY: | | 8 | +`.containerignore` excluded the new script. No image was published and no | | 9 | +platform test or runtime rollout used that attempt. The failure is retained in | | 10 | +`.artifacts/p9-main-locality-843d810-build.log`. The allowlist now includes the | | 11 | +exact script **after** the general `hack/*` exclusion. | | 12 | + | | 13 | +Review also found an old revision in a reused intermediate builder layer's | | 14 | +configuration metadata. Direct inspection of the resulting `5f03031` startup | | 15 | +binary instead found the correct full `5f030319526bb534bf73c64cac1b04378907a972` | | 16 | +revision, not that old value. Thus there is no demonstrated mislabeled binary | | 17 | +and ADR 0431's behavioral results remain valid. Intermediate metadata is not | | 18 | +sufficient evidence of the compiler's effective environment. | | 19 | + | | 20 | +The production and diagnostic build commands now explicitly export the revision | | 21 | +from the distinct source ARG in the same RUN as compilation. The main diagnostic | | 22 | +also runs an exact test comparing the compiled `BUILD_REVISION` with an externally | | 23 | +provided full source revision. The gate requires that value, supplies it to the | | 24 | +Pod and records it in evidence. Five exact tests must execute, including that | | 25 | +positive provenance assertion; an empty filtered test list cannot pass. | | 26 | + | | 27 | +Local test compilation, strict agent all-target Clippy and shell syntax checks | | 28 | +are required. The rebuilt immutable main-program gate must still pass cl02 first, | | 29 | +then matching Kind. Pending reverse-Service edits are separate from this repair | | 30 | +and must not enter its source/ELF provenance. No production state changed. |
Collapse file Copy file name to clipboardExpand all lines: docs/development/phase9-attested-encryption-fabric-plan.md +3Lines changed: 3 additions & 0 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -74,6 +74,9 @@ Production state is unchanged; full runtime and L3/L4/L5/Q remain open. | 74 | 74 | ADR 0432 implements the policy-first forward bridge and dedicated continuation | 75 | 75 | loading. Actual-main kernel qualification, reverse-Service composition, full | 76 | 76 | publisher/writer delivery and restart continuity remain pending; no live rollout. | | 77 | +ADR 0433 repairs the diagnostic script allowlist after a pre-deployment build | | 78 | +failure and requires exact compiled source evidence. The main-program gate and | | 79 | +full Phase 9 closure remain pending. | 77 | 80 | ADRs 0381–0382 | 78 | 81 | qualify the isolated joint attachment/route observation on cl02 then Kind; | 79 | 82 | ADR 0383 verifies stale-safe journal cuts locally. ADR 0384 implements the | |
Collapse file Copy file name to clipboardExpand all lines: docs/development/phase9-required-locality-plan.md +3Lines changed: 3 additions & 0 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -166,6 +166,9 @@ ADR 0432 adds the actual policy-first forward bridge and four dedicated | 166 | 166 | continuations, including local DSR NAT revalidation and ordinary missing-bank | 167 | 167 | fallback. Its real-main verifier/TestRun gate must pass cl02 before Kind. | 168 | 168 | Reverse-Service composition and complete live delivery remain open; no rollout. | | 169 | +ADR 0433 retains the main diagnostic's pre-deployment COPY/allowlist failure and | | 170 | +adds an exact compiled-revision assertion. Rebuild and cl02-first validation | | 171 | +remain required; intermediate layer metadata is not binary provenance. | 169 | 172 |
| 170 | 173 | ## Safety and efficiency boundary | 171 | 174 |
| |
Collapse file Copy file name to clipboardExpand all lines: docs/project-status.md +3Lines changed: 3 additions & 0 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -970,6 +970,9 @@ ADR 0432 adds policy-first forward dispatch to the sealed bank, ordinary | 970 | 970 | encryption fallback and separate DSR NAT/revalidation continuations. Local | 971 | 971 | checks pass; actual-main cl02-before-Kind kernel checks, reverse-Service | 972 | 972 | composition and full runtime delivery/recovery remain open. No rollout occurs. | | 973 | +ADR 0433 retains the failed diagnostic packaging attempt, repairs its allowlist | | 974 | +and adds a compiled-revision assertion. No incorrect resulting binary revision | | 975 | +was demonstrated; rebuilt main-program cl02-before-Kind validation remains next. | 973 | 976 | ADR 0338 closes the staging guard's init-container failure/restart gap before | 974 | 977 | the matching Kind rollout; no live image changes occur in that metadata slice. | 975 | 978 | Required locality/replica coverage, full lifecycle requalification and S1–S5 | |
Collapse file Copy file name to clipboardExpand all lines: hack/verify-locality-incarnation-gate.sh +12-5Lines changed: 12 additions & 5 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -18,8 +18,10 @@ deadline_seconds=180 | 18 | 18 | poll_attempts=100 | 19 | 19 | case $suite in | 20 | 20 | kernel-main-bridge) | | 21 | + : "${UNF_LOCALITY_GATE_SOURCE_REVISION:?exact expected compiled source revision}" | | 22 | + [[ $UNF_LOCALITY_GATE_SOURCE_REVISION =~ ^[0-9a-f]{40}$ ]] | 21 | 23 | test_command='["env","UNF_MAIN_LOCALITY_ISOLATED_CONTAINER=yes","bash","/usr/local/bin/verify-main-locality-bridge"]' | 22 | | - marker='main-locality-suite: PASS tests=4 actual-main=true missing-bank-fallback=true live-attachment=false bank-delivery=false$' | | 24 | + marker='main-locality-suite: PASS tests=5 compiled-source=true actual-main=true missing-bank-fallback=true live-attachment=false bank-delivery=false$' | 23 | 25 | memory_limit=2Gi | 24 | 26 | cpu_limit=2 | 25 | 27 | deadline_seconds=300 | @@ -95,8 +97,8 @@ cleanup() { | 95 | 97 | rg -q "$marker" "$directory/test.log" || result=1 | 96 | 98 | fi | 97 | 99 | if [[ $suite == kernel-main-bridge ]]; then | 98 | | - [[ $(rg -c 'main-locality-check: name=.* passed=true$' "$directory/test.log") == 4 ]] || result=1 | 99 | | - [[ $(rg -c 'test result: ok\. 1 passed; 0 failed; 0 ignored;' "$directory/test.log") == 4 ]] || result=1 | | 100 | + [[ $(rg -c 'main-locality-check: name=.* passed=true$' "$directory/test.log") == 5 ]] || result=1 | | 101 | + [[ $(rg -c 'test result: ok\. 1 passed; 0 failed; 0 ignored;' "$directory/test.log") == 5 ]] || result=1 | 100 | 102 | fi | 101 | 103 | if [[ $suite == kernel-delivery || $suite == kernel-admission || $suite == kernel-journal-floor || $suite == kernel-runtime-owner || $suite == kernel-agent-startup ]]; then | 102 | 104 | if rg -q 'kernel-locality-delivery: PASS allowed=8 denied=16 protocols=tcp,udp families=4,6 request-bank=true reply-native=true production-policy=false$' "$directory/test.log" && | @@ -119,8 +121,9 @@ cleanup() { | 119 | 121 | rg -q 'observed-locality-mixed-mtu: PASS source=1400 target=1450 uniform-mismatch-rejected=true$' "$directory/test.log" || result=1 | 120 | 122 | rg -q 'kernel-locality-agent-startup: PASS actual-agent=true early-owner=true real-journal-floor=5 armed-reopen-withdrawn=true partial-rejected=true missing-same-boot-rejected=true client-error-supervised=true bytes-preserved=true packet-attachment=false cleanup=true$' "$directory/test.log" || result=1 | 121 | 123 | fi | 122 | | - jq -n --argjson code "$result" --argjson removed "$removed" --argjson delivery "$delivery" --arg platform "$UNF_LOCALITY_GATE_PLATFORM" --arg suite "$suite" --arg image "$image" --arg node "$UNF_LOCALITY_GATE_NODE" --arg uid "$UNF_LOCALITY_GATE_NODE_UID" --arg ns "$namespace" --arg nsuid "$namespace_uid" \ | 123 | | - '{schemaVersion:2,result:(if $code==0 then "passed" else "failed" end),platform:$platform,suite:$suite,image:$image,node:$node,nodeUid:$uid,namespace:$ns,namespaceUid:$nsuid,cleanup:$removed,packetDeliveryTested:$delivery}' > "$directory/evidence.json" | | 124 | + jq -n --argjson code "$result" --argjson removed "$removed" --argjson delivery "$delivery" --arg platform "$UNF_LOCALITY_GATE_PLATFORM" --arg suite "$suite" --arg image "$image" --arg node "$UNF_LOCALITY_GATE_NODE" --arg uid "$UNF_LOCALITY_GATE_NODE_UID" --arg ns "$namespace" --arg nsuid "$namespace_uid" --arg source "${UNF_LOCALITY_GATE_SOURCE_REVISION:-}" \ | | 125 | + '{schemaVersion:2,result:(if $code==0 then "passed" else "failed" end),platform:$platform,suite:$suite,image:$image,node:$node,nodeUid:$uid,namespace:$ns,namespaceUid:$nsuid,cleanup:$removed,packetDeliveryTested:$delivery} | | 126 | + + (if $suite=="kernel-main-bridge" then {expectedCompiledSourceRevision:$source} else {} end)' > "$directory/evidence.json" | 124 | 127 | printf 'Incarnation gate result=%s evidence=%s\n' "$result" "$directory" | 125 | 128 | exit "$result" | 126 | 129 | } | @@ -132,6 +135,10 @@ if [[ $UNF_LOCALITY_GATE_PLATFORM == cl02 ]]; then | 132 | 135 | "${kc[@]}" -n "$namespace" create rolebinding gate-privileged --clusterrole=system:openshift:scc:privileged --serviceaccount="$namespace:default" >/dev/null | 133 | 136 | fi | 134 | 137 | jq -n --arg ns "$namespace" --arg node "$UNF_LOCALITY_GATE_NODE" --arg image "$image" --argjson command "$test_command" --arg memory "$memory_limit" --arg cpu "$cpu_limit" --argjson deadline "$deadline_seconds" '{apiVersion:"v1",kind:"Pod",metadata:{name:"gate",namespace:$ns},spec:{nodeName:$node,hostNetwork:true,automountServiceAccountToken:false,restartPolicy:"Never",activeDeadlineSeconds:$deadline,containers:[{name:"gate",image:$image,imagePullPolicy:"IfNotPresent",securityContext:{privileged:true,runAsUser:0},resources:{requests:{cpu:"100m",memory:"64Mi"},limits:{cpu:$cpu,memory:$memory}},env:[{name:"UNF_LOCALITY_GATE_ISOLATED_CONTAINER",value:"yes"},{name:"UNF_OBSERVED_BANK_ISOLATED_CONTAINER",value:"yes"}],command:$command}]}}' > "$directory/pod.json" | | 138 | +if [[ $suite == kernel-main-bridge ]]; then | | 139 | + jq --arg source "$UNF_LOCALITY_GATE_SOURCE_REVISION" '.spec.containers[0].env += [{name:"UNF_EXPECT_BUILD_REVISION",value:$source}]' "$directory/pod.json" > "$directory/pod-source.json" | | 140 | + mv "$directory/pod-source.json" "$directory/pod.json" | | 141 | +fi | 135 | 142 | "${kc[@]}" create -f "$directory/pod.json" >/dev/null | 136 | 143 | finished=false | 137 | 144 | for _ in $(seq 1 "$poll_attempts"); do | |
Collapse file Copy file name to clipboardExpand all lines: hack/verify-main-locality-bridge.sh +3-1Lines changed: 3 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 3 | 3 | set -Eeuo pipefail | 4 | 4 | [[ ${UNF_MAIN_LOCALITY_ISOLATED_CONTAINER:-} == yes && $EUID == 0 ]] | 5 | 5 | export UNF_EBPF_OBJECT=/usr/local/lib/unf/main-locality-test | | 6 | +[[ ${UNF_EXPECT_BUILD_REVISION:-} =~ ^[0-9a-f]{40}$ ]] | 6 | 7 | output=$(mktemp /tmp/unf-main-locality.XXXXXX) | 7 | 8 | trap 'rm -f -- "$output"' EXIT | 8 | 9 | for name in \ | | 10 | + diagnostic_build_revision_matches_source \ | 9 | 11 | privileged_encryption_finalizer_is_dual_stack_late_bound_and_fail_closed \ | 10 | 12 | privileged_locality_bridge_missing_bank_keeps_exact_encryption_and_marks \ | 11 | 13 | privileged_egress_source_steering_is_policy_first_destination_exact_and_dual_stack \ | @@ -14,4 +16,4 @@ for name in \ | 14 | 16 | grep -Eq '^test result: ok\. 1 passed; 0 failed; 0 ignored;' "$output" | 15 | 17 | printf 'main-locality-check: name=%s passed=true\n' "$name" | 16 | 18 | done | 17 | | -printf 'main-locality-suite: PASS tests=4 actual-main=true missing-bank-fallback=true live-attachment=false bank-delivery=false\n' | | 19 | +printf 'main-locality-suite: PASS tests=5 compiled-source=true actual-main=true missing-bank-fallback=true live-attachment=false bank-delivery=false\n' |
Collapse file Copy file name to clipboardExpand all lines: images/Containerfile +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -4,7 +4,6 @@ FROM ${RUST_IMAGE} AS builder | 4 | 4 | # Keep the input distinct from the compiler environment: a reused builder's | 5 | 5 | # ENV takes precedence over an ARG with the same name. | 6 | 6 | ARG UNF_SOURCE_REVISION=unknown | 7 | | -ENV UNF_BUILD_REVISION=${UNF_SOURCE_REVISION} | 8 | 7 |
| 9 | 8 | WORKDIR /src | 10 | 9 |
| @@ -13,7 +12,8 @@ COPY crates ./crates | 13 | 12 | COPY bins ./bins | 14 | 13 | COPY ebpf/unf-ebpf-common ./ebpf/unf-ebpf-common | 15 | 14 |
| 16 | | -RUN cargo build --locked --release --package unf-controller --package unf-agent --package unf-cni | | 15 | +RUN export UNF_BUILD_REVISION="${UNF_SOURCE_REVISION}" \ | | 16 | + && cargo build --locked --release --package unf-controller --package unf-agent --package unf-cni | 17 | 17 |
| 18 | 18 | FROM docker.io/library/debian:bookworm-slim | 19 | 19 |
| |
Collapse file Copy file name to clipboardExpand all lines: images/KernelLocalityTestContainerfile +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -5,13 +5,13 @@ ARG LEGACY_AGENT_IMAGE=quay.io/arencloud/unf-agent-dev@sha256:74f80c81d5a208dcfe | 5 | 5 | FROM ${LEGACY_AGENT_IMAGE} AS legacy-agent | 6 | 6 | FROM ${RUST_IMAGE} AS builder | 7 | 7 | ARG UNF_SOURCE_REVISION=unknown | 8 | | -ENV UNF_BUILD_REVISION=${UNF_SOURCE_REVISION} | 9 | 8 | WORKDIR /src | 10 | 9 | COPY Cargo.toml Cargo.lock rust-toolchain.toml ./ | 11 | 10 | COPY crates ./crates | 12 | 11 | COPY bins ./bins | 13 | 12 | COPY ebpf/unf-ebpf-common ./ebpf/unf-ebpf-common | 14 | | -RUN cargo build --locked --release --package unf-locality --example kernel_observed_bank \ | | 13 | +RUN export UNF_BUILD_REVISION="${UNF_SOURCE_REVISION}" \ | | 14 | + && cargo build --locked --release --package unf-locality --example kernel_observed_bank \ | 15 | 15 | && cargo build --locked --release --package unf-agent | 16 | 16 |
| 17 | 17 | FROM ${TEST_IMAGE} | |
|