Pcornel
Security · Secrets Management

API Keys

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

Back to the Topic

Answer

API keys are secrets that identify and authorize an application calling an API. Scope them narrowly, keep them out of code and repositories, rotate them and revoke them on any exposure.

Remember

  • An API key acts as its owner to the API.
  • Scope keys to the minimum permissions.
  • Never commit keys to repositories.

First checks

  • gitleaks detect --source . — keys in code
  • Key scopes and IP restrictions — least privilege
  • Key age — rotation

Verify in this order

key → API → scoped access

Where it usually breaks

First mismatch in key/secret generation → storage/rotation → trust/certificate validation → protocol negotiation → cryptographic operation → peer/application verification; preserve identity/policy/pre-state before mutation.

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

Confirmation

Confirm action

Continue?