Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider a caching strategy #1

Open
evan2645 opened this issue Mar 26, 2020 · 1 comment
Open

Consider a caching strategy #1

evan2645 opened this issue Mar 26, 2020 · 1 comment

Comments

@evan2645
Copy link

SPIRE Agent may not always be available, for any number of reasons (bug, upgrade, bad config push, etc). This is particularly important for JWT-SVID because its use is usually tightly coupled with the request path. I briefly reviewed the handler and spire code and didn't see anything along these lines, so thought I'd make the suggestion.

Ingress Mode

Can cache the whole token, or a hash of the token, and the authz response. Deciding how long to hold onto the response can be tricky - you want it long enough to survive some sort of agent outage, but short enough to not seriously affect your ability to redact.

Egress Mode

Token can be cached as a function of audience, and its lifetime in the cache can be a function of the token's TTL.

@joewilliams
Copy link
Contributor

Thanks @evan2645! This all makes sense to me.

For ingress mode we would need to still validate the request but could just make sure the token looks right and that the last time it auth'd (within a window) it was successful rather than make the request down to spire.

For egress it's a bit easier since we can just keep a map of audience and tokens that expire instead of making the round trip to spire.

@joewilliams joewilliams transferred this issue from another repository Jul 22, 2020
@joewilliams joewilliams transferred this issue from another repository Jul 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants