fix: token leak in make dry runs, and OpenBao join targets for all five replicas #248
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/defects"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Two unrelated defects found while auditing before the node roll. Separate commits.
1.
make -nprinted both tokens in fullAny dry run of any target leaked
HCLOUD_TOKENandCODEBERG_TOKEN, because::=assignments, so they decrypt at Makefile parse time on everymakeinvocation regardless of the target; and"$(HCLOUD_TOKEN)", which expands the value into the recipe text.The
@prefix hides that during a real run.make -nignores@and prints the expanded text.Both variables are already
exported, so the fix is to read them from the environment:"$$HCLOUD_TOKEN"reaches the shell as$HCLOUD_TOKENand never enters the recipe text. Five sites, identical behaviour.Before / after on
make -n preflight:This was found by running
make -n, so both values are already exposed in that session's transcript. Rotating them is an operator action this PR does not perform.2. OpenBao could not rejoin through two of its five replicas
The raft config declared three
retry_joinblocks for a five-replica StatefulSet, and its comment still described areplicas=1deployment:The scale to 5 happened; the config did not follow. A rejoining member can only join through a peer named in its own list, so
openbao-3andopenbao-4were reachable only via 0, 1 or 2 — and losing those three at once stranded them, even though the StatefulSet's own comment says five voters exist to tolerate two simultaneous losses.Node rolls take one worker at a time, so this was latent rather than live. Worth fixing before a roll anyway: the point of five voters is surviving the unplanned second failure during a planned first one, and a three-entry join list quietly capped that.
Now one
retry_joinper replica. A target that is itself down is harmless — members try the list in order until one answers.Checks
bash tests/check.shexits 0. The rendered config parses with 5leader_api_addrtargets. Note commit 2 will roll the OpenBao StatefulSet (OrderedReady, 5 pods) — deliberately landed before the kernel roll rather than during it.https://claude.ai/code/session_01MdSbMhzabSbpG8TtP9Ur3H
`make -n` printed HCLOUD_TOKEN and CODEBERG_TOKEN in full. Any dry run of any target did, because: - both are `:=` assignments, so they decrypt at Makefile PARSE time on every make invocation regardless of the target asked for; and - five recipe lines read them as MAKE variables, "$(HCLOUD_TOKEN)", which expands the value into the recipe TEXT. The @ prefix hides that during a real run. `make -n` ignores @ and prints the expanded text, so both tokens landed on stdout. Both variables are already `export`ed, so the recipes can read them from the environment instead. "$$HCLOUD_TOKEN" reaches the shell as $HCLOUD_TOKEN and never appears in the recipe text. Five sites changed; the checks behave identically. Found by running `make -n` while auditing targets for dead references, so the values are already exposed in that session's transcript. Rotating both is a separate operator action this commit does not perform. Claude-Session: https://claude.ai/code/session_01MdSbMhzabSbpG8TtP9Ur3H