Skip to content

v0.75.1: Admin → Security — ephemeral UDP sockets, SSH ordering, accepted risks - #188

Open
agit8or1 wants to merge 1 commit into
mainfrom
v0.75.1-security-accepted-risks
Open

agit8or1 wants to merge 1 commit into
mainfrom
v0.75.1-security-accepted-risks

Conversation

@agit8or1

Copy link
Copy Markdown
Owner

Patch release 0.75.1 (codename unchanged, Spanner): two fixes to the 0.74.0 Admin → Security posture page, at the owner's request after reading it in production. Full detail in the CHANGELOG entry and docs/server-security.md.

1. False positives

  • Listening ports. udp/33344 was hbbs's own outbound socket: UNCONN, bound without naming a port, so the kernel picked one from ip_local_port_range (32768–60999 here). An unconnected UDP socket on a port inside that range is now an ephemeral client socket. It is shown on an information line (network.ephemeral_sockets), not as an unexpected listener. TCP, and UDP outside the range, are judged as before. An unreadable range excuses nothing. ss runs as ss -Htlnup as reboot, with no sudo, so it names owners only for the service user's own sockets.
  • SSH. The 0.74 parser already applied first-match-wins in sshd's order. Run against this host's real files, it reads PermitRootLogin no from 40-rem0te.conf as certain, because that file is read before the root-only 50-cloud-init.conf. PasswordAuthentication stays Unknown, correctly: its first readable value comes after the unreadable file. Changes:
    • each value records the unreadable files read before it, and the evidence names only those;
    • eight ordering fixtures cover the cases.

2. Accepted risks

  • POST /admin/security/findings/:id/accept takes {reason 3–300, expiresInDays? 1–365, fingerprint?}.
    • It requires Platform Admin, then assertFresh with server.security.
    • It is recorded with logOrFail as SECURITY_FINDING_ACCEPTED.
    • DELETE re-opens and never asks for fresh auth. GET findings/acceptances returns the history.
  • Each acceptance is bound to a fingerprint of the finding's evidence basis. The basis is the offending sockets, the sshd value and its file, package versions and so on, never the wording or the time of the reading. The acceptance re-opens on its own, audited with a cause, when:
    • the evidence changes (evidence_changed);
    • the check resolves (resolved);
    • it expires (expired).
  • An accepted finding keeps its status and is never shown as OK. It sits in a collapsed Accepted risks section showing who, when, why and the expiry. It adds no score penalty and is counted as accepted. Coverage does not change.
  • Never acceptable:
    • a Platform Admin without MFA;
    • a break-glass account without both factors;
    • an audit chain that does not verify;
    • SSH accepting empty passwords;
    • NODE_ENV set to anything but production;
    • any process.switch.*;
    • any web.tls.*.
  • Migration 0093_security_risk_acceptance. 0092 is already taken by v0.76.0 Litmus: the read-only diagnostics palette (stacked on #186) #187. It adds:
    • CHECKs on the closed list of 30 finding ids, the reason, the expiry and the reopen cause;
    • one open row per finding;
    • two ActivityAction values.

Tests

  • unit-host-security.mjs: 123 passed.
  • e2e-host-security.mjs: 155 passed (scratch API on 3991–3994). It covers:
    • 403 for a Business Owner and 401 with no session;
    • the step-up enforced while the confirm row is ask;
    • 13 refusals;
    • audit rows;
    • the DB CHECKs;
    • expiry;
    • a fourth API whose host changed (re-opening).
  • e2e-ui.mjs: the accept dialog in each combination (refusal, step-up, Accepted risks, Re-open, phone width, no console errors).
  • §84 extended. check-security-invariants, check-versions, lint and typecheck pass. API-REFERENCE.md was regenerated and --check matches all 639 runtime routes.

Not merged and not deployed. Deploying needs migration 0093 plus the Prisma client regenerated at the target.

🤖 Generated with Claude Code

…, accepted risks

- Listeners: an unconnected UDP socket on a port inside the kernel's
  ephemeral range (ip_local_port_range) is an ephemeral client socket
  (hbbs's udp/33344), shown as information, not an unexpected public
  listener. ss runs as `ss -Htlnup` (no sudo) and names owners the service
  user can see.
- SSH: first-match-wins across Include'd drop-ins verified against this
  host (40-rem0te.conf decides PermitRootLogin for certain); each value
  names the unreadable files read before it; fixtures for every ordering.
- Accepted risks: Platform Admin accepts one finding with a reason (3-300)
  and optional expiry (<= 365 days), after assertFresh (server.security),
  recorded with logOrFail. Re-opening never asks. An acceptance is bound to
  a fingerprint of the evidence and re-opens on its own when it changes,
  the check resolves or the expiry passes. Never acceptable: a Platform
  Admin without MFA, break-glass without both factors, the audit chain,
  empty SSH passwords, NODE_ENV, test switches, TLS. Migration 0093.
- §84 extended; unit, e2e and browser suites; docs, /help, API reference.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant