Credential rotation replaces a service account’s access key and secret without interrupting the pipelines that use them. A practical pattern keeps two credentials valid while storing only the newest in the secrets store. An already-running job can then finish with the previous credential. section 6.4.4
Figure 6.19 Our service account has two valid credentials at any given time. Only the latest credential is maintained in the secrets store, and the prior keys remain valid until the next rotation to prevent workloads and orchestration from failing due to the race condition of the key being changed while a job is already in process.
The two-key overlap prevents a job from failing when rotation occurs after it has obtained the previous key. section 6.4.4
For infrastructure pipelines, rotation can run as a scheduled job alongside recurring integration tests. Separate nonproduction and production service accounts limit where each pipeline identity can assume roles. OIDC integration is another option, but establishing its trust still involves an identifying credential that may be difficult to rotate. section 6.4.4
