feat(webhook): accept subscription secret via file descriptor - #94953
feat(webhook): accept subscription secret via file descriptor#94953misschloedupont wants to merge 2 commits into
Conversation
The fd-based handoff is implemented with real care: the read is bounded with the +1-byte oversize probe, rejects non-UTF-8 and empty-after-trim inputs, and deliberately does not take ownership of the caller's fd ( Two usability-scope concerns, one small robustness note:
Strong security posture overall — bounded reads, 0600 storage, scrubbed output, and a thorough adversarial test suite. |
What changed
--secret-fdfor webhook subscription secrets supplied through an already-open file descriptor--secret-fdmutually exclusive with--secretWhy
Supplying an HMAC secret with
--secretplaces it in process arguments, where it may be visible to process inspection and command history.--secret-fdlets an operator or supervisor provide the same secret without putting it in argv.Security impact
This PR adds a secret-ingress path. It is intentionally bounded and fail-closed:
0600Existing
--secretand automatically generated-secret behavior are unchanged.How to test
Automated:
Manual CLI smoke with an isolated webhook-enabled
HERMES_HOME:Verify that the subscription is created, the secret is absent from CLI output, and
webhook_subscriptions.jsonhas mode0600.Observed manual results:
0600Platforms tested
Verification
30 passedintests/hermes_cli/test_webhook_cli.pygit diff --checkpassedRelated work and duplicate search
Searched current source plus open and closed issues/PRs before submission. No issue or PR was found that adds webhook subscription secret input through
--secret-fd.