Skip to content

kevward 0.17.0

Choose a tag to compare

@github-actions github-actions released this 22 Nov 06:46
· 27 commits to main since this release
d4b9072

Host lifecycle for consoles such as FR Security Centre. ssh-gate self.update
updates or rolls back kevward (#190). kevward setup writes the gate keys,
sudoers, timer and fail2ban ignore in one command (#191). kevward uninstall
removes kevward cleanly without locking out SSH (#192). self.update is
available from this release, so the update to 0.17.0 itself is done by hand.

  • kevward uninstall (#192). Removes kevward cleanly. Without --yes it
    is a dry run, and --json prints the ssh-gate envelope.
    • It removes the systemd units (report, firewall, harden), the ssh-gate
      sudoers file, ssh-gate lines in authorized_keys, setup's fail2ban
      drop-in, the harden sysctl drop-in, the nft tables and their boot
      persistence, the launcher, and finally /opt/kevward.
    • Config, reports and state stay unless --purge. Collector keys are
      removed only with --remove-collector-keys.
    • The firewall is checked first. If a kevward table contains anything
      kevward did not write (any rule other than its own set drops/accepts, a
      policy drop, a jump), or /etc/nftables.conf mentions kevward, it
      returns conflict and changes nothing.
    • Persistence is removed before the tables, so no rule comes back after a
      reboot (the 2026-11-08 class of accident).
    • It is logged to syslog and the change log.
  • kevward setup (#191). One root command that makes a host console-ready.
    It replaces the authorized_keys line that was pasted by hand, which went wrong
    on 2026-11-22 and got the operator banned by fail2ban.
    • --read-key / --operate-key (with --console-user) write the
      ssh-gate lines:
      • Each key is validated. An existing line for the same key, or an older
        gate line with the same comment, is replaced instead of duplicated.
      • A symlinked or group/world-writable .ssh or authorized_keys is
        refused, and the file is written atomically.
    • --operate-key also writes the exact-match sudoers file, checked with
      visudo -cf and installed 0440.
    • --ssh-gate enables the gate in config.toml. The config is validated
      (#186) and backed up first.
    • --timer installs the daily report timer.
    • --fail2ban-ignore adds an ignoreip drop-in that keeps earlier
      settings.
    • --refresh is reserved for the post-update steps of self.update.
    • Running it twice changes nothing. --dry-run lists the changes,
      --json prints the ssh-gate envelope, and every change is logged and
      shown in the report for 7 days. It never enables the firewall.
  • ssh-gate self.update (#190). A console can now update kevward on a host,
    or roll it back, with {"op":"self.update","args":{"version":"X.Y.Z"}}
    (operate role).
    • Only a validated X.Y.Z is accepted. The package name is fixed.
    • pip runs as --isolated with a clean environment and PyPI as the only
      index, under a lock and a 300 s limit. Afterwards the new
      kevward --version is checked.
    • It is refused unless kevward runs from the /opt/kevward venv, the host
      opts in with [ssh_gate] self_update = true, and the version is at or
      above [ssh_gate] min_version (default: the first release with the op).
    • The response carries old, new, downgrade, duration_s and
      pip_tail. An unknown version returns not_found, and a concurrent run
      returns conflict.
    • Each update is logged and shown in the report for 7 days.
    • The version op now reports install, self_update and min_version.
    • util.run gained clean_env.