Skip to content

chore: vendor the installer that keeps the token off sudo's command line - #212

Merged
lr00rl merged 3 commits into
integrationfrom
fix/20261018_installer-token-argv
Oct 18, 2026
Merged

lr00rl merged 3 commits into
integrationfrom
fix/20261018_installer-token-argv

Conversation

@lr00rl

@lr00rl lr00rl commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Vendors the installer from lattice-node-agent 40 (LatticeNet/lattice-node-agent#40), which keeps the enrollment token off sudo's command line during the installer's re-exec. Base: integration at f3a857f. Not merged, tagged or released.

What changes

internal/agentinstall/install.sh is the lattice-node-agent installer at f7deddc, byte for byte. Ref and SHA256 in agentinstall.go move with it, and TestInstallerIsTheCopyRefNames holds the three together. /tools/agent/install.sh serves the new copy. The enrollment and reconfigure commands are unchanged.

Tests

  • go test ./internal/agentinstall/ passes.
  • go test -run 'Installer|InstallScript|Enroll|Vendored|Reconfigure' ./internal/server/ passes. That includes TestVendoredInstallerAcceptsWhatTheServerRenders, which runs this copy on what the enrollment command renders.
  • gofmt and vet are clean.

Review

The security review is on the installer PR. The enrollment command's own exposure, env LATTICE_NODE_TOKEN=... in a pasted line, is outside this change and reported to the operator.

…s the token off sudo's command line

The installer's sudo re-exec hands the enrollment token to the root child in a 0600 file instead of on sudo's command line, where any local user could read it in ps for the length of the install. The vendored copy and its digest move to that commit; TestInstallerIsTheCopyRefNames holds them together.
…s the token over in a private directory

The review of the file handover moved the token file into a 0700 directory the root child verifies; the vendored copy and its digest follow.
…ses an open TMPDIR for the token

The re-check of the token handover made the installer refuse a TMPDIR anyone can rename in and name an ACL on the token directory; the vendored copy and its digest follow.
@lr00rl
lr00rl merged commit 16cc0b2 into integration Oct 18, 2026
9 checks passed
@lr00rl
lr00rl deleted the fix/20261018_installer-token-argv branch October 18, 2026 12:57
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.

1 participant