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

Added dataset options for setting password hashing algorithm and iterations. #778

Merged
merged 2 commits into from
Apr 19, 2024

Conversation

tkyjovsk
Copy link
Contributor

Added options -g ALGORITHM and -i ITERATIONS to the dataset-import.sh script for adjusting the realm password policy. Both are optional. The DatasetResourceProvider will only apply the options which were provided.

@tkyjovsk tkyjovsk requested a review from kami619 April 17, 2024 15:19
…o the dataset provider module.

Signed-off-by: Tomas Kyjovsky <tkyjovsk@redhat.com>
@kami619
Copy link
Contributor

kami619 commented Apr 18, 2024

@tkyjovsk thanks a lot for adding this back in a proper way. I think we have to update the docs.

Ref., from last time when we modified them - https://github.com/keycloak/keycloak-benchmark/pull/751/files#diff-cdf53b413cfe9e2a53e09baeed0645f6744d883049fb1f458d6d8e4155921496L34

Copy link
Contributor

@kami619 kami619 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need to update the docs.

@kami619
Copy link
Contributor

kami619 commented Apr 19, 2024

@tkyjovsk I am going to add the docs and test it.

@kami619
Copy link
Contributor

kami619 commented Apr 19, 2024

Tested with different hashing algorithm values and iterations that are set for KC22, KC24, KC25 and users are created as expected in the specific realms.

  • argon2
  • pbkdf2-sha512
  • pbkdf2-sha256
> ./dataset-import.sh -a create-realms -r 1 -g argon2 -i 10 -c 100 -u 200 -l https://client.gh-keycloak-a-gh-keycloak-b-xxxxx.keycloak-benchmark.com/realms/master/dataset
Action: [create-realms]
Creating 1 realms with 100 clients and 200 users with 10 password-hashing iterations using the argon2 algorithm.
{"status":"Task started successfully","task":{"startTimeMs":"1713533453546","message":"Creation of 1 realms from realm-0 to realm-0"},"task-status-url":"https://client.gh-keycloak-a-gh-keycloak-b-xxxxx.keycloak-benchmark.com/realms/master/dataset/status"}
> ./dataset-import.sh -a create-realms -r 1 -g pbkdf2-sha512 -i 210000 -c 100 -u 200 -l https://client.gh-keycloak-a-gh-keycloak-b-xxxx.keycloak-benchmark.com/realms/master/dataset
Action: [create-realms]
Creating 1 realms with 100 clients and 200 users with 210000 password-hashing iterations using the pbkdf2-sha512 algorithm.
{"status":"Task started successfully","task":{"startTimeMs":"1713534853780","message":"Creation of 1 realms from realm-1 to realm-1"},"task-status-url":"https://client.gh-keycloak-a-gh-keycloak-b-xxxxx.keycloak-benchmark.com/realms/master/dataset/status"}
> ./dataset-import.sh -a create-realms -r 1 -g pbkdf2-sha256 -i 210000 -c 100 -u 200 -l https://client.gh-keycloak-a-gh-keycloak-b-xxxxx.keycloak-benchmark.com/realms/master/dataset
Action: [create-realms]
Creating 1 realms with 100 clients and 200 users with 210000 password-hashing iterations using the pbkdf2-sha256 algorithm.
{"status":"Task started successfully","task":{"startTimeMs":"1713535141813","message":"Creation of 1 realms from realm-2 to realm-2"},"task-status-url":"https://client.gh-keycloak-a-gh-keycloak-b-xxxx.keycloak-benchmark.com/realms/master/dataset/status"}

Signed-off-by: Kamesh Akella <kamesh.asp@gmail.com>
@kami619 kami619 merged commit 6d09ff0 into keycloak:main Apr 19, 2024
3 checks passed
@tkyjovsk tkyjovsk deleted the dataset-password-policy branch April 19, 2024 14:48
tkyjovsk added a commit to tkyjovsk/keycloak-benchmark that referenced this pull request Apr 19, 2024
…ations. (keycloak#778)

* Added options for setting password hashing algorithm and iterations to the dataset provider module.

Signed-off-by: Tomas Kyjovsky <tkyjovsk@redhat.com>

* updating docs

Signed-off-by: Kamesh Akella <kamesh.asp@gmail.com>

---------

Signed-off-by: Tomas Kyjovsky <tkyjovsk@redhat.com>
Signed-off-by: Kamesh Akella <kamesh.asp@gmail.com>
Co-authored-by: Kamesh Akella <kamesh.asp@gmail.com>

# Conflicts:
#	dataset/dataset-import.sh
#	dataset/src/main/java/org/keycloak/benchmark/dataset/DatasetResourceProvider.java
#	dataset/src/main/java/org/keycloak/benchmark/dataset/config/DatasetConfig.java
#	doc/dataset/modules/ROOT/pages/using-provider.adoc
kami619 pushed a commit that referenced this pull request Apr 19, 2024
…ations. (#778) (#780)

* Added options for setting password hashing algorithm and iterations to the dataset provider module.

Signed-off-by: Tomas Kyjovsky <tkyjovsk@redhat.com>

* updating docs

Signed-off-by: Kamesh Akella <kamesh.asp@gmail.com>

---------

Signed-off-by: Tomas Kyjovsky <tkyjovsk@redhat.com>
Signed-off-by: Kamesh Akella <kamesh.asp@gmail.com>
Co-authored-by: Kamesh Akella <kamesh.asp@gmail.com>

# Conflicts:
#	dataset/dataset-import.sh
#	dataset/src/main/java/org/keycloak/benchmark/dataset/DatasetResourceProvider.java
#	dataset/src/main/java/org/keycloak/benchmark/dataset/config/DatasetConfig.java
#	doc/dataset/modules/ROOT/pages/using-provider.adoc
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

Successfully merging this pull request may close these issues.

None yet

2 participants