Skip to content

feat: batch 2026-07-16 — deported agents, SSH tunnels everywhere, incident comments, OAuth self-revocation, and a critical secrets-leak fix - #145

Merged
fclairamb merged 194 commits into
mainfrom
batch/2026-07-16
Jul 18, 2026
Merged

fclairamb merged 194 commits into
mainfrom
batch/2026-07-16

Conversation

@fclairamb

@fclairamb fclairamb commented Jul 16, 2026 •

Copy link
Copy Markdown
Owner

Summary

Batch integration of two /implement-todos runs on batch/2026-07-16 — 12 specs, each
implemented on the batch branch, gated by an independent completeness audit, and archived to
specs/done/2026/07/. A curated ## Unreleased section has been added to CHANGELOG.md.

⚠️ Most important: an active credential leak is fixed in this PR

With SP_ENCRYPTION_MASTER_KEY unset, GET/LIST responses on checks and integration
connections returned secrets (SSH private keys, HTTP basic-auth passwords, connection tokens)
in plaintext to any org member, including viewers. Two real-looking credentials were found
exposed this way on the dev instance during this work. The fix makes secret/public config
separation unconditional in every storage mode. If you run with encryption disabled, rotate
any check/integration credentials configured before this deploys.

Features

  • Private locations (deported agents) — monitor infrastructure with no inbound access by
    running an agent inside your own network. Single-use spe_ enrollment token, agent-generated
    keys, outbound-only WebSocket, Ed25519 reconnect signatures, region-sealed credentials (age
    X25519). Registering an agent is now a guided wizard (pick/create region → mint token →
    copy-paste docker run/compose/Kubernetes snippets → live wait-for-connection), not a bare
    token. The agent itself now proactively reconnects with backoff, pings for liveness, and fails
    in-flight requests fast on disconnect instead of silently going dark or blocking 30s.
    ⚠️ Breaking: the unused HTTP edge-worker API, plaintext spw_ worker tokens, and the
    workers.token column are removed.

  • SSH tunnels — now 18 check types, and works on deported agents — extended from http/tcp
    only to databases (postgres, mysql, mssql, oracle), brokers (redis, mongodb, rabbitmq, kafka),
    and more (smtp, imap, pop3, ssl, grpc, websocket, ftp, mqtt). The SSH/SFTP check form now exposes
    the private-key and host-key-fingerprint fields directly. Tunnels now also work when the
    dependent check is dispatched to a deported agent — the bastion's sealed credentials ship to
    the agent verbatim (never re-encrypted, never exposed to the server on this path); the
    referenced SSH check must be allocated to the dependent's private region(s). Plus UX polish:
    deep-linked empty state, clearer disabled-option copy, a "via <bastion>" list indicator.

  • Incident comments — comment from the incident page, or reply in the Slack thread SolidPing
    posted for the incident and it's ingested back as a comment (reverse thread lookup), with
    retry-safe dedupe.

  • OAuth/MCP grant self-revocation — a standards-compliant RFC 7009 POST /api/v1/oauth/revoke,
    a bearer-only DELETE /api/v1/auth/tokens/current for clients without their refresh token,
    isCurrent marking on the token list, and sp auth logout revoking server-side before clearing
    local credentials.

  • Server — unrecognized SP_* env vars now warn at startup instead of failing silently.

Bug Fixes

  • Secrets leak via API (see above) — unconditional secret/public config separation, startup
    migration of pre-existing leaky rows, defense-in-depth read redaction, and a tripwire test over
    every checker's declared secret fields.
  • Encrypted checks ran without their secrets — the in-process worker only read the public
    half of the config; secrets are now decrypted and merged at the claim boundary, and a job whose
    envelope can't be opened is dropped + reported as an explicit error rather than silently
    executed credential-less.
  • Secrets were written to the logs — the per-execution log line printed config verbatim;
    secret-declared values are now redacted.
  • HTTP basic auth encrypted at rest — folded into a single encrypted basicAuth key instead
    of a cleartext username in the public config. ⚠️ Breaking for API consumers reading
    config.username/config.password directly (lazy migration, no backfill).
  • Incidents auto-resolved on first success, ignoring the configured recovery period, due to a
    recovery clock shared across consecutive incidents — now scoped to the incident it resolves.
  • Checks page request fan-out — one request per check-group per realtime tick drove rate-limit
    pressure; now batched into a single query, and the retry policy honors Retry-After on 429.
    Paired with raised default rate-limit ceilings so normal dashboard use never 429s.
  • Deported-agent WebSocket reconnect — silent disconnects, lazy reconnect, and 30s-blocking
    in-flight requests on a dead connection; see Features above.
  • Dashboard live WebSocket auth — authenticated only via a cookie another same-host app could
    shadow (browsers ignore ports); now authenticates the same way REST does, via a bearer token
    carried as a WS subprotocol.

