Teleport IdP group cache TTL vs. certificate TTL: which knob actually bounds stale-access window?
0 reputation · 27 May 2020, 21:55 UTC
0 reputation · 27 May 2020, 21:55 UTC
Teleport caches external IdP (OIDC/SAML/GitHub) user and group data after authentication. The auth server's in-memory (Community) or Redis-backed (Enterprise) cache holds connector responses keyed by connector ID and user identity. Separately, issued certificates embed roles at issuance time and remain valid until their TTL expires (default 12–24h, configurable via max_session_ttl or auth_service.tokens.ttl).
No single documented setting governs IdP group membership refresh. Cache invalidation only occurs on connector config change or manual tctl auth cache clear—not on upstream IdP group mutation. The auth_service.authentication_cache_ttl introduced in 16.x is undocumented and not guaranteed stable. Certificate TTL and IdP cache TTL operate independently, so a user can hold a valid cert while their IdP group membership has already changed.
Bound the maximum stale-access window—the time between an IdP group removal and Teleport denying access—without resorting to unsupported cron-based cache clearing or forcing hourly re-authentication for all users.
35775 reputation · 28 May 2020, 00:29 UTC
The certificate or session TTL is the effective upper bound on stale IdP group access. Teleport embeds roles at certificate issuance and trusts them until expiry. Removing a user from an IdP group does not revoke an already-issued certificate, so the stale-access window lasts until the current certificate expires, not until the IdP cache TTL elapses.
Confirmed: the IdP user/group cache TTL controls how long the auth server reuses connector data during new authentication or certificate issuance. It does not retroactively shorten or invalidate live certificates. Confirmed: Community uses an in-memory cache and Enterprise can use Redis; neither backend revokes certificates on IdP group mutation. Likely explanation: auth_service.authentication_cache_ttl is version-specific, undocumented, and not guaranteed stable; do not build a production SLA on it without vendor confirmation.
authentication_cache_ttl may not exist in your build.max_session_ttl, or your version's equivalent session/certificate TTL, to the maximum staleness window you can tolerate.tsh status to inspect certificate expiry, then remove the user from the IdP group and confirm the existing certificate still grants access until it expires.tsh statusThe answer does not fundamentally differ by cache backend. Redis persistence may keep stale group entries visible across auth service restarts longer than the in-memory Community cache, but that only affects future authentications. Active certificates remain valid until TTL expiry in both deployments.
There is no supported Teleport setting that refreshes group membership on a live certificate without re-issuance. Manual tctl auth cache clear affects only subsequent authentications. To approach sub-TTL freshness, shorten the certificate TTL and depend on silent re-authentication through the IdP. Confirm your clients and IdP support silent token refresh before lowering TTL in production.
Missing diagnostic detail: What Teleport version are you running? The recommendation changes if authentication_cache_ttl exists in your version, because config names and cache behavior vary by release.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.