clusev/app/Models
boban 4c67b278bd fix(docker): admin-gate the host target + honour a "0" key passphrase (Codex review)
Two findings from the Codex review of the host-Docker changes:

1. Under-gated host target (security). Listing/actioning/log-reading the
   CLUSEV HOST's containers only required `operate`, but the host is the
   control-plane machine — a `Stop` on clusev-mariadb takes Clusev down —
   and the host TERMINAL is already `manage-fleet`-only. Align it:
   - effectiveTarget() resolves to the host only for manage-fleet users;
     everyone else is pinned to a fleet server (no host default, no toggle).
   - action()/viewLogs() and the ContainerLogs host sentinel (serverId 0)
     now abort_unless manage-fleet.
   A viewer/operator can no longer reach the host, even by forcing
   target=host.

2. HostCredential::toServer() dropped a key passphrase equal to the string
   "0" via a falsy `if ($this->passphrase)` check, which would break key
   auth. Use an explicit null/'' check.

Added tests: non-admin never targets the host, a forced target=host still
hits a fleet server, operator cannot open host logs. 751 tests green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-05 23:43:18 +02:00
..
AlertIncident.php feat(alerts): threshold alerting + notifications (feature 2/8) 2026-07-05 20:07:54 +02:00
AlertRule.php feat(alerts): threshold alerting + notifications (feature 2/8) 2026-07-05 20:07:54 +02:00
AuditEvent.php feat(honeypot): surface login attempts in the dashboard (threats KPI, tried-credentials, sidebar badge) 2026-07-05 10:49:38 +02:00
BannedIp.php feat(auth): BannedIp model + migration 2026-06-20 17:26:28 +02:00
CertEndpoint.php feat(security): TLS certificate expiry monitoring (feature 7/8) 2026-07-05 20:57:53 +02:00
HealthCheck.php feat(uptime): HTTP/TCP health checks + status board (feature 8/8) 2026-07-05 21:04:14 +02:00
HostCredential.php fix(docker): admin-gate the host target + honour a "0" key passphrase (Codex review) 2026-07-05 23:43:18 +02:00
MetricSample.php feat(metrics): persistent resource-history graph on the Server-Details page 2026-06-25 01:31:27 +02:00
Runbook.php feat(commands): ad-hoc fleet commands + runbooks (feature 4/8) 2026-07-05 20:38:09 +02:00
Server.php feat(fleet): server groups — organise the fleet + filter (feature 1/8) 2026-07-05 19:36:17 +02:00
ServerGroup.php feat(fleet): server groups — organise the fleet + filter (feature 1/8) 2026-07-05 19:36:17 +02:00
Setting.php feat(security): dashboard hardening, credential mgmt, system domain/TLS + channel, self-hardening 2026-06-13 02:25:23 +02:00
SshCredential.php chore(audit): full code sweep — fix open-redirect, drop dead code, clean docs 2026-06-13 12:54:26 +02:00
TerminalSession.php security: harden proxy trust + model mass-assignment + terminal-token log hygiene 2026-06-26 07:16:10 +02:00
User.php feat(rbac): role enum + column + gates foundation (admin>operator>viewer) 2026-07-05 00:42:16 +02:00
WebauthnCredential.php fix(webauthn): hash-indexed credential ids + reset keys on 2FA disable 2026-06-14 18:40:24 +02:00
WgTrafficSample.php feat(wg): wg_traffic_samples table + model 2026-06-20 23:59:11 +02:00