SuperAPIAI Directory

kastell

github.com · AI developer platforms

Server security auditing and hardening (SSH, firewall, Docker, TLS) with CIS/PCI-DSS/HIPAA mapping, fleet management and forensic evidence collection.

Open website Alternatives
PricingOpen source开源项目(可免费自部署)
PlatformsmacOS · Linux

About this tool

Kastell is a security auditing and hardening command-line tool for self-hosted servers, positioned as the "DevOps security layer for self-hosted infrastructure." It attempts to solve the problem of fragmented server security tooling: Lynis only scans and does not remediate, OpenSCAP is powerful but complex, and custom scripts are difficult to maintain. Kastell uses a single CLI to complete auditing, remediation, hardening, and monitoring.

Purpose and positioning Kastell covers the full server lifecycle: provisioning, security hardening, backup, recovery, and management. It can scan servers, apply security fixes, lock down configurations according to production standards, and continuously monitor. From day one, the tool is AI-native: with a built-in MCP server, Claude, Cursor, or any MCP-compatible AI agent can directly manage servers, going from prompt to production hardening in seconds.

Main capabilities

  • Security auditing and hardening: supports hardening for SSH, firewalls, Docker, TLS, and more, and maps to CIS, PCI-DSS, and HIPAA compliance baselines.
  • Server provisioning: automatically handles server provisioning, SSH key setup, firewall configuration, and platform installation.
  • Updates and maintenance, backup and recovery, monitoring and debugging: provides commands such as update, maintain, logs, and health, unified across platforms.
  • Multi-server management (fleet management) and forensic evidence collection.
  • Interactive menu: running kastell without arguments launches an interactive search menu with a gradient ASCII banner, browsing operations by emoji category, instant filtering as you type, and step-by-step configuration of options, with no need to memorize command names or parameters. Each operation includes sub-options (server mode, template, log source, port number, etc.) and an option to return to the main menu. Known commands can also be used directly.
  • Platform adapter architecture: the same set of commands (update, maintain, logs, health) applies to all platforms; platform information is stored in the server record and automatically detected on each command.
  • Supports multiple cloud providers; pricing reflects the cheapest plan with at least 2 GB of memory (required by Coolify and Dokploy); Bare mode has no minimum requirement, and plans start at about $2.50/month, depending on the provider; Linode support is in beta.

Usage

  • Installation and running: requires Node.js 20 or higher. Running kastell without arguments enters the interactivemenu; commands can also be used directly.
  • Configuration file deployment: supports deployment with a single configuration file.
  • CI/CD integration: use kastell audit in CI pipelines to enforce security baselines; the --threshold flag returns a non-zero exit code when the score is below the target, automatically failing the CI job.
  • MCP server: built-in Model Context Protocol server, suitable for MCP-compatible clients such as Claude Code, Cursor, and Windsurf. All destructive operations (destroy, restore, snapshot-delete, provision, restart, maintain, snapshot-create) require SAFE_MODE=false to execute.
  • Claude Code plugin: available in the Anthropic marketplace, including 4 skills (kastell-ops architecture reference, kastell-scaffold component generation, kastell-careful destructive operation protection, kastell-research codebase exploration), 2 agents (kastell-auditor parallel audit analyzer, kastell-fixer worktree-isolated automatic repair), 5 hooks (destroy-block, session-audit, session-log, pre-commit-audit-guard, stop-quality-check). It can be installed via the Claude Code plugin manager, or used directly with claude --plugin-dir kastell-plugin.
  • AI discoverability: provides llms.txt for AI crawlers, and is registered in the MCP Registry as io.github.kastelldev/kastell.

