Skip to content

feat(sealing): peer re-wrap, solidping seal and sealed config-as-code - #835

Merged
fclairamb merged 46 commits into
mainfrom
feat/todos-2026-11-10
Nov 10, 2026
Merged

fclairamb merged 46 commits into
mainfrom
feat/todos-2026-11-10

Conversation

@fclairamb

@fclairamb fclairamb commented Nov 10, 2026 •

Copy link
Copy Markdown
Owner

Requested by Florent · project thread

What changed

  • Sealed secrets: peer re-wrap (an online agent re-seals a check's blob for the current recipients; admin-only POST/GET /orgs/:org/sealing/rewrap, "Re-seal for the current agents" button in dash0), solidping seal, solidping agent region-key generate, "Paste a public key" in dash0, and sealedSecrets in config-as-code import/apply (SEALING_RECIPIENTS_CHANGED item error).
  • Agent-side opt-out of the re-wrap (spec 2026-11-10-04): SP_AGENT_REWRAP_ENABLED=false keeps the rewrap executor and capability off, so a compromised server cannot get secrets re-sealed to a key of its choice. When online key holders do not run the re-wrap, the outcome is rewrap_not_offered (en/fr/de/es) instead of no_online_recipient. The agent logs the fingerprints it sealed to. Default stays on.
  • New migration 033_v0_47_0 (worker_tasks.target_worker_uid). Re-seal needs agents built from this version.
  • Batch gate: envcheck exception for SP_SERVER_URL; e2e cleanup of private regions in browser-sealed-secrets.spec.ts.

⚠️ This branch includes a merge of open PR #834 (claude/private-agent-secrets-d22c9e), a prerequisite (phases 1–2): this PR carries its ~5,500-line diff until #834 is merged. Merge #834 first.

Decided by autopilot

  • No open questions in the spec; the "payload size" to-verify item was answered: no chunking needed (one task per check, <100 KiB).

🤖 Generated with Claude Code

https://claude.ai/code/session_01XE5BqoV7qsQrWXgxE3x1Xw

fclairamb and others added 27 commits November 8, 2026 00:51
Feasibility study and design, pending review. Seal check secrets in
dash0 with age for the org's private agents, so the server never
receives them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Per-check choice, optional org-wide required mode, no paid-tier
entitlement.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A region seals either to each agent's key (default) or to one region
key held by all its agents, so several agents need no re-seal.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ackend)

sealedSecrets on check create/PATCH, GET /orgs/:org/sealing-recipients,
origin on sealed envelopes, org setting security.browser_sealing.mode
(optional/required), claim filter on sealed fingerprints, shared region
keys (sealing.region_keys, PUT/DELETE /private-regions/:slug/region-key),
agent SP_AGENT_REGION_KEYS(_FILE) with multi-identity unseal and
region-key-<fp> claim capabilities.

Spec: specs/todos/2026-11-08-01-browser-sealed-check-secrets.md

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…settings

Check form: per-check encryption choice (browser pre-selected when every
region is private), sealing on submit with one retry on
SEALING_RECIPIENTS_CHANGED, lock badge with recipients. Private locations:
shared region key generation/rotation (secret shown once, only age1...
sent), agent sealing fingerprints. Settings: check secret encryption mode
and the checks to fix. /sealing-recipients now also returns the org mode.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…up spec

Phase 3 (peer re-wrap, solidping seal, region-key generate, sealedSecrets
in config-as-code) is filed as specs/todos/2026-11-10-03.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…e agents

Scoped gate: go build, golangci-lint --new-from-rev on changed packages,
go test -short on changed packages and importers, make build-dash0,
dash0 unit tests, lint:e2e, typecheck:e2e, make build-docs.
E2E spec authored, not run (Playwright browsers not installed locally).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ion, region key mode select, Re-seal page

