Repository navigation
fix(cli,deploy): harden hosts.json writes, scope operator RBAC, fix Tiltfile and tooling hygiene - #1853
Closed
nikhilunni wants to merge 4 commits into
Closed
fix(cli,deploy): harden hosts.json writes, scope operator RBAC, fix Tiltfile and tooling hygiene#1853nikhilunni wants to merge 4 commits into
nikhilunni wants to merge 4 commits into
Conversation
…iltfile and tooling hygiene
write_hosts now closes the temp file before the rename, keeps the write or rename error when the cleanup also fails, and fsyncs the directory so the rename is durable. The test directory guard no longer panics in drop. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
nikhilunni
force-pushed
the
audit/p1-cli-ops-hardening
branch
from
December 2, 2026 21:57
cc0c730 to
a85758a
Compare
nikhilunni
marked this pull request as ready for review
December 3, 2026 17:07
Contributor
Author
|
Combined into #1860 with the other audit PRs, so they merge and deploy together. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Hardens CLI credential storage, host-fleet operator RBAC, and local development tooling:
engram-app-client(hosts.json): Tightens existing config directories to0o700, writeshosts.jsonatomically (a0o600temp file in the same directory, opened with that mode before any data is written, fsynced, closed, renamed, then the directory is fsynced), and surfaces corrupt JSON/read errors instead of silently wiping stored logins. A corrupthosts.jsonnow fails every command that needs a stored login, with the path in the message;ENGRAMS_API_KEYstill bypasses the file.apps/daemonsetsandpodspermissions fromClusterRoleinto a namespace-scopedRole+RoleBindingindeploy/helm/engram-host-fleet/templates/operator.rbac.yaml. The operator reads these only inspec.daemonSet.namespace, and the chart always renders the DaemonSet and the HostFleet CR with the release namespace.hostfleetsandnodesstay cluster-scoped.cmd=toenv=inTiltfile, enableserrexit+pipefailinjustfile, replaces fixed/tmp/seed-buckets.outwithmktemp+trapindeploy/dev/seed-buckets.sh, and removes tracked.codex-review-*.mdfiles.Upgrade notes (host-fleet chart)
RoleandRoleBindingnamed<release>-operatorin the release namespace. A deployer that is not cluster-admin needscreateonrolesandrolebindingsthere, plusget/patch/update/delete/bindon that name. Kubernetes also refuses to create a Role with rules the writer does not hold through RBAC, so the deployer must holddaemonsets: get, list, watch, patchandpods: get, list, watch, deletein the namespace. Grant these before the upgrade.ClusterRolebefore it creates theRole. Between the two, the operator gets Forbidden on DaemonSet and pod calls; each reconcile is idempotent and requeues in 15 s, so a short window is harmless. If theRolecreation fails, the operator cannot reconcile (no rolls, no autoscaling) until the deployer is fixed or the release is rolled back.operator.createHostFleet: false) must name a DaemonSet in the operator's release namespace.Validation
cargo fmt --check,cargo clippy -p engram-app-client --all-targets -- -D warnings,cargo hakari generate --diff.cargo test -p engram-app-client -p engram-cli: 51 passed (27engram-app-client+ 24engram-cli).bash -n, ShellCheck, andhelm lint/helm template(withoperator.enabled=true) passed.justfile: no recipe evaluates a backtick, and no non-shebang recipe depends on a failing pipe stage. Withpipefail,smoke-health,smoke-create, anddev-shellnow fail whencurlfails instead of printing nothing.🤖 Generated with Claude Code