Repository navigation
kevward 0.17.0
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--yesit
is a dry run, and--jsonprints 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.confmentions kevward, it
returnsconflictand 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.
- It removes the systemd units (report, firewall, harden), the ssh-gate
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
.sshorauthorized_keysis
refused, and the file is written atomically.
- Each key is validated. An existing line for the same key, or an older
--operate-keyalso writes the exact-match sudoers file, checked with
visudo -cfand installed 0440.--ssh-gateenables the gate in config.toml. The config is validated
(#186) and backed up first.--timerinstalls the daily report timer.--fail2ban-ignoreadds anignoreipdrop-in that keeps earlier
settings.--refreshis reserved for the post-update steps of self.update.- Running it twice changes nothing.
--dry-runlists the changes,
--jsonprints 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.Zis accepted. The package name is fixed. - pip runs as
--isolatedwith a clean environment and PyPI as the only
index, under a lock and a 300 s limit. Afterwards the new
kevward --versionis checked. - It is refused unless kevward runs from the
/opt/kevwardvenv, 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_sand
pip_tail. An unknown version returnsnot_found, and a concurrent run
returnsconflict. - Each update is logged and shown in the report for 7 days.
- The
versionop now reportsinstall,self_updateandmin_version. util.rungainedclean_env.
- Only a validated