- Replace opens every secret input of a browser-sealed check at once; they stay closed until then.
- Picking a shared region in browser mode empties the secret inputs.
- A required org disables shared regions once a secret is typed, and closes the secret inputs while a shared region is picked.
- The region key mode is a select (key per agent / shared region key).
- New Re-seal page (private locations) lists needsReseal checks, each opening its form in Replace mode (GET /orgs/:org/sealing/reseal-checks).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…e-seal list tests; regions checked first

- TestBrowserSealing_Postgres runs every browser-sealing scenario on one embedded Postgres (port 15742), a fresh org per case.
- Bulk region change: a browser-sealed check is a rejected item with its reason, the others move.
- ListResealChecks lists needsReseal checks once a new agent joins.
- sealedSecrets: the private-region rule runs before the shape and ciphertext checks, on create and PATCH (spec section 4 order).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Rebuild the edit URL from the detail path (it may carry a query string) and wait for the form before opening the authentication section.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Changelog entry (release-please owns CHANGELOG.md; this is the prose for the release PR pass, per wiki/conventions/changelog.md):

* **sealing:** check passwords for private locations can now be encrypted in your browser, for keys that only your own agents hold. SolidPing stores ciphertext it cannot open: the plaintext never reaches the server, not even in request bodies or logs. Pick "Encrypted in my browser" above a check's secret inputs when every region of the check is one of your private locations; "Encrypted by SolidPing" stays the default for everything else. Available on every plan.
* **sealing:** an organization can require browser encryption (Settings, Security: "Browser only"). The API then refuses plaintext check secrets (`SECRETS_MUST_BE_SEALED`), the check form disables shared regions once a secret is typed, and the settings page lists the checks still to fix.
* **private locations:** a private location can use one shared region key instead of a key per agent (`SP_AGENT_REGION_KEYS`), so adding or replacing an agent needs no re-seal. The key is generated in the browser and shown once; only its public half reaches the server.
* **private locations:** a new Re-seal page lists the checks whose sealed secrets no longer match their agents, each opening its form ready to type the secrets again.
* **api:** `GET /orgs/:org/sealing-recipients` and a `sealedSecrets` field on check create and update let scripts and the MCP tools seal with the age CLI. Notification integration tokens are not covered: SolidPing still reads them to send alerts.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
While the secret inputs are locked, the form drops every declared secret
key (and HTTP username/password), not only those holding a value. An add
then remove of a secret header row used to send secretHeaders: {}, which
the server reads as a clear and drops the sealed blob. The secret-header
key input, add and remove buttons are now locked like the other secret
inputs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@fclairamb fclairamb added autopilot frozen Batch PR under review: takes only its own fixes, new work goes to the next batch labels Nov 10, 2026
fclairamb and others added 9 commits November 10, 2026 16:50
Import and apply accept a sealedSecrets object per check, validated
exactly like the check write API: a stale recipient set is an item error
with code SEALING_RECIPIENTS_CHANGED and the current recipients, in the
dry run and the real run. Export keeps stripping secrets.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
"Re-seal for the current agents" on the location page (shared key with
stale checks), the Re-seal page and the needs-re-seal alert of a check
(admins). It starts a peer re-wrap, polls it and lists each check that
could not be re-sealed with its reason. "Paste a public key" sets a
region key generated offline with solidping agent region-key generate.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ledSecrets in documents

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… seal and config-as-code

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…tays single-region (batch gate)

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@fclairamb
fclairamb marked this pull request as ready for review November 10, 2026 16:46
@fclairamb fclairamb changed the title docs(specs): sealed secrets peer re-wrap and CLI feat(sealing): peer re-wrap, solidping seal and sealed config-as-code Nov 10, 2026
fclairamb and others added 4 commits November 10, 2026 17:48
… fixed second