Security design Kastell prioritizes security: 12,132 tests across 380 suites, including dedicated security test suites. API tokens are never written to disk; they are prompted for at runtime or provided via environment variables; SSH keys are automatically generated on demand (Ed25519); all SSH connections use StrictHostKeyChecking=accept-new with IP verification (octetrange) and environment filtering; all user-facing input has shell injection protection (using spawn/spawnSync, not execSync); provider error messages are sanitized to prevent token leakage; stderr sanitization redacts IPs, home directory paths, tokens, and keys from error output; configuration file token detection (22+ key patterns, case-insensitive, supports nesting); import/export operations strip sensitive fields and enforce strict file permissions (0o600); --full-setup automatically enables the UFW firewall and SSH hardening; MCP's SAFE_MODE (enabled by default) blocks all destructive operations, all input is validated via Zod schema, and backup restore has path traversal protection; in Claude Code hooks, destroy-block prevents accidental kastell destroy without --force, and pre-commit audit guard warns when the score drops. Zero telemetry—no usage data, analytics, or telemetry is collected, and server data never leaves the local machine.

Security behavior (v2.3.1)

  • KASTELL_STRICT_HOST_KEY=true: when set, Kastell directly rejects unknown SSH host keys. Direct SSH connections (i.e., connections via accept-new) issue a one-time TOFU warning; when combined with KASTELL_STRICT_HOST_KEY=true, the warning is escalated to a hard error.
  • Non-TTY destructive commands: in non-interactive environments (CI, scripts, automation), destructive operations require an explicit --force flag or the command's documented opt-in flag, otherwise they exit with a non-zero status and a clear error.
  • Structured skipped checks: skipped checks (such as being unrelated to the VPS, platform mismatch, missing prerequisites) appear as neutral visible results in the audit output rather than being silently discarded, so operators can see which checks did not run and why.
  • Windows secret files: secret-containing files written by Kastell on Windows receive restrictive ACLs (owner access only); on Linux/macOS, 0o600 POSIX permissions remain the source of truth, while Windows uses an equivalent DACL.
  • QuickWin JSON structure: QuickWin entries in audit --json now include a stable id (check ID) and severity fields, as well as the existing description and commands, for programmatic consumption.
  • FORBIDDEN previews include reasons: when previewing fixes with --dry-run (or via the server_fix MCP dry-run), each FORBIDDEN-level fix renders a brief reason explaining why it is classified as FORBIDDEN (such as "requires restart" or "will interrupt active SSH sessions"), with the reason coming from the check's forbiddenReason field.

SAFE_MODE environment variable KASTELL_SAFE_MODE controls destructive operations: MCP defaults to true (provision, destroy, restore are blocked); CLI defaults to false (all operations enabled); overriding with KASTELL_SAFE_MODE=true kastell destroy <server> will be rejected. Affected commands: init, destroy, backup-restore, snapshot-restore, snapshot-delete, restart, maintain.

v2.3 reliability contract Applies to the CLI and MCP server. Provisioning behavior: server_provision returns after the provider creates the server and Kastell persistently registers it; readiness.status may be pending, and you need to follow up afterward with server_info status or server_info health; the interactive kastell init command continues to wait for its existing readiness check. Automation contract: unsupported and failed CLI operations return exit code 1; valid empty results and user cancellation return 0; mixed --all failures return 1; audit --json and audit --ci reserve stdout for a single JSON payload.

Troubleshooting Server creation failed? Run kastell doctor --check-tokens to verify API tokens and the local environment. Server unresponsive? Use kastell status my-server --autostart to check platform status and automatically restart if needed, or use kastell health to check all servers at once. Need to start over? kastell destroy my-server completely removes the cloud server.

Use cases and limitations Suitable for operations and DevOps scenarios that require self-hosted server security auditing, hardening, compliance mapping, batch management, and AI agent integration. Limitations: requires Node.js 20 or higher; Linode support is in beta; more platforms in MCP platform setup (JetBrains, Windsurf, Gemini, etc.) are planned for v2.0; destructive operations require explicit flags in non-interactive environments; MCP blocks destructive operations by default. The project is licensed under Apache 2.0 and built by @omrfc.

Up/Down to navigate · Enter to open · ESC to closeBrowse all tools