8000 feat(bep): rotate the signing certificate over the control socket by minimal-foundry[bot] · Pull Request #2545 · gominimal/minimal · GitHub
[go: up one dir, main page]

Skip to content
{"props":{"contextRegion":{"crumbs":[{"crumb_type":"organization","label":"gominimal","is_root":false,"href":"/gominimal"},{"crumb_type":"repository","label":"minimal","is_root":false,"href":"/gominimal/minimal"}],"localNavigation":[{"id":"code","icon":"code","label":"Code","href":"/gominimal/minimal","selectedLinks":["repo_source","repo_downloads","repo_commits","repo_releases","repo_tags","repo_branches","repo_packages","repo_deployments","repo_attestations"],"popoverTarget":false,"commandId":"repositories:go-to-code","reactNav":{"appTarget":"code-view","anchor":"code-view-repo-link"},"turboNav":{"frame":"repo-content-turbo-frame"}},{"id":"issues","icon":"issue-opened","label":"Issues","href":"/gominimal/minimal/issues","selectedLinks":["repo_issues","repo_labels","repo_milestones"],"count":240,"popoverTarget":false,"commandId":"repositories:go-to-issues","reactNav":{"appTarget":"repo","anchor":null},"turboNav":{"frame":"repo-content-turbo-frame"}},{"id":"pull-requests","icon":"git-pull-request","label":"Pull requests","href":"/gominimal/minimal/pulls","selectedLinks":["repo_pulls","checks"],"count":31,"popoverTarget":false,"commandId":"repositories:go-to-pull-requests","reactNav":{"appTarget":null,"anchor":null},"turboNav":{"frame":"repo-content-turbo-frame"}},{"id":"discussions","icon":"comment-discussion","label":"Discussions","href":"/gominimal/minimal/discussions","selectedLinks":["repo_discussions"],"popoverTarget":false,"commandId":"repositories:go-to-discussions","reactNav":{"appTarget":null,"anchor":null},"turboNav":{"frame":"repo-content-turbo-frame"}},{"id":"actions","icon":"play","label":"Actions","href":"/gominimal/minimal/actions","selectedLinks":["repo_actions"],"popoverTarget":false,"commandId":"repositories:go-to-actions","reactNav":{"appTarget":"repo","anchor":null},"turboNav":{"frame":"repo-content-turbo-frame"}},{"id":"security-and-quality","icon":"shield","label":"Security and quality","href":"/gominimal/minimal/security","selectedLinks":["security","overview","alerts","policy","token_scanning","code_scanning"],"count":0,"popoverTarget":false,"commandId":"repositories:go-to-security","reactNav":{"appTarget":null,"anchor":null},"turboNav":{"frame":"repo-content-turbo-frame"}},{"id":"insights","icon":"graph","label":"Insights","href":"/gominimal/minimal/pulse","selectedLinks":["repo_graphs","repo_contributors","dependency_graph","dependabot_updates","pulse","people","community"],"popoverTarget":false,"commandId":"repositories:go-to-insights","reactNav":{"appTarget":null,"anchor":null},"turboNav":{"frame":"repo-content-turbo-frame"}}],"localNavigationUpdateChannel":null,"selectedLink":"repo_pulls"},"owner":null,"headerLogo":{"href":"/","aria-label":"Homepage "},"notifications":{"indicatorMode":"disabled","websocketChannel":null,"fetchIndicatorSrc":"/notifications/indicator","fetchIndicatorEnabled":false},"issues":{"href":"/issues"},"pulls":{"href":"/pulls"},"contributedRepos":{"href":"/repos"},"copilot":{"show":false,"showAgentsButton":false,"showRelaunchAnnouncement":false,"copilotChatUrl":null,"copilotApiUrl":"https://api.githubcopilot.com"},"search":{"show":true,"showCommandPalette":false,"isSearchPage":false,"isJumpToSearch":false,"searchContext":{"scope":"repo:gominimal/minimal","current_repo_name":"minimal","current_repo_nwo":"gominimal/minimal","current_repo_org":"gominimal","user_id":"gominimal"}},"commandPalette":null,"enterpriseBar":{"show":false},"globalTransactionalMessage":[],"payloadsUrl":"/_global-navigation/payloads.json?can_toggle_site_admin_and_employee_status=0\u0026is_admin_mode_on=0\u0026is_ui_opted_out=0\u0026show_ui_opt_out=0\u0026v=8","contextRegionUrl":"/_global-navigation/context-region.json"}}

