Fix audit findings: lockout guards, apt hardening, injection & integrity #29
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/audit-round-3"
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?
Summary
Fixes the findings from the round-3 audit (Security / Reliability / Performance) on the kInit installer. 18 findings across 10 scripts, plus a regenerated integrity manifest.
Highlights
Lockout / access safety
uninstall.shreverts root's login shell from fish to/bin/bashbefore advising fish removal (previously following the uninstaller's own guidance could break root login).HOMEnormalized to root's real home (getRootHomeviagetent passwd root) soauthorized_keys, cron scripts and shell config never land in an invoking user's home undersudo/su.system.shunions (never clobbers) a customAuthorizedKeysFileso the installed root key is honored without locking out root or centralized-key accounts; thesshd -Tprobe is pipefail-safe.Security
KINIT_SKIP_BOOTSTRAP_VALIDATIONnow requires an interactive TTY +I UNDERSTAND THE RISKS, matching the sibling integrity bypasses.software.shrequires a strict-charset hostname before baking it into the root cron scriptapt.sh(closes a command-injection sink on the non-interactive path).zabbix.shrejects empty/bad-magic vendor downloads;checksum.shverifies its pin edits landed.Reliability
aptcalls getDPkg::Lock::Timeout+DEBIAN_FRONTEND=noninteractiveso first-bootapt-dailylock contention doesn't abort provisioning.update.sh: a failedapt-get updateno longer suppresses the upgrade;setsid/timeoutreordered so the timeout actually bounds apt (alsoclean.sh).SWAP_SIZE/PermitRootLogin/LoginGraceTime; anchor uninstall cron cleanup to full installed paths.Perf / correctness
printfinstead ofecho -ein log helpers; case-insensitive security-update counting (apt.sh,motd.sh); corrected a misleading batching comment.Verification
bash -nclean on all edited scripts;shellcheckintroduced no new diagnostics.sha256sum -c checksums.sha256-> all 62 files OK; both embedded bootstrap hashes inkInit.shmatch.AuthorizedKeysFiledecision table (incl. pipefail-safety), and the download guards.Notes / deliberate non-changes
datefork left as-is (negligible for a one-shot installer; ms timestamps needdate).--base-url http://still accepted (local testing relies on it; integrity is enforced by the pinned hash).KINIT_MINISIGN_PUBKEYfor production.kReview review
Verdict: no findings
No findings to address in the reviewed diff.
Overall risk is low; no concrete regressions are provable from the supplied diff.
Reviewed by kReview at
2ec1e57c15. This comment is conservative and based only on the PR diff and metadata.Est. cost ~$0.59 total (95.3k in / 3.7k out) · this run ~$0.13 (23.8k in / 359 out) / gpt-5.6-sol.