Skip to main content

kevward

CI License: AGPL v3 Python

Defensive server hardening & patch automation for Ubuntu.

kevward runs on a server and answers three questions a sysadmin asks every morning:

  1. What on this box is vulnerable or out of date? — pending security updates and minor upgrades for the base system (apt), web servers (nginx, Apache), databases (MySQL, MariaDB, PostgreSQL, Redis) and php/openssh/ufw, plus dependency advisories for Composer/Laravel, Node.js/npm and WordPress.
  2. Who is attacking me? — a time-ordered view of banned / probing source IPs from fail2ban and sshd auth logs.
  3. Of everything being exploited in the wild right now, does any of it apply to me? — cross-references the CISA KEV catalog (known actively-exploited CVEs) against software detected on the host.

It can report, and — only when you explicitly opt in — apply security patches and schedule a reboot inside a maintenance window.

Scope: this is a defensive tool. It only inspects and patches the host it runs on. It contains no capability to scan, access, or act against any remote system, and none will be accepted. "Active defense" here means staying ahead of attackers on your own infrastructure — not hacking back, which in Japan remains restricted to designated authorities under the 2026 サイバー対処能力強化法 and is otherwise an offence under the 不正アクセス禁止法.

Install

git clone https://github.com/ForexRobotics/kevward
cd kevward
pip install .            # or: pipx install .

Requires Python 3.10+ (Ubuntu 22.04 and newer). The only dependency is tomli, and only on Python 3.10 — on 3.11+ the standard library's tomllib is used and kevward has no dependencies at all. Optional host tools are detected at runtime: apt, composer, npm, wp (wp-cli), fail2ban, logwatch.

To make kevward available to root (needed for report/apply) when installed in a virtualenv, symlink it onto the system path:

sudo python3 -m venv /opt/kevward
sudo /opt/kevward/bin/pip install .
sudo ln -sf /opt/kevward/bin/kevward /usr/local/bin/kevward

Supported services

Area Services
Base system apt (host-wide updates, reboot detection)
Web servers nginx, Apache (apache2)
Databases MySQL, MariaDB, PostgreSQL, Redis
Runtimes PHP, Node.js
Apps Composer/Laravel, WordPress (report-only)
Access OpenSSH (sshd), ufw

Any service not installed is silently skipped. Adding another is one file — see CONTRIBUTING.md.

Usage

kevward check                 # report findings, change nothing (default)
kevward check -s nginx -s php # limit to specific services
kevward trends                # actively-exploited CVEs relevant to this host
kevward report --trends       # write an HTML posture + attacker-IP report
kevward apply                 # DRY RUN: show what would be patched
sudo kevward apply --yes      # actually apply security updates
sudo kevward apply --yes --minor --reboot   # +minor upgrades, +schedule reboot
sudo kevward schedule-reboot --window 04:00
kevward list-plugins

Safety model

  • Read-only by default. check, report, trends never change anything.
  • apply is explicit. Without --yes it is a dry run. Security updates only; minor upgrades need --minor or policy.
  • Reboots are double-gated. They happen only when allow_reboot = true and a reboot is requested (--reboot / schedule-reboot).
  • Risky services are report-only. Composer/Laravel, Node.js and WordPress are audited but never auto-updated — a dependency bump is the app owner's call, not a cron job's.

Configuration

Copy config.example.toml to /etc/kevward/config.toml. All defaults are conservative; see that file for every option, including where to point the Composer/Laravel/Node/WordPress scanners.

Scheduling

Install the units in systemd/:

sudo cp systemd/kevward-report.* /etc/systemd/system/
sudo systemctl enable --now kevward-report.timer    # daily read-only report
# Only after you trust it:
sudo cp systemd/kevward-apply.* /etc/systemd/system/
sudo systemctl enable --now kevward-apply.timer      # weekly security patching

Adding a service

Drop one file in kevward/plugins/ — it is auto-discovered. See CONTRIBUTING.md for the 5-minute guide.

Security

Found a vulnerability in kevward? Please report it privately — see SECURITY.md. Don't open a public issue for security problems.

Acknowledgments

The initial release was designed and written in pair-programming sessions with Claude (Anthropic's AI assistant). This is not an endorsement or an official Anthropic project — just a thank-you for the help. All design decisions and responsibility for the code rest with the maintainer.

License

AGPL-3.0-or-later. See LICENSE.

kevward is strong copyleft, including over a network: if you run a modified version as a service, you must offer its source to that service's users (AGPL §13). Copyright © 2026 Forex Robotics Co., Ltd. (Forex Robotics 株式会社); contributions are accepted under a CLA so the project can be relicensed in future if the maintainer chooses (see CONTRIBUTING.md).

Metadata

Release files for kevward 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kevward 0.2.0
File Size Uploaded Provenance Actions
kevward-0.2.0.tar.gz 41.2 kB With provenance Details for kevward-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for kevward 0.2.0
File Interpreter ABI Platform Actions
kevward-0.2.0-py3-none-any.whl Python 3 none any Details for kevward-0.2.0-py3-none-any.whl

Total release size: 91.6 kB

Release files / kevward-0.2.0.tar.gz

Download URL kevward-0.2.0.tar.gz
Size 41.2 kB
Tags Source
SHA-256 checksum
How to use checksums
e544e96b7355a738ed2237547daea345ea2e3652e964028b6dab9ad647317f7b
BLAKE2b-256 checksum
How to use checksums
271a4dafe5226ec86738c19720bb9a031504401ef732f86178d6904a9361e91e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

Release files / kevward-0.2.0-py3-none-any.whl

Download URL kevward-0.2.0-py3-none-any.whl
Size 50.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
42627f45bd5c6703b4b0ab2822366f33c9f54e1163c1f7c3d960c5ec47e1098e
BLAKE2b-256 checksum
How to use checksums
7bfd76a7760d74605de193440efe593baf089ae2ec3698e032040263b3ca0f94
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

Security for kevward 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for kevward-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page