feat(bep): rotate the signing certificate over the control socket - #2545

Merged
norrietaylor merged 2 commits into
mainfrom
agent/2532-rotate-a-running-proxy-s-signing-certificate-thr
Oct 25, 2026
Merged

norrietaylor merged 2 commits into
mainfrom
agent/2532-rotate-a-running-proxy-s-signing-certificate-thr

Conversation

@minimal-foundry
Copy link
Copy Markdown
Contributor

T51 — Rotate a running proxy's signing certificate through the control socket

slice: S9
kind: task
covers: BEP-061
size: M
est: 220 code, 140 tests
executor: agent
difficulty: needs care
model: standard
diagnostics: the command prints one line naming the old and new signing fingerprints, and the proxy's info log line records the same rotation
observability: the info log line T36 added, for operator-driven and scheduled rotations alike
layers:
- control:
- crates/bep/src/control.rs: accepts a rotate-signing request from the host and runs Ca::renew_signing on the serving proxy's CA under the same root and key identifier
- crates/bep/src/main.rs: bep rotate-signing sends the request over the control socket and prints the result
test: cargo nextest run -p bep rotate_signing_over_control_socket_keeps_leaves_valid
produces: none
consumes: none
proof: An operator rotates the serving proxy's signing certificate now, and a leaf issued before and one issued after both validate against the root a box holds.
depends on:
- blocked by T36


Generated by Claude Code

Proof

An operator runs bep --rotate-signing against a running bep serve. The request goes over the control socket, and the proxy issues a new signing certificate under the unchanged root. The command prints Signing certificate rotated from <old fingerprint> to <new fingerprint>. Running boxes keep working; nothing inside them changes. The test rotate_signing_over_control_socket_keeps_leaves_valid shows that a leaf issued before the rotation and a leaf issued after it both validate against the root that a box holds.

Notes from the agent: The task says bep rotate-signing. The binary already has this command as the flag bep --rotate-signing, with --control <PATH>, so I kept the flag and changed only how it reaches the proxy. Before, it sent SIGUSR1 and polled a fingerprint file. Now it sends {"op":"rotate_signing"} on the control socket, and the reply carries old_fingerprint and new_fingerprint. I removed the SIGUSR1 handler, ServeState (the lock file and the fingerprint file beside the socket) and their tests. The control socket bind already refuses a socket that a live process holds, so the lock has no job now. The rotate op uses its own types, RotationRequest and RotationReply, and Request and Reply stay as they were. A new variant or field on those types breaks the exhaustive matches and the struct literals in crates/minimal/src/tests.rs, and that file is outside the layers. Control::bind keeps its signature. Control::with_rotation adds the CA, and a socket without one refuses the rotation. The rotation runs on a blocking thread. Ca::renew_signing still writes the T36 info line with both fingerprints, for a rotation on request and for a scheduled one. ROTATE_TIMEOUT went from 10 s to 60 s, because the keychain can wait for a prompt. Printed text: the success line keeps the earlier fixed sentence Running boxes keep working; nothing inside them changes., and that sentence has a semicolon, which the prose rule does not allow. I did not reword it. …[truncated]

Tests

line exit tail
cargo nextest run -p bep rotate_signing_over_control_socket_keeps_leaves_valid 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-dea3... Compiling bep v0.0.1 (/workbench/crates/bep) Finished 'test' profile [unoptimized] target(s) in 12.16s ──────────── Nextest run ID bf2af620-e6df-44e6-9a0b-f634249ade46 with nexte

Verify

