Skip to content

Commit 32360d8

Browse files
committed
Tweak krb5.conf template to be 1.20 compliant
krb5 1.20 seems to evaluate the krb5.conf and does not work with the unresolved kdc entry for the docker host (using MAPPING_PORT) This tweaks the krb5.conf template handling and local setup to address this and always have a valid krb5.conf file
1 parent 7931ff0 commit 32360d8

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

test/fixtures/krb5kdc-fixture/Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
FROM ubuntu:24.04
2+
23
ADD . /fixture
4+
# Update the package listing
5+
RUN apt-get update
6+
7+
# Install sudo
8+
RUN apt-get install -y sudo python3
39
RUN echo kerberos.build.elastic.co > /etc/hostname
410
RUN bash /fixture/src/main/resources/provision/installkdc.sh
511

test/fixtures/krb5kdc-fixture/src/main/java/org/elasticsearch/test/fixtures/krb5kdc/Krb5kDcContainer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ public String getConf() {
122122
.findFirst();
123123
String hostPortSpec = bindings.get().getHostPortSpec();
124124
String s = copyFileFromContainer("/fixture/build/krb5.conf.template", i -> IOUtils.toString(i, StandardCharsets.UTF_8));
125-
return s.replace("${MAPPED_PORT}", hostPortSpec);
125+
return s.replace("#KDC_DOCKER_HOST", "kdc = 127.0.0.1:" + hostPortSpec);
126126
}
127127

128128
public Path getKeytab() {

test/fixtures/krb5kdc-fixture/src/main/resources/provision/krb5.conf.template

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
# License v3.0 only", or the "Server Side Public License, v 1".
77

88
[libdefaults]
9+
spake_preauth_groups = edwards25519
910
default_realm = ${REALM_NAME}
1011
dns_canonicalize_hostname = false
1112
dns_lookup_kdc = false
@@ -25,7 +26,7 @@
2526
[realms]
2627
${REALM_NAME} = {
2728
kdc = 127.0.0.1:88
28-
kdc = 127.0.0.1:${MAPPED_PORT}
29+
#KDC_DOCKER_HOST
2930
admin_server = ${KDC_NAME}:749
3031
default_domain = ${BUILD_ZONE}
3132
}

0 commit comments

Comments
 (0)