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

Cardinality issue with non-existent client #197

Open
rekup opened this issue Mar 11, 2024 · 1 comment
Open

Cardinality issue with non-existent client #197

rekup opened this issue Mar 11, 2024 · 1 comment

Comments

@rekup
Copy link

rekup commented Mar 11, 2024

Description

This extension exposes several metrics about attempted logins to non-existent clients:

  • keycloak_failed_login_attempts_created
  • keycloak_failed_login_attempts_total
  • keycloak_login_attempts_created
  • keycloak_login_attempts_total

The problem is that if some script kiddie scans keycloak they might use any data as client id which will cause a huge number metrics:

image

Expected Behavior

I would expect that this extension only creates metrics for existing clients and maybe exposes one metric which records all the events for non-existent clients.

Environment

  • keycloak-metrics-spi: 5.0.0
  • Keycloak: 23.0.7

Steps to reproduce

  1. Start keycloak with the keycloak-metrics-spi extension
  2. Make a auth request to a non-existent client: https://sso.example.org/auth/realms/my-realm/protocol/openid-connect/auth?client_id=foo&redirect_uri=https%3A%2F%2Ffoo.example.org&response_type=code&state=1234
  3. Check the generated metrics using promql: sum by(__name__, client_id) ({client_id="foo1"})
@tolleiv
Copy link

tolleiv commented May 21, 2024

@pb82 @aerogear are you open for contributions for this one?

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