Skip to content

fix(build,chart): review hazards — authz failureMode guard (#770), build-id guard, dead Makefile targets, image-layer targets (#772) - #774

Merged
bpalermo merged 6 commits into
mainfrom
fix/772-a1-build-chart-hazards
Sep 15, 2026
Merged

bpalermo merged 6 commits into
mainfrom
fix/772-a1-build-chart-hazards

Conversation

@bpalermo

Copy link
Copy Markdown
Owner

Phase A1 of #772. Closes #770.

fix(charts): normalise and validate proxy.authzSidecar.failureMode (#770) (#772)

charts/aether/templates/agent-daemonset.yaml compared the raw value against
the literal "ALLOW". allow, Allow or a stray trailing space therefore
rendered the agent WITHOUT --authz-sidecar-failure-mode-allow — fail-CLOSED on
an authorization control, with no error, no warning, and nothing in helm lint.

  • _helpers.tpl: new aether.proxy.authzFailureMode, which normalises with
    upper (trim (toString ...)) and fails on anything that is not ALLOW or
    DENY. Refusing is deliberate: silently picking a failure mode for the operator
    is how this bug worked.
  • agent-daemonset.yaml consumes the helper, and also invokes it once at the
    top of the file so a typo is rejected when it is written rather than when
    someone later flips proxy.authzSidecar.enabled on.
  • values.yaml: document that the key is case/whitespace-insensitive and
    validated at render time.
  • New //bazel/helm:defs.bzl helm_template_fail_test: rules_helm can assert a
    chart renders, never that it refuses to. An untested {{ fail }} guard is
    indistinguishable from an absent one, which is exactly how chart: proxy.authzSidecar.failureMode is compared with a raw string equality, so any spelling variance silently selects fail-closed #770 shipped. It
    passes only when helm exits non-zero AND prints the expected message, so an
    unrelated render failure cannot keep it green.
  • Two new targets in //charts/aether: aether_authz_failure_mode_test
    (failureMode=allow must render --authz-sidecar-failure-mode-allow, the flag
    that makes the agent emit failure_mode_allow: true) and
    aether_authz_failure_mode_invalid_test (failureMode=maybe must be
    rejected).
  • Chart version 0.92.18 -> 0.92.19.

Verification: bazel test //charts/... — 11/11 pass. Both new tests were proven
non-vacuous by temporarily restoring the old eq .Values... "ALLOW" comparison:
both FAIL against it. Direct helm template matrix on the packaged chart:
ALLOW/allow/" allow " render the flag, DENY/deny do not, maybe and "" exit 1
with proxy.authzSidecar.failureMode must be ALLOW or DENY, got "maybe".

fix(buildid): cover the prober in the #653 build-id collision guard (#772)

//tools/buildid:release_build_ids asserts that every binary shipping in a
released image carries a content-derived GNU build-ID and that no two are equal
— the collision that made Pyroscope symbol upload unsafe (#653). It listed six
ELFs and omitted //prober/cmd/prober, which has had its own chart
(//charts/prober) and its own published image since the external SLI prober
landed, and whose symbols are uploaded under exactly that build-ID.

Verification: bazel build //tools/buildid:release_build_ids now reports 7
distinct IDs (prober = 02e51d65...); bazel test //tools/buildid/... passes.

chore(make): drop the dead publish and push-proxy-image targets (#772)

publish was dead AND broken: no reference to it exists anywhere in the repo,
and both commands it ran name packages that do not exist (bazel query //charts/agent:agent.push_registry → no such package 'charts/agent'; same for
charts/registrar). Worse, its push-all prerequisite runs first, so anyone
following it pushed four images and then hard-failed — a half-publish.
.github/workflows/publish.yaml is the real publisher and is serialised (#692).

push-proxy-image had zero references outside the Makefile and duplicated what
.github/workflows/proxy-release.yml owns end to end (bazel run //:push,
native arm64 runner, fully automated in #703/#727) — a second, unaudited way to
write the released proxy tag. Its sibling load-proxy-image is documented
(docs/runbook.md:56, proxy/README.md:28) and stays.

Both replaced by a comment pointing at the workflow that does the job, so the
next reader does not re-add them.

No documentation referenced either target: grep -rn 'make publish|push-proxy-image'
over docs/ CLAUDE.md AGENTS.md README.md is empty. push-all and every
load-*/push-*-image target that docs DO reference (CLAUDE.md:56,
README.md:117, docs/runbook.md:56,174) are untouched.

Verification: make -n push-all and make -n load-proxy-image still resolve;
make -n publish and make -n push-proxy-image report no such rule.

fix(e2e): drop the silently ignored --set spire.trustDomain= (#772)

The aether chart has no spire.trustDomain key — it was retired precisely
because it could disagree with what SPIRE actually issues, and every component
now resolves its trust domain from its own SVID (charts/aether/values.yaml:86).
Helm accepts unknown --set paths without complaint, so both multicluster
harnesses have been passing a no-op that reads, on a mesh-identity setting, as
if the harness were pinning the trust domain.

TRUST_DOMAIN itself stays: it is still what configures SPIRE in kind
(global.spire.trustDomain on the spire chart, and the
spiffe://$TRUST_DOMAIN/... authorized delegate). Only the aether --set goes.

Verification: bazel build --config=lint --@aspect_rules_lint//lint:fail_on_violation //e2e/...
clean (shellcheck sees no newly-unused variable — TRUST_DOMAIN has four
remaining uses per script).

docs(ci): correct the main.yaml comment about what e2e.yaml covers (#772)

The comment claimed "e2e.yaml already covers main pushes", which is the
justification for main.yaml not repeating the e2e leg. e2e.yaml's on: block
is workflow_dispatch + schedule: 17 4 * * * — there is no push trigger, so
a main push is covered by the next nightly, not immediately. Reader-facing
only: no trigger is changed, and the conclusion (don't repeat e2e here) still
holds.

Verification: the file still parses as YAML; the on: blocks of both workflows
are unchanged.

fix(bazel): declare additional_layer only when there is one (#772)

go_multi_arch_image declared image_layer(name = "additional_layer")
unconditionally, but wired it into image_manifest only if image_tars_layer.
Every image package that passes no tars_layer therefore carried an empty layer
target that nothing referenced and nothing could reference — confirmed by
bazel query 'rdeps(//..., //controller/cmd/controller:additional_layer)'
returning only itself, against 24 rdeps for the agent's.

Indenting the declaration under the same condition removes four dangling
targets:

before: agent, mesh-dns, cni-install, controller, e2e/udsecho, prober, registrar
after: agent, mesh-dns, cni-install

(bazel query 'kind(".*", //...)' | grep additional_layer, 7 -> 3; the three
that remain are exactly the three BUILD files that pass tars_layer.)

Verification: all 52 image targets (image_index/image_manifest/image_load/
image_push/image_layer/container_structure_test across the 7 image
packages) build. All 7 :image_test container-structure tests pass FROM CACHE —
i.e. every image tarball is byte-identical to before, which is the proof that
the removed layer never reached an image.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr

bpalermo and others added 6 commits September 15, 2026 19:09
) (#772)

`charts/aether/templates/agent-daemonset.yaml` compared the raw value against
the literal "ALLOW". `allow`, `Allow` or a stray trailing space therefore
rendered the agent WITHOUT `--authz-sidecar-failure-mode-allow` — fail-CLOSED on
an authorization control, with no error, no warning, and nothing in `helm lint`.

- `_helpers.tpl`: new `aether.proxy.authzFailureMode`, which normalises with
  `upper (trim (toString ...))` and `fail`s on anything that is not ALLOW or
  DENY. Refusing is deliberate: silently picking a failure mode for the operator
  is how this bug worked.
- `agent-daemonset.yaml` consumes the helper, and also invokes it once at the
  top of the file so a typo is rejected when it is written rather than when
  someone later flips `proxy.authzSidecar.enabled` on.
- `values.yaml`: document that the key is case/whitespace-insensitive and
  validated at render time.
- New `//bazel/helm:defs.bzl helm_template_fail_test`: rules_helm can assert a
  chart renders, never that it refuses to. An untested `{{ fail }}` guard is
  indistinguishable from an absent one, which is exactly how #770 shipped. It
  passes only when helm exits non-zero AND prints the expected message, so an
  unrelated render failure cannot keep it green.
- Two new targets in `//charts/aether`: `aether_authz_failure_mode_test`
  (`failureMode=allow` must render `--authz-sidecar-failure-mode-allow`, the flag
  that makes the agent emit `failure_mode_allow: true`) and
  `aether_authz_failure_mode_invalid_test` (`failureMode=maybe` must be
  rejected).
- Chart version 0.92.18 -> 0.92.19.

Verification: `bazel test //charts/...` — 11/11 pass. Both new tests were proven
non-vacuous by temporarily restoring the old `eq .Values... "ALLOW"` comparison:
both FAIL against it. Direct `helm template` matrix on the packaged chart:
ALLOW/allow/" allow " render the flag, DENY/deny do not, `maybe` and `""` exit 1
with `proxy.authzSidecar.failureMode must be ALLOW or DENY, got "maybe"`.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
…772)

`//tools/buildid:release_build_ids` asserts that every binary shipping in a
released image carries a content-derived GNU build-ID and that no two are equal
— the collision that made Pyroscope symbol upload unsafe (#653). It listed six
ELFs and omitted `//prober/cmd/prober`, which has had its own chart
(`//charts/prober`) and its own published image since the external SLI prober
landed, and whose symbols are uploaded under exactly that build-ID.

Verification: `bazel build //tools/buildid:release_build_ids` now reports 7
distinct IDs (prober = 02e51d65...); `bazel test //tools/buildid/...` passes.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
…772)

`publish` was dead AND broken: no reference to it exists anywhere in the repo,
and both commands it ran name packages that do not exist (`bazel query
//charts/agent:agent.push_registry` → `no such package 'charts/agent'`; same for
`charts/registrar`). Worse, its `push-all` prerequisite runs first, so anyone
following it pushed four images and then hard-failed — a half-publish.
`.github/workflows/publish.yaml` is the real publisher and is serialised (#692).

`push-proxy-image` had zero references outside the Makefile and duplicated what
`.github/workflows/proxy-release.yml` owns end to end (`bazel run //:push`,
native arm64 runner, fully automated in #703/#727) — a second, unaudited way to
write the released proxy tag. Its sibling `load-proxy-image` is documented
(docs/runbook.md:56, proxy/README.md:28) and stays.

Both replaced by a comment pointing at the workflow that does the job, so the
next reader does not re-add them.

No documentation referenced either target: `grep -rn 'make publish|push-proxy-image'`
over `docs/ CLAUDE.md AGENTS.md README.md` is empty. `push-all` and every
`load-*`/`push-*-image` target that docs DO reference (CLAUDE.md:56,
README.md:117, docs/runbook.md:56,174) are untouched.

Verification: `make -n push-all` and `make -n load-proxy-image` still resolve;
`make -n publish` and `make -n push-proxy-image` report no such rule.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
The aether chart has no `spire.trustDomain` key — it was retired precisely
because it could disagree with what SPIRE actually issues, and every component
now resolves its trust domain from its own SVID (charts/aether/values.yaml:86).
Helm accepts unknown `--set` paths without complaint, so both multicluster
harnesses have been passing a no-op that reads, on a mesh-identity setting, as
if the harness were pinning the trust domain.

`TRUST_DOMAIN` itself stays: it is still what configures SPIRE in kind
(`global.spire.trustDomain` on the spire chart, and the
`spiffe://$TRUST_DOMAIN/...` authorized delegate). Only the aether `--set` goes.

Verification: `bazel build --config=lint --@aspect_rules_lint//lint:fail_on_violation //e2e/...`
clean (shellcheck sees no newly-unused variable — `TRUST_DOMAIN` has four
remaining uses per script).

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
)

The comment claimed "`e2e.yaml` already covers `main` pushes", which is the
justification for main.yaml not repeating the e2e leg. `e2e.yaml`'s `on:` block
is `workflow_dispatch` + `schedule: 17 4 * * *` — there is no `push` trigger, so
a `main` push is covered by the next nightly, not immediately. Reader-facing
only: no trigger is changed, and the conclusion (don't repeat e2e here) still
holds.

Verification: the file still parses as YAML; the `on:` blocks of both workflows
are unchanged.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
`go_multi_arch_image` declared `image_layer(name = "additional_layer")`
unconditionally, but wired it into `image_manifest` only `if image_tars_layer`.
Every image package that passes no `tars_layer` therefore carried an empty layer
target that nothing referenced and nothing could reference — confirmed by
`bazel query 'rdeps(//..., //controller/cmd/controller:additional_layer)'`
returning only itself, against 24 rdeps for the agent's.

Indenting the declaration under the same condition removes four dangling
targets:

  before: agent, mesh-dns, cni-install, controller, e2e/udsecho, prober, registrar
  after:  agent, mesh-dns, cni-install

(`bazel query 'kind(".*", //...)' | grep additional_layer`, 7 -> 3; the three
that remain are exactly the three BUILD files that pass `tars_layer`.)

Verification: all 52 image targets (`image_index`/`image_manifest`/`image_load`/
`image_push`/`image_layer`/`container_structure_test` across the 7 image
packages) build. All 7 `:image_test` container-structure tests pass FROM CACHE —
i.e. every image tarball is byte-identical to before, which is the proof that
the removed layer never reached an image.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
@bpalermo
bpalermo merged commit 53e469b into main Sep 15, 2026
19 checks passed
@bpalermo
bpalermo deleted the fix/772-a1-build-chart-hazards branch September 15, 2026 22:22
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.

chart: proxy.authzSidecar.failureMode is compared with a raw string equality, so any spelling variance silently selects fail-closed

1 participant