Repository navigation
feat(broker): nodkey broker command, start and stop order, systemd unit - #60
Merged
Merged
Conversation
Wire the broker service, the approval core, the Telegram approver, the stores and the audit log into one daemon, with core dumps off and an example hardened unit. Closes #11
7 tasks done
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.
What
Part B of #11: the
nodkey brokercommand, which wires the merged parts into one daemon.RLIMIT_CORE1,PR_SET_DUMPABLE0, read back) → the broker's TLS key → SSH keys (with each key'shosts; the same public key in two sections refuses to start) → open the audit log → stores (a store that fails to start denies its own requests and sends one alert) → the broker service → the Telegram approver → the approval core → listen →broker_started→ serve. Nothing listens before the audit log is open, and nothing is served before the approval core runs.broker_stopped; bounded by 80 s.log_recoveredentry without a laterbroker_startedalerts again at the next start.getUpdatescannot reach Telegram after a restart. The CA and proxy settings in use are logged at start.contrib/systemd/nodkey.service: encrypted credentials,StateDirectory=,UMask=0077,LimitCORE=1,MemoryMax=,MemorySwapMax=0,MemoryZSwapMax=0,TimeoutStopSec=90s,RestartPreventExitStatus=64 76 77,LogRateLimitIntervalSec=0, and a strict sandbox (systemd-analyze security1.4) that still letsbwsandbwrun.store.PrepareDirmakes or checks the store directory;audit.Logger.LastRecovery;telegram.ErrTokenRefused.Tests
The real command in a child process with throwaway keys, fake store programs and a fake Telegram server (reached through
HTTPS_PROXYand a test CA, so nothing goes to the real Telegram): the start and stop order, every start failure, the same key twice, a failed store, a polling conflict (76), a refused token (77), core dumps off, the torn-line alert after a failed start, alert retries, and a canary secret end to end through the real Telegram approver. Stress runs with-count=10 -cpu 1,2,4pass on Go 1.27 and 1.26.Docs
DESIGN.md sections 7, 9, 11, 14, 15, 16 and 17; THREAT-MODEL.md T6, T16, T17 and T18; AGENTS.md layout.
Review
Three rounds with the security-reviewer agent; the last said "ready to commit".
Fixed on the way:
MemorySwapMax=0);Left for later issues: #59 (send start alerts at the same time, so a stop during a long outage stays clean).
Closes #11