SAPP blog
Integration key rotation: how to replace credentials while keeping data exchange under control
How to prepare replacement of a connection secret, test the new connection and retire the previous one.
How to define task boundaries
A key is replaced in one handler, but the overnight job still uses the old one. The daytime check passes, but data exchange stops by morning. Rotation requires a consumer register, not just a new setting value.
The procedure depends on the provider: some allow two active keys during a transition, while others immediately revoke previous access on replacement. Do not promise a seamless change without checking these conditions.
Before configuring this mechanism, review the original workflow: Bitrix24 webhooks: how to design a reliable integration.
Replacing a secret must include verifying trust in incoming messages. These checks are covered in the article Incoming webhook authenticity: what to verify before executing an action in CRM.
Data for a working register
| What to record | Purpose | Testing |
|---|---|---|
| What to recordConnection and owner | PurposeIdentify responsibility | TestingThe service and purpose are known |
| What to recordConsumers | PurposeDo not overlook a background job | TestingSchedules and environments are listed |
| What to recordTransition and verification | PurposeConfirm replacement | TestingUse of the old secret can be detected |
Procedure
1. Take inventory
Find applications, background jobs and configuration stores that use the connection. Do not copy the secret itself into the register.
2. Clarify the replacement mechanism
Check support for a transition period, permission scope and revocation rules. Compromise requires a separate urgent procedure.
3. Test the new connection
Confirm the required operations and minimum permissions in a safe scenario. Replacement must not silently expand access.
4. End use of the old secret
Once consumers have migrated, revoke the previous secret using the prescribed procedure. Check the next background runs and retain the result without the key value.
Example solution
Hypothetical example, not a customer case study
Illustrative example: one connection is used by the request handler and overnight reconciliation. Transition testing covers both scenarios.
If parallel keys are not supported, agree on a change window and a procedure for processing accumulated operations.
Exceptions and automation
If a leak is suspected, a routine planned transition may be too slow. The security owner determines the response according to the risk.
A configuration backup may contain old secrets. Its retention and access rules are also part of connection management.
To verify integration results, use the approach in the article Ending contractor access: checking external accounts after a project.
Route settings can be included in the project business process automation. Agree the fields, checks and integration with the accounting system before launch; the described workflow must be adapted to the company's rules.
Pre-event check
- Take inventory: Find applications, background jobs and configuration stores that use the connection.
- Clarify the replacement mechanism: Check support for a transition period, permission scope and revocation rules.
- Test the new connection: Confirm the required operations and minimum permissions in a safe scenario.
- End use of the old secret: Once consumers have migrated, revoke the previous secret using the prescribed procedure.
Frequently asked questions
Can the key be sent to a developer in a task?
Use an agreed secure transfer mechanism. Ordinary task text must not become a secret store.
Must permissions change during rotation?
Track credential replacement and permission review explicitly. Expanding permissions is not a required part of rotation.
How can completion be established?
Confirm that consumers work with the new connection and that the previous one is revoked according to the service's capabilities.
Let's discuss automating your workflow
How to prepare replacement of a connection secret, test the new connection and retire the previous one.