Pcornel
Automation · Secrets & Credentials

API Keys

Cheat sheet · https://pcornel.dk/topic.php?topic=5891

Back to the Topic

Answer

API Keys are application credentials presented to an API to identify or authorize a caller, often long-lived and bearer-like, so secure automation must constrain their scope, storage, transport, rotation and observability.

Remember

  • API key valid ≠ caller authorized for every endpoint.
  • Key hidden in UI ≠ key not leaked elsewhere.
  • TLS protects transit ≠ key lifecycle is safe.
  • New key created ≠ old key revoked.

First checks

  • gitleaks detect — keys in code
  • Key scopes and restrictions — least privilege
  • Key age report — rotation

Verify in this order

vault → API key → API

Where it usually breaks

API-key evidence proves handling and observed provider behavior for the key; it does not prove endpoint authorization design or absence of copied leaked values.

Client payload/auth → HTTP transport → endpoint validation/policy → request accepted → queued/job execution → target mutation → effective state → consumer workload.

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5891

Confirmation

Confirm action

Continue?