ory / hydra

OpenID Certified™ OpenID Connect and OAuth Provider written in Go - cloud native, security-first, open source API security for your infrastructure. SDKs for any language. Works with Hardware Security Modules. Compatible with MITREid.
https://www.ory.sh/hydra/?utm_source=github&utm_medium=banner&utm_campaign=hydra
Apache License 2.0
15.44k stars 1.48k forks source link

Janitor should clean up old finished flows #3559

Open abador opened 1 year ago

abador commented 1 year ago

Preflight checklist

Describe your problem

At the moment janitor (in FlushInactiveLoginConsentRequests) cleans up the hydra_oauth2_flow for all states different than flow.FlowStateConsentUsed. This seems ok and cleans up any broken/unfinished flows. During our testing, we noticed that our database gets bloated and the data isn't flushed for short sessions/consents (combinations of consent_remember = 0|1, consent_remember_for = 0|60|3600, login_remember=0, login_remember_for=0 ). If I understand correctly those records could also be deleted. This also impacts hydra_oauth2_codeand hydra_oauth2_oidctables

Describe your ideal solution

An additional cleanup job is added that cleans up flows that have the statecolumn equal to flow.FlowStateConsentUsed, but aren't valid anymore (no other tables rely on them anymore).

Workarounds or alternatives

Running own query that cleans up the tables. This is doable if you have the same settings for every client, but I don't see a valid solution that would clean it up properly in other setups

Version

2.1.1

Additional Context

No response

github-actions[bot] commented 2 months ago

Hello contributors!

I am marking this issue as stale as it has not received any engagement from the community or maintainers for a year. That does not imply that the issue has no merit! If you feel strongly about this issue

Throughout its lifetime, Ory has received over 10.000 issues and PRs. To sustain that growth, we need to prioritize and focus on issues that are important to the community. A good indication of importance, and thus priority, is activity on a topic.

Unfortunately, burnout has become a topic of concern amongst open-source projects.

It can lead to severe personal and health issues as well as opening catastrophic attack vectors.

The motivation for this automation is to help prioritize issues in the backlog and not ignore, reject, or belittle anyone.

If this issue was marked as stale erroneously you can exempt it by adding the backlog label, assigning someone, or setting a milestone for it.

Thank you for your understanding and to anyone who participated in the conversation! And as written above, please do participate in the conversation if this topic is important to you!

Thank you 🙏✌️

Renkas commented 2 months ago

I'm also looking for a solution to clean up those tables.