Repository navigation
Remove OpenJDK 17 support on server side #55610
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
base: main
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,11 +3,6 @@ | |
| <modelVersion>4.0.0</modelVersion> | ||
|
|
||
| <properties> | ||
| <!-- this property prevents the warning "WARN FilenoUtil: Native subprocess control requires open access" when using JRuby for the unit tests on JDK17 --> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually, this is still needed in the end even on later JDKs. Sorry I was not clear in my previous review that here only we just need to update the comment. |
||
| <surefire.system.args> | ||
| --add-opens=java.base/sun.nio.ch=ALL-UNNAMED | ||
| --add-opens java.base/java.io=ALL-UNNAMED | ||
| </surefire.system.args> | ||
| <version.jsoup>1.23.2</version.jsoup> | ||
| </properties> | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,6 +4,10 @@ | |
| Breaking changes are identified as those that might require changes for existing users to their configurations or applications. | ||
| In minor or patch releases, {project_name} will only introduce breaking changes to fix bugs. | ||
|
|
||
| === OpenJDK 17 support removed | ||
|
|
||
| Keycloak server no longer supports running on OpenJDK 17, and the minimum supported version is now OpenJDK 21. | ||
|
|
||
|
Comment on lines
+7
to
+10
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggestion: the upgrading guide could help users assess impact with a few lines. But if you would like to keep things concise, that's not a problem. Something like: === OpenJDK 17 support removed
Keycloak server no longer supports running on OpenJDK 17, and the minimum supported version is now OpenJDK 21.
The official container image already uses OpenJDK 21 and is not affected by this change.
Client libraries (`keycloak-admin-client`, `keycloak-authz-client`) continue to support Java 8.
FIPS 140-2 deployments no longer need the `kc.java.security` file or the manual `XMLDSig` provider configuration that was required with older OpenJDK 17 versions. |
||
| === Authorization policies with deleted references | ||
|
|
||
| Role policies with a missing required role and negative role, group, user, client, or client scope policies with unresolved references now evaluate as invalid. | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,7 +16,7 @@ FIPS library is not officially validated with OpenJDK 25. Hence for FIPS 140-2 c | |
| To run in FIPS 140-2, {project_name} should run on a FIPS 140-2 enabled system. This requirement usually assumes RHEL or Fedora where FIPS was enabled during installation. | ||
| See https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html-single/security_hardening/index#assembly_installing-the-system-in-fips-mode_security-hardening[RHEL documentation] | ||
| for the details. When the system is in FIPS mode, it makes sure that the underlying OpenJDK is in FIPS mode as well and would use only | ||
| https://docs.redhat.com/en/documentation/red_hat_build_of_openjdk/17/html/configuring_red_hat_build_of_openjdk_17_on_rhel_with_fips/openjdk-default-fips-configuration#security_providers[FIPS enabled security providers]. | ||
| https://docs.redhat.com/en/documentation/red_hat_build_of_openjdk/21/html/configuring_red_hat_build_of_openjdk_21_on_rhel_with_fips/openjdk-default-fips-configuration#security_providers[FIPS enabled security providers]. | ||
|
|
||
| To check that the system is in FIPS mode, you can check it with the following command from the command line: | ||
|
|
||
|
|
@@ -162,32 +162,6 @@ always fulfils this requirement. | |
|
|
||
| == Other restrictions | ||
|
|
||
| To have SAML working, make sure that a `XMLDSig` security provider is available in your security providers. | ||
| To have Kerberos working, make sure that a `SunJGSS` security provider is available. In FIPS enabled RHEL 9 in OpenJDK 21, the `XMLDSig` security provider may be already enabled | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| in the `java.security` by default and the same applies with latest OpenJDK 17. But with older OpenJDK 17, it may not be enabled by default, which means that SAML effectively cannot work. | ||
|
|
||
| To have SAML working, you can manually add the provider into `JAVA_HOME/conf/security/java.security` into the list fips providers. For example, add the line such as the following in case | ||
| that it is not already available in your FIPS security providers: | ||
|
|
||
| [source] | ||
| ---- | ||
| fips.provider.7=XMLDSig | ||
| ---- | ||
|
|
||
| Adding this security provider should work well. In fact, it is FIPS compliant and is already added by default in the OpenJDK 21 and newer versions of OpenJDK 17. | ||
| Details are in the https://bugzilla.redhat.com/show_bug.cgi?id=1940064[bugzilla]. | ||
|
|
||
| NOTE: It is recommended to look at `JAVA_HOME/conf/security/java.security` and check all configured providers here and make sure that the number matches. In other words, `fips.provider.7` | ||
| assumes that there are already 6 providers configured with prefix like `fips.provider.N` in this file. | ||
|
|
||
| If you prefer not to edit your `java.security` file inside java itself, you can create a custom java security file (for example named `kc.java.security`) and add only the single | ||
| property above for adding XMLDSig provider into that file. Then start your {project_name} server with this property file attached: | ||
|
|
||
| [source] | ||
| ---- | ||
| -Djava.security.properties=/location/to/your/file/kc.java.security | ||
| ---- | ||
|
|
||
| For Kerberos/SPNEGO, the security provider `SunJGSS` is not yet fully FIPS compliant. Hence it is not recommended to add it to your list of security providers | ||
| if you want to be FIPS compliant. The `KERBEROS` feature is disabled by default in {project_name} when it is executed on FIPS platform and when security provider is not | ||
| available. Details are in the https://bugzilla.redhat.com/show_bug.cgi?id=2051628[bugzilla]. | ||
|
|
@@ -232,7 +206,6 @@ For example in the current directory, you can create sub-directory `files` and a | |
|
|
||
| * BC FIPS jar files as described above | ||
| * Custom keystore file - named for example `keycloak-fips.keystore.bcfks` | ||
| * Security file `kc.java.security` with added provider for SAML (Not needed with OpenJDK 21 or newer OpenJDK 17) | ||
|
|
||
| Then create `Containerfile` in the current directory similar to this: | ||
|
|
||
|
|
@@ -246,7 +219,6 @@ ADD files /tmp/files/ | |
| WORKDIR /opt/keycloak | ||
| RUN cp /tmp/files/*.jar /opt/keycloak/providers/ | ||
| RUN cp /tmp/files/keycloak-fips.keystore.* /opt/keycloak/conf/server.keystore | ||
| RUN cp /tmp/files/kc.java.security /opt/keycloak/conf/ | ||
|
|
||
| RUN /opt/keycloak/bin/kc.sh build --features=fips --fips-mode=strict | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,9 +13,9 @@ | |
| <name>Keycloak Admin API v2 APIs</name> | ||
|
|
||
| <properties> | ||
| <maven.compiler.source>11</maven.compiler.source> | ||
| <maven.compiler.target>11</maven.compiler.target> | ||
| <maven.compiler.release>11</maven.compiler.release> | ||
| <maven.compiler.source>${java.adapter.minimum.version}</maven.compiler.source> | ||
| <maven.compiler.target>${java.adapter.minimum.version}</maven.compiler.target> | ||
| <maven.compiler.release>${java.adapter.minimum.version}</maven.compiler.release> | ||
|
Comment on lines
+16
to
+18
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note: This is only cosmetic, and not a dealbreaker to merge this PR, so use it if you think it makes sense. The only scenario where the comment below makes sense is if someone tries to use keycloak-admin-v2-api as a dependency in a project running on Java 8 or Java 11 outside Keycloak. They'd see that the artifact warning Java 8 compatibility, add it to their project, and then get NoClassDefFoundError at runtime when the JVM tries to load the Jakarta EE 10 classes. If that's acceptable, you don't need to read the text below :) This is changing the compiler target from Java 11 to Java 8. The module depends on Jakarta EE 10 APIs ( Two alternatives: A) Remove the explicit compiler override entirely and inherit B) Restore Either way the
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
That's a realistic scenario, it might be used with the Java Admin Client that supports Java as old as 8. |
||
| <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
| </properties> | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AI claims
SecureRandom.getInstanceStrong()is not enabled in true FIPS environment. That our CI misses it because the the kernel is not switched to FIPS, hence JDK is not switched to true FIPS mode either.I think we might need some help from @mposolda on this.
Alternatively we could just revert this change to unblock Java 17 deprecation and tackle this clean up as a follow-up. That would be my preferred approach.