A secret rotation that must not stop warehouse dispatch
An online retailer sends paid-order and cancellation events to its fulfilment platform through signed webhooks. The shared signing secret is due for replacement because the integration has operated unchanged for years. The warehouse team depends on these events to pick orders before carrier cut-off. If the retailer switches the signing key abruptly, the receiver may reject legitimate dispatch messages; if it accepts the old secret indefinitely, a stolen credential could authenticate fabricated events. This fictional case tests whether both parties can perform a controlled handover without making a security improvement into a fulfilment outage.
Treat the exercise as a joint protocol and operations change. Signing proves that a message was issued by a party controlling the configured secret, but it does not by itself prove freshness, correct customer authorisation or business validity. The project needs agreement on how keys are distributed, how several versions coexist briefly, which messages can be retried, what makes an event unique and when an old key is truly revoked. Document the retailer’s endpoint, the warehouse receiver, any broker or API gateway, and the people authorised to approve each change.
Understand the direction of the trust relationship
Establish which platform produces each event and which consumes it. An order-created event may originate from the storefront and reach a warehouse-management system; shipment-confirmed messages may flow in the opposite direction using a separate integration. Different directions should not silently share the same signing credential. List each webhook topic, target URL, queue, account, owner, signing method and environment. Confirm whether a shared secret is provisioned through configuration, a secrets manager or manual email; an undocumented copy sent to a contractor may be the weakest point in the rotation plan.
Inspect the exact signature scheme before touching production. Is the hash computed over the raw request body, a canonical representation, a timestamp plus body or an envelope that includes event ID? Different serialisation and whitespace can break signature validation even when both sides think they use the same algorithm. Record how the receiving code handles multiple signatures and which version it is prepared to trust. Do not invent a universally correct header format; follow the implemented protocol and validate it with signed test messages. If the mechanism authenticates only a bearer-like token, note the different replay and exposure implications.
Prepare a safe overlapping-key window
Generate a new secret using an approved high-entropy source and deliver it through controlled secret distribution. Never place either key in tickets, log entries, messaging threads or a screen recording. For the planned cutover, configure the receiver to accept both the existing and new signatures for an agreed short period, if the protocol supports that design. Prefer a version or key identifier that allows the receiver to choose the correct verifier without trial-and-error across many unrelated credentials. Maintain a clear expiry for dual acceptance rather than treating it as a permanent compatibility setting.
The sending side should switch to the new signer only after the warehouse confirms that its receiver has been tested. Allow for multiple receiver instances, deploy waves and caches that may temporarily carry old configuration. Record the last successful use of the previous key and any pending delivery retries. A secret-management change is not complete when the central vault updates; services holding stale copies may continue signing or validating with them. Agree who can stop the cutover if the receiver reports unexplained failures and how a rollback would work without reopening a compromised credential.
Verify that signature checks fail closed
In staging, send a legitimate message signed by the current secret and confirm that the intended event is processed once. Repeat using the new key before and after the planned deployment stage. Send an unsigned request, one signed with an unrelated value and one whose body has changed after signing. Each must fail authentication without creating or modifying a warehouse order. Use appropriately generic failure responses; do not return secret values or detailed cryptographic internals. Inspect the order store and message queue as well as the HTTP response, because an endpoint can incorrectly enqueue work before it verifies the signature.
Review comparison and parsing behaviour. The code should apply the correct verified algorithm and avoid insecure string-comparison patterns that unnecessarily expose timing differences. Malformed signature headers, missing timestamps, multiple conflicting key identifiers and unexpectedly large payloads should follow an explicit error path. Apply reasonable request-body limits and avoid parsing an expensive nested object before authentication when the design permits earlier verification. Record a safe reason code for failure and an event correlation token; this gives operators diagnostic value without exposing the signature or complete customer order in logs.
Separate replay resistance from cryptographic authenticity
An intercepted signed delivery may remain cryptographically valid when resent. If the protocol signs a timestamp, enforce an approved freshness window with synchronised clocks; if it includes a stable event identifier, record successfully accepted IDs to prevent duplicate business actions. The retailer and warehouse must agree whether retries carry the original signed timestamp or are re-signed. The receiver should make its duplicate handling reliable even when the process restarts or the event is delivered through more than one queue. Merely checking that a signature matches cannot stop a duplicated dispatch instruction.
Use synthetic orders to exercise delayed and out-of-order messages. A cancellation arriving after a shipment confirmation should not create an impossible warehouse state; the business workflow must define how to reconcile it. A duplicate order.created should not generate a second pick list, while a legitimate later order update must not be discarded because it reuses an overly broad idempotency reference. Store enough transaction state to distinguish those cases. Document the maximum permitted replay age and make sure retention of accepted IDs covers the time during which an old message can be considered authentic.
Rehearse the real dispatch failure modes
Run the tabletop before the real change. At the first injection, one warehouse receiver instance is still configured with the old secret and rejects new events. At the second, an integration queue accumulates messages while carriers approach cut-off. Ask which dashboard identifies the backlog, who decides whether to pause dispatch automation, and how the team prevents workers from manually re-entering the same order twice. The retailer must distinguish an order paid by a customer from an event successfully delivered to the warehouse. These are separate acknowledgements and require different remediation.
Next assume the new signer is functioning but a provider retry mechanism continues to send old signatures. The team should have a bounded recovery procedure for queued legitimate events without disabling validation for all incoming requests. Make a controlled redelivery from the approved platform and reconcile accepted event IDs against orders and shipments. Do not propose accepting unsigned payloads temporarily as an outage workaround. If manual dispatch is authorised, it needs supervision, matching order references and a later reconciliation step. Delivery continuity matters, but weakening message provenance may worsen an incident.
Decide whether a suspected compromise changes the plan
Routine rotation and suspected secret theft are not identical activities. If the old credential might be known to an adversary, a generous dual-key window can perpetuate unauthorised messages. The incident lead may need to stop the old trust path earlier, isolate the affected integration and accept a controlled service interruption. Assess recent event history for unauthorised order changes and preserve relevant audit evidence. A new key cannot retract forged events that were already accepted; operations may need to inspect picking, shipping and cancellation records for consequences.
Choose response actions based on observed facts and confidence. An unexpected signature-verification error can be caused by configuration drift, not necessarily compromise. The team should verify change records and application versions before making claims about hostile activity. If fraudulent messages are confirmed, establish affected orders, exposure of any personal data and notification obligations with the appropriate owners. A clear decision log should distinguish the technical trigger from the operational effect and the basis for declaring the integration safe to resume.
Keep signing secrets out of operational evidence
Log event IDs, producer identity, key version, verifier outcome, timestamp and a bounded failure category. Avoid writing raw secrets, complete signed payloads or customer addresses into observability tools merely to explain why a webhook failed. Allow security staff to correlate a rejected delivery with a message in the controlled order platform through an approved request, rather than placing all order details in an unrestricted error record. Review who can access queue dead-letter messages; those records can contain personal details and may outlive the normal checkout data-retention period.
Demonstrate the monitoring path during the test. Can operators detect a sudden increase in invalid signatures before a dispatch backlog becomes visible? Does an old-key signing event after revocation generate an actionable alert? Is the alert routed to both the retailer’s integration owner and warehouse operator, with a tested out-of-hours contact? Record the expected signal delay and the escalation threshold. Evidence should show that the team can spot a partial cutover, not just that the successful test messages were accepted.
Close with reconciled inventory and a revoked old key
Acceptance requires more than a configuration screenshot. Collect test delivery IDs, receiver-version coverage, rejected-signature results, duplicate-event test outcomes, queue-depth history, manual exception records and a signed-off rollback plan. Confirm that no unprocessed authorised orders remain and that cancellations or shipment updates have been reconciled with their intended records. After the agreed window, actively test that messages using only the old secret are rejected. Check every live receiver instance and verify the old credential is removed from deploy variables, legacy secrets stores and documentation where feasible.
Set the next rotation date and identify what events require an early rekey: a supplier compromise, leaked deployment configuration, service-account change or material integration redesign. Update the shared runbook so a future operator understands why the overlap window exists and how it ends. The best outcome is quiet: customers receive their goods, the warehouse can explain every dispatched order, and the retired secret no longer grants trust. That outcome depends on deliberate testing of both cryptographic controls and ordinary fulfilment operations.
Sources and further reading
How Next Defence can help
Build an approved acceptance exercise around rotating a retail fulfilment webhook secret while legitimate orders still reconcile. Keep accepted new signatures, rejected old signatures and replay-protection outcomes with the acceptance record. Application Security & DevSecOps can help scope the tests and clarify who must authorise any live-system change.