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

Fix the FIPS hardware encryption issue that doesn't allow Keycloak to start #134

Closed
wants to merge 2 commits into from

Conversation

carlosthe19916
Copy link
Member

@carlosthe19916 carlosthe19916 commented Apr 28, 2022

Bug diagnosis

  • Keycloak does not support FIPS mode enabled
  • Every single Keycloak instance higher than >=15.1.0 will fail to run if the OS where it is running has FIPS enabled => hence JDK.
  • We can not add users using add-user-keycloak.sh hence we can not init the admin user neither the mta user

A detailed explanation is being given at keycloak/keycloak#9916

Useful links:

About this PR

Adding the JAVA_OPTS ENV variable

Note: We are not using JAVA_OPTS_APPEND (as described in the Keycloak issue comments) but JAVA_OPTS otherwise the users admin neither mta will be created.

Steps to test this PR:

Create a container image for the operator

  • Check out this PR
  • Create a container image for the operator using:
./mvnw clean package \
-Dquarkus.container-image.build=true \
-Dquarkus.container-image.registry=quay.io \
-Dquarkus.container-image.tag=fips \
-DskipTests
  • The previous command should've created a container image called quay.io/windupeng/windup-operator-native:fips
  • Tag the previous container image to use your own username:
docker tag quay.io/windupeng/windup-operator-native:fips \
quay.io/YOUR_USERNAME/windup-operator-native:fips
  • Push the container image to your quay.io account.

Deploy the operator (you need an OCP instance where you have cluster-admin permissions)

  • Open the file src/main/resources/k8s/def/windup.deployment.yaml and replace the line 20 to point to your custom image. So
    - image: quay.io/windupeng/windup-operator-native:latest should become - image: quay.io/YOUR_USERNAME/windup-operator-native:native:fips

  • Create a namespace named mta (the name must be mta):

oc new-project mta
  • Execute:
cd ./src/main/resources/k8s/def/
./script.create.all.sh
  • Create a Windup instance:
oc create -f src/main/resources/k8s/examples/windup.yaml -n mta
  • There should be a deployment called mta-example and the ENV variables of that deployment should contain the new ENV JAVA_OPTS with value -Dcom.redhat.fips=false

That's all. We need to keep in mind that this PR only adds a new ENV variable to the deployment, it is not changing any core behaviour of the operator

@carlosthe19916 carlosthe19916 added the WIP work in progress label Apr 28, 2022
@carlosthe19916 carlosthe19916 removed the WIP work in progress label Apr 28, 2022
Copy link
Member

@mrizzi mrizzi left a comment

Choose a reason for hiding this comment

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

Keycloak deployment has been removed so the PR is not needed anymore.
Thanks @carlosthe19916 for having investigated this issue 👍

@mrizzi mrizzi closed this Aug 29, 2022
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