scripts/setup-host.sh:
say "Installing Rust (if missing)..."
if ! command -v cargo >/dev/null; then
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source "$HOME/.cargo/env"
fi
This is the upstream-recommended Rust install path, so it's not unusual. But for a project that takes operator security seriously elsewhere (the systemd unit is hardened, the audit log story is in place), the curl-pipe-sh pattern stands out:
- No checksum. A compromise of
sh.rustup.rs (TLS termination at Cloudflare, etc.) would inject arbitrary shell into every developer's machine running this script.
- No version pin. A new Rust release that breaks the project's
rust-toolchain.toml would silently land in the host environment.
Both are mitigated by the fact that rust-toolchain.toml exists and cargo honors it — so the project builds with the right toolchain anyway. The installed cargo itself doesn't matter much, since rustup will fetch the pinned toolchain on first cargo build.
Still, two pragmatic improvements:
- Mention in the comment that the project pin comes from
rust-toolchain.toml, so installing the latest rustup is intentional and safe.
- If a future operator-paranoid mode is wanted, switch to the
rustup-init binary download + sha256 verify pattern.
Severity: Low / supply-chain hygiene.
scripts/setup-host.sh:This is the upstream-recommended Rust install path, so it's not unusual. But for a project that takes operator security seriously elsewhere (the systemd unit is hardened, the audit log story is in place), the curl-pipe-sh pattern stands out:
sh.rustup.rs(TLS termination at Cloudflare, etc.) would inject arbitrary shell into every developer's machine running this script.rust-toolchain.tomlwould silently land in the host environment.Both are mitigated by the fact that
rust-toolchain.tomlexists andcargohonors it — so the project builds with the right toolchain anyway. The installedcargoitself doesn't matter much, since rustup will fetch the pinned toolchain on firstcargo build.Still, two pragmatic improvements:
rust-toolchain.toml, so installing the latest rustup is intentional and safe.rustup-initbinary download + sha256 verify pattern.Severity: Low / supply-chain hygiene.