Rotate a webhook signing secret
Replace an endpoint's signing secret if it leaks or on a regular schedule
Rotate an endpoint's signing secret if it may have leaked, or as part of your regular key changes. BillPro issues a new secret and stops using the old one straight away. The endpoint keeps its URL, events, status and delivery log.
Before you start
- An Admin user with API Access turned on.
- A way to update the secret on your server quickly, such as an environment variable or a secrets manager.
The old secret stops working immediatelyThere is no overlap period. From the moment you rotate, BillPro signs every request with the new secret. This includes retries of deliveries that were created earlier. Until your server has the new secret, its signature checks fail.
How rotation affects deliveries
Between the rotation and your server update, your endpoint rejects requests with 401. BillPro treats these as failed attempts and retries them, signed with the new secret. Once your server has the new secret, the retries succeed.
A request that was already on its way when you rotated is signed with the old secret. If it arrives after your update, it fails your check. BillPro retries it with the new secret.
To keep the gap short, have the secret update ready before you rotate. Rotate at a quiet time if you can.
Rotate the secret
-
From the user icon menu, select Webhooks.
-
Click the endpoint URL.
-
In Signing secret, click Rotate.
-
In Issue a new signing secret?, click Rotate.
-
On the New Signing Secret Issued screen, click the copy button beside the new secret.
-
Update the secret on your server and deploy the change.
-
Click Go to the endpoint.
-
In Recent deliveries, click Send test event. Check that it shows
Succeeded. -
Check for deliveries that show
Failedsince the rotation, and click Send again on each one.
BillPro records every rotation and reveal with your user, the time, your IP address and the page you used. It never records the secret itself.
If you leave the screen before copyingThe New Signing Secret Issued screen shows the secret once. If you leave it, open the endpoint and click Reveal in Signing secret to see the new secret.
If several endpoints share your server
Each endpoint has its own secret. Rotating one doesn't change the others. If your server receives from several endpoints, give each endpoint its own URL path. Then check each request with the secret for that path.
Updated about 11 hours ago
Recommended reading
Check signatures with the new secret