fix(security): store webhook secrets by reference and migrate plaintext (Webhook Feature Package) - #85025
fix(security): store webhook secrets by reference and migrate plaintext (Webhook Feature Package)#85025andrexibiza wants to merge 16 commits into
Conversation
63a025d to
850f133
Compare
Address all REQUEST_CHANGES findings from the Task 8 security witness: - hermes config get WEBHOOK_SECRET leaked the full secret (redact_config_value only masked dict keys, not scalars). Mask scalar webhook secret values. - Migration exception chains preserved the secret via 'raise ... from exc'. Raise value-free errors with 'from None' so backend messages/tracebacks cannot leak the secret. - migrate_webhook_config only migrated 'secret', leaving inline 'secret_value' in config. Migrate both secret and secret_value (global and per-route). - Update stale CLI tests to assert the secret_ref contract (plaintext lives in the resolver, only a reference persists in route JSON). - Read effective config via load_config_readonly() (config-read-guard).
20a837a to
a4a6ebb
Compare
Signed-off-by: Axl Ibiza, MBA <andrexibiza@gmail.com>
fix(security): store webhook secrets by reference and migrate plaintext (Webhook Feature Package)The migration design is the right shape: write → resolve → verify → atomic switch → scrub, value-free receipts, and
|
|
too large to review safely This PR changes 1295 production lines before tests and docs. Please split it or add a focused justification if it should stay together. Signed: GPT-5.6-luna-high in Codex |
- mint and persist a fresh reference when an update finds a malformed no-secret route - remove the campaign watermark from production code - route CLI secret reads/writes through one canonical helper - serialize webhook secret writers with a bounded cross-process lock - hold that lock across the production migration transaction - preserve value-free migration failures and exact pre-switch rollback truth - add focused regressions for the no-secret edge, watermark absence, and writer serialization This fixes the concrete review defects before semantic compression of the historical Task 8 branch.
Have CLI and migration resolution delegate to WebhookAdapter._resolve_secret_ref instead of maintaining another get_secret/env fallback chain. Keep persistence locking in the shared Task 8 helper.
|
Addressed the four concrete Task 8 findings on the published branch at
The existing value-free migration error behavior and pre-switch byte-preservation are retained. Exact-head CI The separate reviewability objection is also correct; I am not asking anyone to review the historical 28-file train as-is. I am treating the current branch as semantic source while compressing Task 8 onto the current webhook ownership graph, rather than defending stale stacked spillover. |
|
Agreed on reviewability. I am not defending the 1,295-production-line historical shape or asking maintainers to review it. The branch accumulated adjacent webhook-task ownership before the campaign boundaries were cleaned up. The correct end state is a semantic Task 8 slice: secret-reference persistence/resolution, migration, CLI secret surfaces, and focused security/regression tests. Profile admission belongs to #85645; effective config belongs to #85002; authenticated intake/idempotency belongs to #90236; provider signature authority belongs to #85318. I have fixed the substantive Task 8 defects first so compression has a correct semantic source. Current exact head is |
Exact-head hosted verification receiptThe cleanup head named in the body,
This closes the body’s explicit “fresh exact-head matrix required” residue. It does not waive the separately documented reviewability/topology requirement to contract Task 8 further around secret-reference persistence/resolution/migration ownership before landing. |
Part of #84834 — Webhook Feature Package Task 8. Closes #77471.
Current Task 8 semantics
The published implementation closes the four concrete review defects while preserving the original write → resolve → verify → atomic switch → scrub migration contract.
Secret-reference migration
Review hardening
hermes webhook subscribeupdates that find neithersecret_refnor legacysecretmint a fresh secret and persist only its reference instead of saving a credential-less route;WEBHOOK_REVOLUTION_TASK8_MIGRATION_COMMAND_V1was removed and a regression pins its absence;WebhookAdapter._resolve_secret_refauthority instead of carrying a secondget_secret → envfallback chain;Current cleanup head
Head:
aa639d58e87cb4a7f7476a93ec874afb8b342337.The two
artifacts/webhook-repair/.../task-08receipt files have been removed from the branch. The review surface is now 26 files rather than 28; this is cleanup only and does not inherit the prior head's verification.Verification truth
The previous correctness head
e32bc0a13808413740dc5ca020816bed5a4eeb39had exact-head green CI32388358900, Docker32388356067, and Nix32388356107.Those receipts are now historical because the branch moved to
aa639d58.... A fresh exact-head matrix is required; no green is inherited.Reviewability / topology
The maintainer objection to the historical large diff remains valid. This cleanup is not the final semantic compression. Task 8 ownership must contract further to secret-reference persistence/resolution/migration surfaces and focused tests. Adjacent ownership is explicitly elsewhere:
Related #85054.