Repository navigation
feat: standing grants (part 1 of #110) - #115
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
groupsky
force-pushed
the
feat/standing-grants-110
branch
from
October 29, 2026 05:20
94a4bc7 to
6cbb427
Compare
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ion (#110) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…w only after a sent alarm (#110) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…110) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part 1 of #110 (standing grants). Refs #110.
The design is in the plan comment on #110 and the owner answers of 2026-10-29 (A: dropped at a broker stop, B: an alarm ends the grant, C: secrets only, D: Renew as proposed).
Part 1: core kind, windows, config, request, token, rotation, the use path and the use alarms, the audit events, DESIGN.md and THREAT-MODEL.md.
Part 2 (own PR): missed-window alarm, warning and Renew, weekly summary,
/grants, docs.Progress
standing = trueand the[standing]sectionnkg_prefix, random, checksum, SHA-256 hash only on the brokernodkey preapprove --daily/--weekly, token file;nodkey run --grant-token FILEwith a safe save of the new tokenStep 5a done: api
Window,PreapproveRequest.Windows,PreapproveAnswer.GrantToken,GrantTokenHeader; clientSaveGrantToken,CheckGrantTokenFile. Step 5b done:SecretsAnswer.GrantToken,nodkey run --grant-token(bad token file exits 64, missing or bad new token 69, failed save 77). Step 6a done (cf4b0f8): the broker makes standing grants; overlapping windows are denied; audit has kindstanding,Subject.Windows, end causesalarmandrenewed. Step 6b done: the use path, rotation and the alarms (grant_alarm,new_token_hash); the alarm texts and the standing use notice are ininternal/telegram(step 7 done with it). Choices to check in the review:outside_windowalarms at most once per calendar day (DESIGN.md says so now);unknown_tokenalarms capped at 3 per minute per client; alarms go to the notice chat, with sound.Step 8a done (ae944af, 136a570): tests for an alarm through the fake Telegram server (
TestBrokerStandingAlarmThroughTelegram), a failedsecret_sentwrite (TestStandingSecretSentFailure), a cancel after rotation (TestStandingCancelAfterRotation,TestRunGrantTokenCancel). golangci-lint: 0 issues (8 fixed with//nolintand a reason). Stress -count=20 -cpu 1,2,4 clean.Step 8b done: security review of the whole part. Findings (full text outside the repo, summary here):
CancelGrantends only scheduled grants, so--cancel,dropGrantand the client'scancelLeftoverleave a standing grant live. Fix: end standing grants too, causecancelled, DESIGN.md, tests.readGrantToken: Lstat then ReadFile follows a symlink. Fix: open with O_NOFOLLOW, check the open file.outside_windowmark is set before the send; a use before the start has no alarm. Fix: mark after a good send; before the start isoutside_window.Step 8c done: findings fixed (4c2254e, 690ccf8, 3851b8d, ba51f50, 272ffe4).
Step 8d done: review of the fix diff found 2 low: the foreign token alarm did not name the owner machine; a named pipe in place of the token file made the open wait. Both fixed in 464e786.
Step 8e done: review of 464e786: no findings. Go 1.27 and Go 1.26 with CI=true: all pass; go vet and golangci-lint: 0 issues; standing grant tests stressed -count=20 -cpu 1,2,4: clean. Ready.
Next: squash merge on green CI, then part 2 on feat/standing-grants-110-part2.
Open review findings: none. (The token file folder: no code fix; docs/setup.md says to keep it in a private folder.)
🤖 Generated with Claude Code