Skip to content
Skills Library
Security · Automation

credential-rotation-ordering

/credential-rotation-ordering

Rotate exposed credentials in dependency order, generating new secrets first so services never double-fail during the swap. Use when exposure requires rotating keys, passwords or tokens across several services that depend on each other

Repository
patchwise ↗
Licence
MIT
Last repository change
28.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
2
Deprecation

No signals detected. Repository changed on 28.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Rotate exposed credentials in dependency order, generating new secrets first so services never double-fail during the swap. Use when exposure requires rotating keys, passwords or tokens across several services that depend on each other

Original author description

Rotate exposed credentials in dependency order, generating new secrets first so services never double-fail during the swap. Use when exposure requires rotating keys, passwords or tokens across several services that depend on each other

How it works

  1. Procedure
  2. Signals
  3. Patterns
  4. Pitfalls
  5. Done when
  6. References
Original SKILL.md headings · 62 lines, 409 words
SKILL.md preview
---
name: credential-rotation-ordering
description: "Rotate exposed credentials in dependency order, generating new secrets first so services never double-fail during the swap. Use when exposure requires rotating keys, passwords or tokens across several services that depend on each other"
pack: patchwise
version: 1.0.0
category: defensive-security
tags: [rotation, credentials, ordering]
---

# Credential Rotation Ordering

> Rotate exposed credentials in dependency order, generating new secrets first so services never double-fail during the swap

**Use when:** exposure requires rotating keys, passwords or tokens across several services that depend on each other

**Avoid when:** only one isolated credential needs replacing and nothing depends on the rotation order

## Procedure

1. Draw the dependency graph among affected credentials: which services read which secrets, and which secrets are shared.
2. Generate new credentials before revoking old ones, so every consumer can be migrated from a working state.
3. Migrate leaf consumers first, then mid-tier services, and finally shared or root credentials that everything hangs from.
4. Verify each migrated consumer makes at least one authenticated call before revoking the credential it just left.
5. Revoke old credentials only when the migration metric shows no consumer still reaching for them.
6. Record the rotation ledger: credential, new version, consumers migrated and revocation timestamps, for audit.

## Signals

- A service fails after rotation because a shared secret was swapped while its consumer cached the previous value.
- Two services share one credential, so rotation must be sequenced or one of them always ends up broken.
- Consumers read credentials from several stores, and one store was missed, so the old value reappears after revocation.
- A rotation completes but a scheduled job awakens days later still carrying the retired credential in its own config.

## Patterns

**1. Rotation order**

```text
shared secret S used by api+worker -> 1) issue S' 2) migrate api 3) migrate worker 4) revoke S
```

**2. Verify tactic**

```text
from each consumer: 200 authenticated call -> migrate next
401 -> rollback the consumer only
```

**3. Rotation ledger**

```text
S: issued 15:10, migrated api 15:14, worker 15:20, revoked 15:31
```

## Pitfalls

- Revoking before migrating, which turns one security incident into concurrent availability incidents across consumers.
- Missing secondary stores or cached copies, so a revoked credential keeps authenticating through a forgotten consumer.
- Rotating shared credentials without sequencing consumers, which makes each rotation a coin flip on whether every service survives.

## Done when

- Every affected credential has been replaced with consumers migrated in dependency order, verified by an authenticated call each.
- The rotation ledger records issuance, migration and revocation timestamps so later audits can see the true exposure closure.

## References

- [OWASP - secrets management cheat sheet](https://cheatsheetseries.owasp.org/cheatsheets/Secrets_Management_Cheat_Sheet.html)
- [NIST SP 800-63B - credential guidance](https://pages.nist.gov/800-63-3/sp800-63b.html)

Versions

The database has no other skills named credential-rotation-ordering.

Database snapshot: 13.11.2026 · package version 34f525868eff (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100secrets-detector
    Detects hardcoded secrets, API keys, passwords, and credentials in source code. Use when checking for leaked secrets, credential exposure, or before committing code.
  • 100secrets-management
    Find, contain and prevent exposed secrets — API keys, tokens, passwords, private keys and environment files — and set up proper storage, rotation and GitHub secret scanning with push protection. Use when secrets are found, when configuring environments or CI, or during audits.
  • 100performing-service-account-credential-rotation
    Automates credential rotation for service accounts across Active Directory, cloud platforms, and application databases to eliminate stale secrets and reduce compromise risk. Use when rotating or automating rotation of service account passwords, API keys, or secrets stored in a vault.
  • 90api-credential-rotation
    Store, scope, and rotate integration credentials so a leak is survivable and rotation does not cause an outage. Use when managing keys for external services.
  • 90Secret Scanning
    This skill should be used when the user asks about "secret scanning", "find secrets", "hardcoded credentials", "leaked API keys", "git history secrets", "credential scanning", "detect passwords in code", or needs to identify secrets and credentials in source code or git history…
  • 100secrets-credentials-management
    Use when handling passwords, API keys, tokens, or third-party credentials in a WordPress plugin or theme. Hashes passwords with wp_hash_password / wp_check_password, generates tokens with wp_generate_password, keeps secrets out of code and the database in plaintext, and uses…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.