8000 Provide default krb5.conf in Docker image or extend migration docs · Issue #32527 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content

Provide default krb5.conf in Docker image or extend migration docs #32527

Description

@hwanders

Description

When upgrading my Keycloak 20 to v25 (I know, that was late) using the official Docker images, SSO with Kerberos stopped working.
TL;DR: The default /etc/krb5.conf is not provided in the image since Keycloak 21 which was necessary for our configuration.

I think you should

  • either provide a default /etc/krb5.conf and /etc/krb5.conf.d/crypto-policies (as it was before)
  • or documented the necessity to add those files in the migration guide (for Keycloak 21)
  • or install the krb5-libs library in the image

Discussion

No response

Motivation

  • I need to ensure compatibility with an old Kerberos server using the RC4-HMAC algorithm
  • To achieve this I created a custom image based on yours, which adds a crypto-policies file to /etc/krb5.conf.d/ allowing weak algorithms
  • This worked fine in Keycloak 20 - but does not work anymore in Keycloak 25

Details

I have analyzed the problem and found the reason:

  • Since Keycloak 21 you seem to use Red Hat's UBI micro image as base image (see this Dockerfile)
  • Previously you used the UBI minimal image (see this earlier commit where you switched from ubi8-minimal to ubi8-micro)
  • Unfortunately the micro image variant does not include the package krb5-libs
    • compare packages in ubi9 micro and ubi9 minimal
    • As far as I know it's exactly the krb5-libs package which includes the default /etc/krb5.conf file with directive includedir /etc/krb5.conf.d/ and some reasonable [libdefaults] settings (for example look at the Source RPM here)

The full krb5-libs package is probably not required to have working Kerberos support in Keycloak.
It seems to suffice to add back the files /etc/krb5.conf and /etc/krb5.conf.d/crypto-policies.
The /etc/krb5.conf will be picked up by Java when trying to login with Kerberos authentication.

My solution

My personal solution was to copy the (missing) original /etc/krb5.conf and extend the Dockerfile to include this in my derived Keycloak 25 image. The default krb5.conf can be found in the Source RPM linked on this page.

Activity

  1. changed the title [-]Provide default krb5.conf or extend migration docs[/-] [+]Provide default krb5.conf in Docker image or extend migration docs[/+] on Aug 30, 2024
  2. oers commented on Jun 20, 2025

    @oers

    I'm affected by this as well. Maybe it would be a great idea to provide a docker image where the freeipa keycloak client is installed.

  3. ASzc commented on Jan 20, 2026

    @ASzc
    Contributor

    Adding the whole krb5-libs package isn't feasible because of its dependency on openssl. My recommendation in previous cases was to install krb5-libs when customizing the image. I had assumed that JNA was used to access krb5-libs binaries, but apparently JGSS provides the needed functionality, only depending on its customary config files.

    Adding in the default config files is feasible since they have no dependencies themselves, but I am surprised that they would be useful? You didn't configure any realm information?

    If realm configuration is required, I would prefer to solve this via documentation. If customization is required anyway, then there's no point hacking krb5.conf into the keycloak image by itself

  4. hwanders commented on Jan 25, 2026

    @hwanders
    Author

    @ASzc The default krb5.conf contains includedir /etc/krb5.conf.d/ - so people can place custom config files in that folder without touching the krb5.conf file. That's why some setups don't require a customized krb5.conf, maybe they don't even knew about that file and were surprised when it was missing.

  5. ASzc commented on Jan 26, 2026

    @ASzc
    Contributor

    Ok. I think this is best solved with a docs update then. Migration guide should mention it, and perhaps there's a spot in the main documentation this should be discussed too.

  6. self-assigned this
    on Jan 26, 2026
  7. ASzc commented on Jan 26, 2026

    @ASzc
    Contributor

    Please see PR #45764

  8. 18 remaining items

  9. added a commit that references this issue on Jul 20, 2026
    6e2bae3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Fields

Value

None yet

Effort

None yet

Votes

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    0