← Back to Pull requests

q-20: no sshd on a production KMS host: sshd_absent control, no SSH admit rule (regalia-kms-r1s.12) #791

Open
unknown opened this pull request with 650 lines diff across 8 files
View on GitHub
unknown unknown commented on Nov 25, 2026 13:44 UTC
Author

Bead: regalia-kms-r1s.12. Ruling: q-20: ABSENT, GA ruling under owner delegation 2026-11-25. A production KMS host runs no SSH server. It is administered through the console or the iLO, and through the owner-run flows.

Changes


  • Firewall. firewall.py no longer admits SSH from admin_cidrs. The admin zone keeps ping and nothing else. network_probe.py expects ssh_port closed from every zone, the admin zone included. Other uses of admin_cidrs are unchanged: the ping rule, the sitecfg checks, the admin role and bootcreds.

  • New measured control, os_probe.sshd_absent. It is in MEASURED, so the signed evidence carries it. It fails if:

  • - an SSH server binary is present (sshd, sshd-session, sshd-auth, Dropbear, or sshd on PATH);
    - an SSH server's unit file exists (ssh., ssh@, sshd, dropbear), enabled or not;
    - anything listens on TCP :22.

    If a read gets no answer, the control fails.

  • Staging is unchanged. The staging variant's operator sshd still needs regalia.staging=1 and the staging install's files under /var. A staging host fails sshd_absent by design, and the reason names the variant. The staging firewall is a ready-made per-host file from the private staging bundle; firewall.py does not re-render it.

  • Docs. SSH.md records the ruling and replaces the admit-from-admin_cidrs text. README, the host_probe docstring and the single-node inventory are updated to match.
  • Tests


  • Firewall: no SSH port is opened, even with a non-22 ssh_port; the admin zone's only rule is ping; port counts are updated (bootnet too).

  • os_probe, SshdAbsent: one fake host per failure (6 binary cases, 8 unit lines, 5 :22 listener forms), each failing sshd_absent and no other control. Also: a clean host passes, the fail-closed reads, every problem named, staging, the staging unit still gated, and SSH.md citing q-20.

  • e2e netns: :22 is reachable from no zone.
  • Heavy proof (owner pre-run rule; bar amendment 7)


    A shared runner pool (run id kept in the private evidence), at HEAD f16e8d30023206b0dd6cfc79c947e96675c6c674.

    Amendment 7.

  • FAR_TREE e62ea0d82479bb1352134157234836e988665f84, printed far-side.

  • The local rebuild (head tree minus the 22 refused paths, list sha256 572cbc90a6e6348f48ad099eeb0b72f22af5e89a6bf41e41ede37985e4efc829) gives e62ea0d8…: a match.

  • git diff --name-only equals the refused list exactly.
  • Environment.

  • SigIgn: far side 0000000000000001; the exec'd runner shows 0000000000000000 (env --default-signal, coreutils 9.7).

  • memBound 32% at start.
  • Python packages (GA interim rule). A per-run venv outside the checkout, built only from regalia-kms #790's committed lock at e8faa740.

  • Lock sha256 1a045b7b0e635b2e6cf3e61fd6fd2936ffa817cdcb5b361088cb8e29dad1ca1c.

  • --require-hashes --no-deps.

  • Freeze sha256 5a3efecd6be80d8791026f8732f6f23532b470244ce89d686e971844e07d4de2 (PyYAML 6.0.3, cryptography 50.0.1, cffi 2.1.1, pycparser 3.0; Python 3.13.5).
  • Suite. ONE invocation of the 18 modules that import firewall, os_probe, network_probe, sitecfg or host_probe, plus python_isolation and threenode_topology. Result: Ran 465 tests, OK (skipped=57), rc=0. The skip reasons were not captured, because heavy deletes the run dir. CI's discover names every skip.

    Mutants, each killed by named tests.

    | Mutant | Killed by |
    |---|---|
    | M1, sshd binary ignored | test_an_sshd_binary_fails_it (all cases), test_a_read_that_does_not_answer_fails_it |
    | M2, :22 listener ignored | test_a_listener_on_port_22_fails_it (cases 0–4) |
    | M3, firewall admin SSH rule re-added | test_no_zone_is_admitted_to_ssh, test_outbound_only_to_declared_sinks, test_the_running_hosts_firewall_opens_the_mesh_to_declared_addresses_only |
    | M4, unit check removed | test_an_ssh_unit_fails_it (all cases), test_a_read_that_does_not_answer_fails_it |

    Not done (follow-ups)


    drill.py's ssh_runner and the chain copy in MEMBERSHIP-RECOVERY.md still assume SSH.

    🤖 Generated with Claude Code

    Independent review fixes (MUSTs 1–5) and pre-run evidence

  • 8373cb4b: sshd_absent finds an SSH server by what units run and listen on (renamed or masked units, an SSH server's program recognised by path, name or contents, a socket on TCP :22). Only ENOENT counts as absence, per path. A failing systemctl or a malformed kernel TCP table fails closed. sitecfg reserves TCP :22 whatever ssh_port says. firewall_default_deny fails while the loaded rules or the persisted fragment still admit :22. The README covers rollout for hosts enrolled before q-20.

  • be2f74a9: the netns e2e also renders ssh_port 2222 and checks that neither 22 nor 2222 opens from any zone. A liveness check requires all 16 of that section's checks to have run and passed.

  • Pre-run in a shared runner pool, at each exact head, before each push:

  • - 8373cb4b: full unittest discover, Ran 3403. Every non-pass is on the declared environment list, none outside it. 9/9 mutants killed by named assertions. Log sha256 4d8ac69dc136d0a4ad1b6cb23e7f811a73b9438341611ea96cbc794405be108c.
    - be2f74a9: Ran 3403, the same declared non-passes. bash -n and shellcheck (severity error) clean. Log sha256 39403abcf22e02915d1a3146f51bb150d4789f8c771cdec5ba7c0c12a4d1ae18.
  • Hosted at 8373cb4b: build-test Ran 3403 (3383 ok, 20 skip), and baremetal-firewall-netns 66 passed, 0 failed.

  • The production break-glass path without SSH (MUST 6) is tracked separately in regalia-kms-fvg.
  • <!-- This is an auto-generated comment: release notes by coderabbit.ai -->
    <!-- coderabbit-ai-generated:v1 -->

    Summary by CodeRabbit

    Security
    Production bare-metal hosts do not accept SSH connections from any network zone. Admin access is limited to ping, and recovery guidance directs operators to the console or iLO.
    Host checks flag installed SSH servers, SSH service configurations, port 22 listeners, and loaded or persisted firewall rules that may allow SSH. Port 22 is reserved, and staging SSH remains separate.
    Documentation
    Updated deployment, recovery, and drill guidance to distinguish production and staging access procedures.
    Tests
    Added checks for SSH restrictions across network zones and for missing or incomplete host evidence.
    <!-- end of auto-generated comment: release notes by coderabbit.ai -->

    Diff: 650 lines (+487 / -163) across 8 files Reviewer: jobordu Review duration: 15036m
    All Vouch review confidence checks passed
    Residual risk 0.28 = Change Risk (0.52) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.52 · 650 lines diff across 8 files
    0.52
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.388
    Shallow Review Depth shallow_review_depth
    0.344
    Real PR Conversation Timeline
    1 comments
    "Review active on #791"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 52% (MEDIUM) · Higher = larger blast radius
    52%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 46.7% · Lower = rushed or shallow review
    46.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 27.7% · Safe to merge
    27.7%