File tree Expand file tree Collapse file tree 3 files changed +6
-31
lines changed
test/fixtures/krb5kdc-fixture
src/main/resources/provision Expand file tree Collapse file tree 3 files changed +6
-31
lines changed Original file line number Diff line number Diff line change 11FROM ubuntu:24.04
22
33ADD . /fixture
4- # Update the package listing
5- RUN apt-get update
4+ RUN apt-get update && apt-get install -y --no-install-recommends python3 krb5-kdc krb5-admin-server && apt-get clean && rm -rf /var/lib/apt/lists/*
65
7- # Install sudo
8- RUN apt-get install -y sudo python3
96RUN echo kerberos.build.elastic.co > /etc/hostname
107RUN bash /fixture/src/main/resources/provision/installkdc.sh
118
Original file line number Diff line number Diff line change @@ -45,16 +45,16 @@ USER_KTAB=$LOCALSTATEDIR/$USER.keytab
4545
4646if [ -f $USER_KTAB ] && [ -z " $PASSWD " ]; then
4747 echo " Principal '${PRINC} @${REALM} ' already exists. Re-copying keytab..."
48- sudo cp $USER_KTAB $KEYTAB_DIR /$USER .keytab
48+ cp $USER_KTAB $KEYTAB_DIR /$USER .keytab
4949else
5050 if [ -z " $PASSWD " ]; then
5151 echo " Provisioning '${PRINC} @${REALM} ' principal and keytab..."
52- sudo kadmin -p $ADMIN_PRIN -kt $ADMIN_KTAB -q " addprinc -randkey $USER_PRIN "
53- sudo kadmin -p $ADMIN_PRIN -kt $ADMIN_KTAB -q " ktadd -k $USER_KTAB $USER_PRIN "
54- sudo cp $USER_KTAB $KEYTAB_DIR /$USER .keytab
52+ kadmin -p $ADMIN_PRIN -kt $ADMIN_KTAB -q " addprinc -randkey $USER_PRIN "
53+ kadmin -p $ADMIN_PRIN -kt $ADMIN_KTAB -q " ktadd -k $USER_KTAB $USER_PRIN "
54+ cp $USER_KTAB $KEYTAB_DIR /$USER .keytab
5555 else
5656 echo " Provisioning '${PRINC} @${REALM} ' principal with password..."
57- sudo kadmin -p $ADMIN_PRIN -kt $ADMIN_KTAB -q " addprinc -pw $PASSWD $PRINC "
57+ kadmin -p $ADMIN_PRIN -kt $ADMIN_KTAB -q " addprinc -pw $PASSWD $PRINC "
5858 fi
5959fi
6060
Original file line number Diff line number Diff line change @@ -49,28 +49,6 @@ touch $LOGDIR/kadmin.log
4949touch $LOGDIR /krb5kdc.log
5050touch $LOGDIR /krb5lib.log
5151
52- # Update package manager
53- apt-get update -qqy
54-
55- # Installation asks a bunch of questions via debconf. Set the answers ahead of time
56- debconf-set-selections <<< " krb5-config krb5-config/read_conf boolean true"
57- debconf-set-selections <<< " krb5-config krb5-config/kerberos_servers string $KDC_NAME"
58- debconf-set-selections <<< " krb5-config krb5-config/add_servers boolean true"
59- debconf-set-selections <<< " krb5-config krb5-config/admin_server string $KDC_NAME"
60- debconf-set-selections <<< " krb5-config krb5-config/add_servers_realm string $REALM_NAME"
61- debconf-set-selections <<< " krb5-config krb5-config/default_realm string $REALM_NAME"
62- debconf-set-selections <<< " krb5-admin-server krb5-admin-server/kadmind boolean true"
63- debconf-set-selections <<< " krb5-admin-server krb5-admin-server/newrealm note"
64- debconf-set-selections <<< " krb5-kdc krb5-kdc/debconf boolean true"
65- debconf-set-selections <<< " krb5-kdc krb5-kdc/purge_data_too boolean false"
66-
67- # Install krb5 packages
68- apt-get install -qqy krb5-{admin-server,kdc}
69-
70- # /dev/random produces output very slowly on Ubuntu VM's. Install haveged to increase entropy.
71- apt-get install -qqy haveged
72- haveged
73-
7452# Create kerberos database with stash file and garbage password
7553kdb5_util create -s -r $REALM_NAME -P zyxwvutsrpqonmlk9876
7654
You can’t perform that action at this time.
0 commit comments