QA

  • Per-spec scoped gates: backend make build-backend lint-back test; dash0 build + lint (no new
    errors); unit + Playwright E2E per surface touched.
  • make lint-back is green (0 issues).
  • Every spec passed an independent completeness audit before archiving — several came back
    gaps on the first pass and went through a fix round before clearing, which is how real issues
    were caught on code whose build/lint/test were already green (e.g. a 5s blocking close-handshake
    masking the half-open reconnect fix; the secrets-leak spec's own tripwire heuristic gaps).
  • The security-sensitive specs (secrets-never-exposed, SSH tunnels on deported agents, OAuth
    self-revocation) were audited with security-review rigor: negative controls, black-box
    wire-protocol proofs that private config never crosses to agents, and claim-time
    re-verification of eligibility rather than trust in validation-time state.
  • origin/main merged in twice (Renovate's gosnmp bump; go.sum regenerated with go mod tidy).
  • Commit history was redated via /git-past (daytime commits shifted to 19:47, content unchanged
    — verified via git diff against a pre-rewrite backup tag).

Follow-ups (deliberately not in this batch)

  • Rotate the two credentials found exposed on the dev instance during the secrets-leak spec
    (flagged separately, out of scope for a code change).
  • Widen the checker secret tripwire further if new field-naming conventions emerge.

🤖 Generated with Claude Code

fclairamb added 30 commits July 16, 2026 19:47
The re-arm was justified with a worker->server clock-skew scenario that
the architecture cannot produce: result.PeriodStart is never
worker-supplied (SubmitResultRequest carries no timestamp) and every
production path stamps it with time.Now() in the same process that then
calls ProcessCheckResult. For reopens the floor is LastReopenedAt =
s.clock.Now(), the same clock as the recovery clock.

The re-arm is still load-bearing, for the reason recorded alongside it:
an incident already open when this ships carries a clock the
clear-on-open never ran for, which the read-side guard would reject
forever and a nil-only write side would never replace. That is what
makes the no-backfill decision sound. No logic change.
Drives ProcessCheckResult against an injected fake clock (no sleeps, no
wall-clock dependence) over open -> success -> resolve -> open again ->
success, on both the per-check and group paths. Each of the five
regression tests fails against the pre-fix state machine; the
no-regression guards (single-incident recovery, recovery=0) pass on
both.
An incident could auto-resolve on its very first success, ignoring the
configured recovery period, because check.first_success_since_failure_at
survived from a previous incident: it was only ever cleared by a failure
arriving while an incident was already open.

Three changes make the clock incident-scoped:

- deriveIncidentClocks clears it on the failure branch that opens (or
  reopens) an incident, making it symmetric with FirstFailureAt.
- A success re-arms a clock that predates the incident's onset instead of
  honoring it, so rows already carrying a stale value self-heal.
- recoveryElapsed takes the incident and ignores any clock older than its
  onset (LastReopenedAt, else StartedAt) — per-check and group paths alike.
fclairamb and others added 21 commits July 18, 2026 19:47
… an SSH tunnel — the classic bastion use cases (databases, queues) cannot
… (region-allocated SSH check, sealed dispatch)
… SSH tunnel — the classic bastion use cases (databases, queues) cannot
…rough an SSH tunnel — the classic bastion use cases (databases, queues) cannot
…ess_token cookie

The dashboard's live hint WebSocket authenticated its handshake solely with
the same-origin access_token cookie. Cookies ignore ports, so any other app
on the same host (observed: iss=realassets on localhost) can plant its own
access_token cookie that shadows ours — the handshake then 401s forever
while REST, which uses the Authorization header, keeps working, and the
client reconnect-loops without ever recovering.

The SPA now offers ["bearer.<jwt>", "solidping.v2"] as WebSocket
subprotocols (browsers cannot set an Authorization header on an upgrade);
the server reads the token from the bearer.* entry and negotiates the plain
solidping.v2 back. Precedence: Authorization header > bearer subprotocol >
cookie (kept as a fallback for cookie-based clients). The socket now uses
the exact token the REST client uses, so the two can never disagree.

Rejected handshakes are now logged (error code, offered transports, and the
token's unverified iss — which is what identified the foreign cookie).

Co-Authored-By: Claude Fable 5 <[email protected]>
@fclairamb fclairamb changed the title feat: batch 2026-07-16 — deported agents with sealed credentials, SSH tunnels, encrypted basic auth, and two credential-handling fixes feat: batch 2026-07-16 — deported agents, SSH tunnels everywhere, incident comments, OAuth self-revocation, and a critical secrets-leak fix Jul 18, 2026
@fclairamb
fclairamb marked this pull request as ready for review July 18, 2026 23:12
@fclairamb
fclairamb enabled auto-merge (squash) July 18, 2026 23:13
@fclairamb
fclairamb merged commit 994bc85 into main Jul 18, 2026
11 checks passed
@fclairamb
fclairamb deleted the batch/2026-07-16 branch July 18, 2026 23:29
@fclairamb fclairamb mentioned this pull request Jul 17, 2026
fclairamb added a commit that referenced this pull request Jul 19, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.5.0](v0.4.1...v0.5.0)
(2026-07-19)


### Features

* batch 2026-07-16 — deported agents, SSH tunnels everywhere, incident
comments, OAuth self-revocation, and a critical secrets-leak fix
([#145](#145))
([994bc85](994bc85))
* batch 2026-07-19 — escalation org default + assignment picker,
migration consolidation
([#148](#148))
([bb585a8](bb585a8))


### Bug Fixes

* **deps:** update dependency docusaurus-plugin-llms to ^0.5.0
([#147](#147))
([1d30a78](1d30a78))
* **deps:** update go dependencies (non-major)
([#139](#139))
([6906133](6906133))
* **deps:** update module github.com/go-ldap/ldap/v3 to v3.4.14
([#141](#141))
([b7166d6](b7166d6))
* **deps:** update module github.com/gosnmp/gosnmp to v1.44.0
([#144](#144))
([a1c5897](a1c5897))
* open v3 plaintext envelopes before the enabled-gate in sshtunnel and
freebox resolvers
([#149](#149))
([4223bdb](4223bdb))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
This was referenced Sep 8, 2026
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