goja finds every match of a global regexp before expanding any replacement,
so the refusal itself costs that matching (0.08s here, 1.007s on a loaded CI
runner). The bound is now one second plus five times the same matching run
without the refused template, measured right before.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
SP_AGENT_REWRAP_ENABLED=false keeps the rewrap executor and capability off
on an agent, so a compromised server cannot get secrets re-sealed to a key
of its choice. The server reports rewrap_not_offered when online key holders
do not run the re-wrap, and the agent logs the fingerprints it sealed to.

Spec 2026-11-10-04.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01XE5BqoV7qsQrWXgxE3x1Xw
@fclairamb fclairamb added automerge and removed autorelease labels Nov 10, 2026 — with Claude
@fclairamb
fclairamb enabled auto-merge (squash) November 10, 2026 18:21
fclairamb added a commit that referenced this pull request Nov 10, 2026
Check secrets can now be encrypted in the browser, so a check that runs
only on private agents never sends its passwords to the SolidPing
server. Server-side encryption stays available, chosen per check.

Spec: `specs/done/2026/11/2026-11-08-01-browser-sealed-check-secrets.md`
(phases 1 and 2).

## What changed
- **Browser mode per check.** dash0 seals the secrets with typage
(`[email protected]`, lazy loaded, CSP unchanged) to the region's
recipients and sends `sealedSecrets`. The server checks regions, keys,
ciphertext shape and fingerprints (`409 SEALING_RECIPIENTS_CHANGED` with
the current list, dash0 re-seals once) and stores `origin: browser`.
- **Org setting** `security.browser_sealing.mode`: `optional` (default)
or `required` (`400 SECRETS_MUST_BE_SEALED`). The settings card lists
the checks that don't comply.
- **Shared region key**, opt-in per private region: generated in dash0
and shown once. Agents load it from `SP_AGENT_REGION_KEYS` /
`SP_AGENT_REGION_KEYS_FILE` and advertise `region-key-<fp>`. A region
can run several agents without re-sealing.
- **Claim filter:** an org agent no longer claims a sealed job it can't
open. Before, it claimed and failed it.
- **dash0:** encryption choice in the check form, lock badge, Replace
button, Re-seal page, region key mode select, both agent fingerprints on
the agents page, design reference entry, en/fr/de/es.
- **API:** `GET /orgs/:org/sealing-recipients`, `GET
/orgs/:org/sealing/noncompliant-checks`, `GET
/orgs/:org/sealing/reseal-checks`, `PUT|DELETE
/private-regions/:slug/region-key`. MCP `create_check` / `update_check`
accept `sealedSecrets`.
- **Docs:** new page `features/browser-sealed-secrets`.
- **Batch gate fix:** `organization-settings.spec.ts` waited too little
for the settings refetch (race older than this branch).

## Behaviour changes
- On server-sealed-only checks, a PATCH with partial plaintext secrets
now gets `400 VALIDATION_ERROR` instead of silently dropping the missing
keys.
- The capability is spelled `region-key-<fp>` (the capability validator
allows only `[a-z0-9-]`), not `region-key:<fp>` as the spec said.

## Follow-up
Phase 3 (peer re-wrap, `solidping seal`, `solidping agent region-key
generate`, `sealedSecrets` in config-as-code) is filed as
`specs/todos/2026-11-10-03-sealed-secrets-peer-rewrap-and-cli.md` on the
batch PR #835.