min task run agent-verify passed ([tasks.verify]).

Base

The base branch moved while the coder worked and was merged in before the tests ran. These files changed on BOTH sides since the branch point — read them first, because a rewrite from a stale reading can undo a merge without a conflict:

  • crates/bep/src/control.rs

Closes #2532

`bep --rotate-signing` now sends {"op":"rotate_signing"} on the control
socket of the running `bep serve`. The proxy runs Ca::renew_signing on a
blocking thread and answers with the old and new signing fingerprints,
which the command prints on one line (BEP-061).

The SIGUSR1 request, the lock file and the fingerprint file beside the
socket are gone: the socket bind already refuses a second live proxy.
…unning-proxy-s-signing-certificate-thr

# Conflicts:
#	crates/bep/src/control.rs
@coderabbitai
coderabbitai Bot commented Oct 25, 2026
Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c8473345-8bdd-445d-a7e5-54a0bc6e0d03

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@minimal-foundry
minimal-foundry Bot commented Oct 25, 2026 •
Copy link
Copy Markdown
Contributor Author

Approved: no findings at 8fc643f16d36.

Nothing to do.

Verdict APPROVE, posted as a comment: the App cannot review its own pull request; the check and the label carry it.

Clobber: none seen.

@minimal-foundry minimal-foundry Bot left a comment
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minimal-review — approved

Verdict APPROVE — No findings.

Panel: 3 of 3 personas ran (correctness, security, supply-chain).

@minimal-foundry minimal-foundry Bot added the review:approved minimal-review approved the current head label Oct 25, 2026
@minimal-arch minimal-arch Bot left a comment
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

arch-review: PASS · the full ruling

The change conforms to Gatehouse section 6.10 line 839. The signing CA rotates under the same root, and the boxes see no change. The test validates a leaf from before the rotation and a leaf from after it against the root alone. The rotation uses the existing owner-only control socket, and that socket refuses another uid before it reads. No conditions.

Ruled at 8fc643f against gominimal/arch@109541a48c31 by claude-opus-5-5.

@norrietaylor norrietaylor changed the title T51 — Rotate a running proxy's signing certificate through the control socket feat(bep): rotate the signing certificate over the control socket Oct 25, 2026
@norrietaylor norrietaylor left a comment
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Babysitter verification at 8fc643f. I read the full diff: bep --rotate-signing now sends {"op":"rotate_signing"} on the control socket and reads a RotationReply with both fingerprints, in place of SIGUSR1 plus the lock and fingerprint files beside the socket, which are removed with their tests. Control::with_rotation adds the CA; a socket bound without one refuses the request, and the control socket keeps refusing a peer of another user, so only the operator who runs bep serve can rotate. rotate() runs Ca::renew_signing on a blocking thread, the root is never touched, and rotate_signing_over_control_socket_keeps_leaves_valid validates a pre-rotation leaf and a post-rotation leaf against the root alone. Every refusal the command prints names the socket and the next step. Arch ruled PASS at this head. Both files are in T51's layers; zero open threads. Squash title feat(bep): rotate the signing certificate over the control socket passes commitlint. Residual #2510 (the end-to-end rotation under a running box) is T52.


Generated by Claude Code

@norrietaylor norrietaylor left a comment
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Babysitter approval at 8fc643f: every merge gate passes at this head (arch PASS, zero open threads, every lane aggregator green including ci-macos-success). Squash title feat(bep): rotate the signing certificate over the control socket and the squashed message pass commitlint. Queued for squash merge.


Generated by Claude Code

@norrietaylor
norrietaylor added this pull request to the merge queue Oct 25, 2026
Merged via the queue into main with commit 230709d Oct 25, 2026
37 checks passed
@norrietaylor
norrietaylor deleted the agent/2532-rotate-a-running-proxy-s-signing-certificate-thr branch October 25, 2026 05:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review:approved minimal-review approved the current head

Projects

None yet

Development

Successfully merging this pull request may close these issues.

T51 — Rotate a running proxy's signing certificate through the control socket

1 participant

0