Pcornel
Browse topics
Options
Recent
Favorites
Security · Technical reference

Expiration

Direct answer

Secret expiration gives credentials a limited lifetime, such as short-lived tokens or certificates that expire in days, so a leaked secret stops working quickly.

When to use this

Use this when limiting how long credentials stay valid.

First 30 seconds

1. Secrets should expire (TTLs).

2. Short TTLs limit exposure.

3. Alert before expiry of long-lived secrets.

4. Renew automatically.

5. Remove expired secrets.

Operational verification

secret issued with TTL → renew or expire

Context & applicabilityCommon mistakes · platform/version boundaries
Common mistakes
Common mistakes
  • Certificates expiring unexpectedly because nobody tracked them — monitor expiry.
  • "Never expires" set for API keys and PATs.
  • Lifetimes so short that manual renewal becomes impossible — automate first.
  • Expiry not aligned with rotation, so services fail at expiry.
Platform / version applicability
Cryptography, PKI and secrets
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformCryptography, PKI and secrets
Scope / prerequisiteUse this when limiting how long credentials stay valid.
What next?2 suggested next steps
Evidence1
On this pageJump to a specific section
Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Key points
  • Short-lived secrets reduce exposure.
  • Expired secrets must be renewed automatically.
  • Certificates and tokens should expire.
Key checks
  • Expiry dates on keys/tokens/certs — tracked
  • vault token lookup — TTL
  • Alerts before expiry — monitoring
ReferenceWhy it matters1 section · depth on demand

Setting lifetimes

SecretTypical lifetime
OAuth access tokenMinutes to 1 hour
Dynamic database credentialsHours
TLS certificates (public)90 days or less (moving to 47 days by 2029)
API keys / PATs30–90 days, or replace with short-lived tokens
Service account passwordsManaged rotation (gMSA every 30 days)

Monitor upcoming expiry so expiry does not cause outages.

ReferenceImportant terms & boundaries2 sections · depth on demand

Suggested lifetimes

SecretLifetime
OAuth access token5–60 minutes
Dynamic DB credentialsHours
CI/CD tokens (OIDC)Per job
API keys90 days or less
Public TLS certificatesMaximum 200 days since March 2026, falling to 47 days by 2029 (CA/Browser Forum)
Root/CA keysYears, offline

In depth

Expiration gives secrets a fixed validity period after which they stop working. It limits the damage from undetected leaks and forces rotation, but expired secrets also cause outages when renewal is forgotten.

Practical guidance:

SecretTypical lifetime
Access tokens5–60 minutes
Personal access tokens30–90 days
Public TLS certificatesMaximum 200 days since March 2026, 100 days from March 2027, 47 days from March 2029 (CA/Browser Forum)
Service credentialsAutomated rotation (days to months)

Monitor upcoming expiry centrally and alert well in advance; automate renewal wherever possible so expiry becomes a non-event.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docCryptography, PKI and secrets current

Authoritative/upstream documentation reviewed for bounded claims in Secrets Management → Expiration. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://cheatsheetseries.owasp.org/cheatsheets/Secrets_Management_Cheat_Sheet.html · confidence 94%
Confirmation

Confirm action

Continue?