## Tests
`make build-backend lint-back test` green, non-short Postgres for
`checkjobsvc`, `agentws`, `handlers/checks` green, full Playwright suite
1008 passed / 0 failed / 15 skipped on a side-car.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
# Conflicts:
#	server/internal/app/server.go
#	server/internal/checkworker/backend/ws.go
#	server/internal/crypto/credentials/sealing.go
#	server/internal/handlers/checks/browser_sealing.go
#	server/internal/handlers/checks/browser_sealing_handler.go
#	server/internal/handlers/checks/browser_sealing_postgres_test.go
#	web/dash0/e2e/browser-sealed-secrets.spec.ts
#	web/dash0/src/api/hooks.ts
#	web/dash0/src/components/shared/region-key-cell.tsx
#	web/dash0/src/lib/sealing.ts
#	web/dash0/src/locales/de/org.json
#	web/dash0/src/locales/en/org.json
#	web/dash0/src/locales/es/org.json
#	web/dash0/src/locales/fr/org.json
#	web/dash0/src/routes/orgs/$org/checks.$checkUid.index.tsx
#	web/dash0/src/routes/orgs/$org/organization.private-locations.reseal.tsx
#	web/docs/docs/features/browser-sealed-secrets.md
#	wiki/features/deported-agents.md
@fclairamb
fclairamb merged commit 91c656a into main Nov 10, 2026
35 of 36 checks passed
@fclairamb
fclairamb deleted the feat/todos-2026-11-10 branch November 10, 2026 19:09
fclairamb added a commit that referenced this pull request Nov 10, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.47.0](v0.46.0...v0.47.0)
(2026-11-10)


### Features

* **sealing:** browser-sealed check secrets for private agents
([#834](#834))
([00c376c](00c376c))
* **sealing:** peer re-wrap, solidping seal and sealed config-as-code
([#835](#835))
([91c656a](91c656a))


### Bug Fixes

* **ci:** leave the tag on HEAD out of the upgrade matrix
([#830](#830))
([d333957](d333957))
* **deps:** update github.com/dop251/goja digest to a443384
([#836](#836))
([bbfb783](bbfb783))
* **deps:** update module github.com/posthog/posthog-go to v1.42.2
([#837](#837))
([cf8fffc](cf8fffc))
* **security:** trusted service binary and data folder paths, skip
deleted orgs' SLO burn policies
([#833](#833))
([5315038](5315038))
* **status:** mobile header truncation and dotted response-time chart
([#831](#831))
([0c974de](0c974de))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: Claude Sonnet 5.5 <[email protected]>
fclairamb added a commit that referenced this pull request Nov 11, 2026
…aps, drop deleted regions' keys, TLS-only agent server URL (#840)

Security scan of 2026-11-11 on the browser-sealed check secrets (#834,
#835): all four findings are implemented.

## What changed

- **AJ1 (Medium)**: a sealed blob is bound to the check's type and
target fields (`_binding`, shared Go/TS digest fixture). The agent
refuses a retargeted check or a blob overriding a public field. The
server answers 409 `SEALED_TARGET_CHANGED` on PATCH, apply and import.
dash0 reopens the secret inputs on a target edit. Legacy unbound blobs
are accepted with a warning and listed on the Re-seal page.
- **AJ2 (Medium)**: peer re-wrap now needs a possession challenge, only
secret-field keys in a sealed plaintext, and a confirmation by a second
recipient (`rewrap_verify`); without a second agent online the blob is
stored flagged `unconfirmed`. Duplicate agent keys are refused at
enrollment. Retired region keys are kept (public part only).
- **AJ3 (Low)**: deleting a private region removes its shared region
key; orphaned keys are no longer returned.
- **AJ4 (Low)**: an agent refuses a non-TLS server URL outside loopback
unless `SP_AGENT_ALLOW_INSECURE_SERVER=true`, which also turns re-wrap
off by default.
- Batch gate fix: the duplicate-key check still sees keys of deleted
regions.

**Breaking**: `solidping seal` now requires `--type` and
`--config-json`; agents older than 0.48 are not picked for re-wrap; an
`http://` agent URL to a non-loopback host no longer starts; editing a
target field of a sealed check requires the secrets again.
`client_generated.go` not regenerated (per-batch convention).

## Decided by autopilot

- Spec 01, unbound legacy blobs: accept with a warning and list them on
the Re-seal page; refuse them in the next minor (recommended answer).

Gate: build, lint, `make test`, dash0 typecheck/lint, Playwright 1011
passed / 0 failed / 15 skipped (SQLite side-car).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automerge autopilot autorelease frozen Batch PR under review: takes only its own fixes, new work goes to the next batch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants