Filters
How to search
  • Plain words find names, texts and examples.
  • "two words" finds the exact phrase.
  • --name or -x finds an option.
  • #word looks only inside commands.
  • @grep finds lessons and labs that use grep.
  • Filters: cat:network · in:labs · in:notes · level:rhcsa · ch:8 · root:yes. Put ! before a word to leave it out. OR between words means one of them.
  • ↑ ↓ to move · Enter to open · Esc to close · / to search

Automation & toolingMixed 22 series

Five rules for credential automation

Credentials are the part of automation that fails loudly once and quietly forever.

Quick reference

  1. Short-lived tokens from a broker, never a static key in a repo.
  2. One identity per job, scoped to the action it performs.
  3. The secret never reaches argv, a log line or an error trace.
  4. Rotate on a schedule, and rehearse the rotation.
  5. Revoke first, then investigate: quiet is not safe.

Explained

Short-lived. Ask a broker for a token at run time: cloud workload identity, Vault, or an OIDC exchange from the pipeline. A static key in a repository is a key you cannot rotate without a deploy.

One identity per job. A deploy job does not need every bucket, and a reporting job does not need production write access. Scope the role to the action, then name the action in the role description.

Out of sight. A secret passed as an argument is in the process list and the shell history. Read it from a file descriptor or the environment, and keep the error path from printing it.

Rotate and rehearse. A rotation you have never performed is a theory. Run it in staging, including the client that caches the old value.

Revoke first. When a token leaks, revoke before you investigate, because the investigation is slower than the attacker.

The honest caveat: short-lived is not the same as safe. A one-hour token logged at debug level is still a leak, and still valid for the rest of the hour.

The lesson: the best credential is the one the job never stores.

Your turn: Which of the five would your pipeline fail today?

More notes: Automation & tooling

Open in the notes app: search, filters, copy This note on GitHub