Add configuration that allows filtering based on known client_id #100

Closed
opened 2024-10-28 16:51:37 +01:00 by xgp · 2 comments
xgp commented 2024-10-28 16:51:37 +01:00 (Migrated from github.com)

https://github.com/kokuwaio/keycloak-event-metrics/blob/main/src/main/java/io/kokuwa/keycloak/metrics/event/MetricsEventListener.java#L36

If a Keycloak system is under attack by an adversary that is attempting to find vulnerabilities or execute script injection attacks, they may set the client_id value to arbitrary values. This can pollute the metrics, and cause an explosion of the counters. In order to mitigate this, I suggest adding a configuration that allows unknown clients to either be ignored, or grouped into an UNKNOWN client_id.

Let me know what you think, and I'll PR.

https://github.com/kokuwaio/keycloak-event-metrics/blob/main/src/main/java/io/kokuwa/keycloak/metrics/event/MetricsEventListener.java#L36 If a Keycloak system is under attack by an adversary that is attempting to find vulnerabilities or execute script injection attacks, they may set the `client_id` value to arbitrary values. This can pollute the metrics, and cause an explosion of the counters. In order to mitigate this, I suggest adding a configuration that allows unknown clients to either be ignored, or grouped into an `UNKNOWN` `client_id`. Let me know what you think, and I'll PR.
sschnabe commented 2024-10-29 08:21:07 +01:00 (Migrated from github.com)

Ignoring them may hide the fact that the system is under attack. I would collect the unknown client_id in UNKNOWN as you proposed! Thank you!

Ignoring them may hide the fact that the system is under attack. I would collect the unknown `client_id` in `UNKNOWN` as you proposed! Thank you!
sschnabe commented 2024-12-03 19:38:56 +01:00 (Migrated from github.com)

Released with 1.1.0

Released with [1.1.0](https://github.com/kokuwaio/keycloak-event-metrics/releases/tag/1.1.0)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference: kokuwaio/keycloak-event-metrics#100
No description provided.