Audit remediation: security, robustness, and UX fixes #25
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/audit-remediation"
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
Remediation of findings from an end-to-end audit of kInit. 42 focused commits
(one per issue), grouped below by theme. Each touches one concern and was
syntax-checked and ShellCheck-linted.
Security
restartSSHServicevalidatessshd -tand usesreload(notrestart) beforeapplying SSH changes, preventing remote root lockout from a bad config edit.
new
SSH_KEY_DEFAULT_DC.--setup-profile-urlbootstrap fails closed withoutKINIT_SETUP_BOOTSTRAP_SHA256(explicit
KINIT_SETUP_BOOTSTRAP_ALLOW_UNVERIFIED=1+ confirmation to override).checksums.sha256(off by default)./etc/ssh/sshd_config.d/drop-in when supported;config files backed up before in-place edits.
validateSSHPublicKeyrewritten to usessh-keygen(accepts restricted keys,rejects
environment=/malformed);validateCronLinerejects newline/||/unescaped%.Reliability
set -Eeuo pipefailso thecleanERR trap fires on nested failures.FISH_ALIAS_*guarded againstset -u;appendToFileensures a trailing newline.apt.shreports a collection failure instead of all-zeros when apt fails.Behavior / defaults
1s->7d; Docker prune defaults to dangling-only(
CLEAN_DOCKER_PRUNE_ALLopt-in); non-fatal warning on EOL distros.UX / docs
NO_COLOR(kInit.sh, utils.sh, analyze.sh);errors -> stderr;
helpdocumentsKINIT_*env vars.*.vars.exampletemplates;uninstall.sh;CHANGELOG + manifest version header; data-driven module loop.
Validation
bash -non all scripts.sha256sum -c checksums.sha256passes; embedded bootstrap hashes regenerated.--analyzeinstall completed, all 4 modules executed, fixes confirmed on-box
(journal 7d, no-key-on-no-match skip, batched apt, hardened crons, fish shell,
zabbix-agent2 active). Two issues the live run surfaced (analyze.sh color
suppression + no-match SSH check) are fixed and re-verified.
Notes / deferred
into
KINIT_MINISIGN_PUBKEYto enable).*.varskept committed (they are the served kleb.sh deployment config);sanitized templates added alongside.
date(1)micro-optimization intentionally deferred.system.sh referenced $FISH_ALIAS_BAT/CAT/LL/MD/RM/CP/MV/PC without a default, so under 'set -u' a customized system.vars that omits any one key crashed the System module with 'unbound variable' after fish/Fisher were already installed. Now uses the ${VAR:-} form, matching analyze.sh.kReview review
Verdict: no findings
No findings to address in the reviewed diff.
Overall risk is low; no actionable correctness or security defects are evident from the supplied diff and context.
Reviewed by kReview at
34fa7f855b. This comment is conservative and based only on the PR diff, metadata, and supplied repository context.Est. cost ~$1.03 total (200.9k in / 1.9k out) · this run ~$0.34 (67.3k in / 555 out) / gpt-5.5.