Audit round 2: SSH hardening, update.sh, validator tests, naming cleanup #27

Closed
kleb wants to merge 0 commits from fix/audit-round-2 into main
Owner

Summary

Round 2 of the kInit audit remediation — implements the prioritized fixes from
the latest end-to-end audit.

Security

  • SSH: on the key-installed path, disable PasswordAuthentication and
    KbdInteractiveAuthentication (configurable via SSH_PASSWORD_AUTH, default
    no); set LoginGraceTime 60 (SSH_LOGIN_GRACE_TIME); drop the deprecated
    authorized_keys2 from AuthorizedKeysFile. Applied only where a key was
    installed, so a host matching no SSH_IP_RANGES entry is never locked out.

Behavior

  • update.sh: apt-get upgrade --with-new-pkgs instead of full-upgrade
    upgrades all installed packages (incl. new kernels) but never auto-removes.
  • Re-pin Fisher 4.4.5 -> 4.4.8 (checksum updated).

Tooling / maintenance

  • Remove the divergent Windows checksum.ps1 generator (it omitted files and
    used a non-canonical format, corrupting the manifest).
  • Add bats unit tests for the validation helpers (tests/).
  • Clarity renames: currentMe->scriptName, module
    currentName/currentVersion->moduleName/moduleVersion, kInit
    currentVersion->kinitVersion, isLXC state var->runningInLxc,
    noOut->runQuiet.
  • Regenerate the integrity manifest.

Validation

  • ShellCheck clean (only intentional SC2059/SC1091/SC2016).
  • sha256sum -c checksums.sha256: 46/46 OK; embedded bootstrap hashes re-stamped.
  • Validators exercised: 20/20 behaviors pass.
  • Live test on a fresh Debian 12 Incus VM: all 4 modules EXECUTED, analyze 10/10
    passed, SSH drop-in correct + sshd -t OK, update.sh verb correct, Fisher
    4.4.8 installed, zabbix-agent2 active, root shell fish, 0 color leakage.
## Summary Round 2 of the kInit audit remediation — implements the prioritized fixes from the latest end-to-end audit. ### Security - SSH: on the key-installed path, disable `PasswordAuthentication` and `KbdInteractiveAuthentication` (configurable via `SSH_PASSWORD_AUTH`, default `no`); set `LoginGraceTime 60` (`SSH_LOGIN_GRACE_TIME`); drop the deprecated `authorized_keys2` from `AuthorizedKeysFile`. Applied only where a key was installed, so a host matching no `SSH_IP_RANGES` entry is never locked out. ### Behavior - `update.sh`: `apt-get upgrade --with-new-pkgs` instead of `full-upgrade` — upgrades all installed packages (incl. new kernels) but never auto-removes. - Re-pin Fisher 4.4.5 -> 4.4.8 (checksum updated). ### Tooling / maintenance - Remove the divergent Windows `checksum.ps1` generator (it omitted files and used a non-canonical format, corrupting the manifest). - Add `bats` unit tests for the validation helpers (`tests/`). - Clarity renames: `currentMe`->`scriptName`, module `currentName`/`currentVersion`->`moduleName`/`moduleVersion`, kInit `currentVersion`->`kinitVersion`, `isLXC` state var->`runningInLxc`, `noOut`->`runQuiet`. - Regenerate the integrity manifest. ### Validation - ShellCheck clean (only intentional SC2059/SC1091/SC2016). - `sha256sum -c checksums.sha256`: 46/46 OK; embedded bootstrap hashes re-stamped. - Validators exercised: 20/20 behaviors pass. - Live test on a fresh Debian 12 Incus VM: all 4 modules EXECUTED, analyze 10/10 passed, SSH drop-in correct + `sshd -t` OK, `update.sh` verb correct, Fisher 4.4.8 installed, zabbix-agent2 active, root shell fish, 0 color leakage.
- SSH: on the key-installed path, disable PasswordAuthentication and
  KbdInteractiveAuthentication (configurable via SSH_PASSWORD_AUTH), set
  LoginGraceTime 60, and drop the deprecated authorized_keys2
- update.sh: use `apt-get upgrade --with-new-pkgs` instead of full-upgrade so it
  upgrades all packages (incl. new kernels) but never auto-removes them
- Re-pin Fisher 4.4.5 -> 4.4.8 (checksum updated)
- Remove the divergent Windows checksum.ps1 generator
- Clarity renames: currentMe->scriptName, current{Name,Version}->module{Name,Version},
  kInit currentVersion->kinitVersion, isLXC state var->runningInLxc, noOut->runQuiet
- Add bats unit tests for the validation helpers (tests/)
- Regenerate the integrity manifest
Collaborator

kReview review

Verdict: no findings

No findings to address in the reviewed diff.

Overall risk is low; I found no concrete regressions that can be verified from the supplied diff and context.

Reviewed by kReview at c2baa732a3. This comment is conservative and based only on the PR diff, metadata, and supplied repository context.

Est. cost ~$0.23 (44.0k in / 557 out / gpt-5.5).

<!-- codex-forgejo-review --> <!-- codex-forgejo-review-head:c2baa732a3829bced494449cd5379a03f17ecea0 --> ## kReview review **Verdict:** no findings No findings to address in the reviewed diff. Overall risk is low; I found no concrete regressions that can be verified from the supplied diff and context. _Reviewed by kReview at `c2baa732a3`. This comment is conservative and based only on the PR diff, metadata, and supplied repository context._ _Est. cost ~$0.23 (44.0k in / 557 out / gpt-5.5)._ <!-- codex-forgejo-review-state:eyJoZWFkU2hhIjoiYzJiYWE3MzJhMzgyOWJjZWQ0OTQ0NDljZDUzNzlhMDNmMTdlY2VhMCIsInN1bW1hcnkiOiJPdmVyYWxsIHJpc2sgaXMgbG93OyBJIGZvdW5kIG5vIGNvbmNyZXRlIHJlZ3Jlc3Npb25zIHRoYXQgY2FuIGJlIHZlcmlmaWVkIGZyb20gdGhlIHN1cHBsaWVkIGRpZmYgYW5kIGNvbnRleHQuIiwiZmluZGluZ3MiOltdLCJjdW11bGF0aXZlQ29zdCI6eyJ1c2QiOjAuMjI1OTg2MDAwMDAwMDAwMDIsImlucHV0VG9rZW5zIjo0NDA0NCwib3V0cHV0VG9rZW5zIjo1NTcsIm1vZGVsIjoiZ3B0LTUuNSJ9fQ== -->
kleb closed this pull request 2026-06-25 01:21:26 +02:00

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kleb/kInit!27
No description provided.