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

Token retention policy #4

Open
peppelinux opened this issue Oct 22, 2021 · 6 comments
Open

Token retention policy #4

peppelinux opened this issue Oct 22, 2021 · 6 comments
Labels
help wanted Extra attention is needed question Further information is requested

Comments

@peppelinux
Copy link
Member

peppelinux commented Oct 22, 2021

@MdreW @melanger @c00kiemon5ter @nsklikas

I have to discuss with you about this topic, how satosa-oidcop handles the expired/refreshed token.
At this time the expired will be pruned automatically if a mongo index for doing this is configured

the refreshed token instead will overwrite the old session.

This behaviour was implemented in here:

q = {"grant_id": data["grant_id"]}

as you can see if you refresh a token, using this snippet for example
https://oidcop.readthedocs.io/en/latest/contents/usage.html#refresh-token

the session will be overwritten.
That looks good to me, why I should store an expired access_token?

But I admit that there would be some cases where an organization would store also the history.
I don't know if a general configuration parameter would be a good compromise for this.

what do you think about?

@peppelinux peppelinux added help wanted Extra attention is needed question Further information is requested labels Oct 22, 2021
@MdreW
Copy link
Collaborator

MdreW commented Oct 22, 2021

the history of authentications must go in the logs not in the database.... too much data is bad data

@c00kiemon5ter
Copy link

Is there a use case that requires to differentiate between different states of a token?

  • revoked tokens
  • expired tokens
  • and unknown tokens

Would we need to know when a token expired and when it was removed? (different timepoints each event took place)

I guess the answers rely on the business, in relation to regulations (what would be good-enough for an auditor?)

@MdreW
Copy link
Collaborator

MdreW commented Oct 28, 2021

I think that can be useful know when an user has renewed a token for an incidents analysys and not for the authentication/authorization process.

If it's necessary to check a token I need to validate only the current token, the olders are history

@peppelinux
Copy link
Member Author

@c00kiemon5ter

in the new/update method of the storage we can save/store/archiviate any historical information before (re)write the object.
We may have to decide if this is a desidered feature and where to keep this information (in the db or in the logs)

any idea is appreciated

@MdreW
Copy link
Collaborator

MdreW commented Nov 16, 2021

thinking in a bored time.... if the problem is follow the token's history, we can add the session sid (or an UUID) in the OIDC log with necessary info.

With this trick the history is readable / seachable and the DB is not full, grep ${SID} satosa_oidc.log and you have a full user history.

@rohe
Copy link
Contributor

rohe commented Nov 17, 2021

I agree with @MdreW access tokens that for some reason (revoked/expired/...) are not usable anymore should not be in
persistent storage. Putting enough information in the log to be able to later follow a token trail sounds good to me.

Whether the pruning is done by the library or by the persistent storage I don't really care.

We probably should provide one way of doing it in the library. This could be governed by configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants