diff --git a/scripts/ci/2-setup-kdc.sh b/scripts/ci/2-setup-kdc.sh index 56824f5a5ee3f..c5cd381c2f626 100755 --- a/scripts/ci/2-setup-kdc.sh +++ b/scripts/ci/2-setup-kdc.sh @@ -30,7 +30,7 @@ KRB5_KTNAME=/etc/airflow.keytab cat /etc/hosts echo "hostname: ${FQDN}" -sudo cp $DIRNAME/krb5/krb-conf/client/krb5.conf /etc/krb5.conf +sudo cp $DIRNAME/krb5/krb5.conf /etc/krb5.conf echo -e "${PASS}\n${PASS}" | sudo kadmin -p ${ADMIN}/admin -w ${PASS} -q "addprinc -randkey airflow/${FQDN}" sudo kadmin -p ${ADMIN}/admin -w ${PASS} -q "ktadd -k ${KRB5_KTNAME} airflow" diff --git a/scripts/ci/docker-compose.yml b/scripts/ci/docker-compose.yml index 4cfe68b0d0a6c..9ffeac49a0e8b 100644 --- a/scripts/ci/docker-compose.yml +++ b/scripts/ci/docker-compose.yml @@ -57,8 +57,7 @@ services: - ./openldap/ldif:/container/service/slapd/assets/config/bootstrap/ldif/custom krb5-kdc-server: - build: ./krb5 - image: krb5-kdc-server + image: godatadriven/krb5-kdc-server hostname: krb5-kdc-server domainname: example.com diff --git a/scripts/ci/krb5/Dockerfile b/scripts/ci/krb5/Dockerfile deleted file mode 100644 index cdb4cf979e05d..0000000000000 --- a/scripts/ci/krb5/Dockerfile +++ /dev/null @@ -1,52 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -FROM ubuntu:xenial - -# environment variables -ENV DEBIAN_FRONTEND noninteractive - -# Kerberos server -RUN apt-get update && apt-get install --no-install-recommends -y \ - ntp \ - python-dev \ - python-pip \ - python-wheel \ - python-setuptools \ - python-pkg-resources \ - krb5-admin-server \ - krb5-kdc - -RUN mkdir /app/ - -# Supervisord -RUN pip install supervisor==3.3.4 -RUN mkdir -p /var/log/supervisord/ - -COPY ./krb-conf/server/kdc.conf /etc/krb5kdc/kdc.conf -COPY ./krb-conf/server/kadm5.acl /etc/krb5kdc/kadm5.acl -COPY ./krb-conf/client/krb5.conf /etc/krb5.conf -COPY ./start_kdc.sh /app/start_kdc.sh - -# supervisord -COPY ./supervisord.conf /etc/supervisord.conf - -WORKDIR /app - -# when container is starting -CMD ["/bin/bash", "/app/start_kdc.sh"] diff --git a/scripts/ci/krb5/krb-conf/server/kadm5.acl b/scripts/ci/krb5/krb-conf/server/kadm5.acl deleted file mode 100644 index 41d17385ff144..0000000000000 --- a/scripts/ci/krb5/krb-conf/server/kadm5.acl +++ /dev/null @@ -1,18 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -*/admin@TEST.LOCAL * diff --git a/scripts/ci/krb5/krb-conf/server/kdc.conf b/scripts/ci/krb5/krb-conf/server/kdc.conf deleted file mode 100644 index c21095f418d4a..0000000000000 --- a/scripts/ci/krb5/krb-conf/server/kdc.conf +++ /dev/null @@ -1,30 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -[kdcdefaults] -kdc_ports = 88 -kdc_tcp_ports = 88 - -[realms] -TEST.LOCAL = { - #master_key_type = aes256-cts - acl_file = /etc/krb5kdc/kadm5.acl - dict_file = /usr/share/dict/words - admin_keytab = /var/krb5kdc/kadm5.keytab - max_renewable_life = 7d 0h 0m 0s - supported_enctypes = aes256-cts:normal aes128-cts:normal des3-hmac-sha1:normal arcfour-hmac:normal des-hmac-sha1:normal des-cbc-md5:normal des-cbc-crc:normal -} diff --git a/scripts/ci/krb5/krb-conf/client/krb5.conf b/scripts/ci/krb5/krb5.conf similarity index 92% rename from scripts/ci/krb5/krb-conf/client/krb5.conf rename to scripts/ci/krb5/krb5.conf index 471737a964123..77c78d686e39e 100644 --- a/scripts/ci/krb5/krb-conf/client/krb5.conf +++ b/scripts/ci/krb5/krb5.conf @@ -30,7 +30,7 @@ renew_lifetime = 7d forwardable = true [realms] - TEST.LOCAL = { - kdc = krb5-kdc-server:88 - admin_server = krb5-kdc-server - } +TEST.LOCAL = { + kdc = krb5-kdc-server:88 + admin_server = krb5-kdc-server +} diff --git a/scripts/ci/krb5/start_kdc.sh b/scripts/ci/krb5/start_kdc.sh deleted file mode 100755 index 6e02f006fa830..0000000000000 --- a/scripts/ci/krb5/start_kdc.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env bash - -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -set -exuo pipefail - -FQDN=`hostname` -ADMIN="admin" -PASS="airflow" -KRB5_KTNAME=/etc/airflow.keytab - -cat /etc/hosts -echo "hostname: ${FQDN}" -# create kerberos database -echo -e "${PASS}\n${PASS}" | kdb5_util create -s -# create admin -echo -e "${PASS}\n${PASS}" | kadmin.local -q "addprinc ${ADMIN}/admin" -# create airflow -echo -e "${PASS}\n${PASS}" | kadmin.local -q "addprinc -randkey airflow" -echo -e "${PASS}\n${PASS}" | kadmin.local -q "addprinc -randkey airflow/${FQDN}" -kadmin.local -q "ktadd -k ${KRB5_KTNAME} airflow" -kadmin.local -q "ktadd -k ${KRB5_KTNAME} airflow/${FQDN}" - -# Start services -/usr/local/bin/supervisord -n -c /etc/supervisord.conf diff --git a/scripts/ci/krb5/supervisord.conf b/scripts/ci/krb5/supervisord.conf deleted file mode 100644 index 165e5cde84646..0000000000000 --- a/scripts/ci/krb5/supervisord.conf +++ /dev/null @@ -1,43 +0,0 @@ -; -; Licensed to the Apache Software Foundation (ASF) under one -; or more contributor license agreements. See the NOTICE file -; distributed with this work for additional information -; regarding copyright ownership. The ASF licenses this file -; to you under the Apache License, Version 2.0 (the -; "License"); you may not use this file except in compliance -; with the License. You may obtain a copy of the License at -; -; http://www.apache.org/licenses/LICENSE-2.0 -; -; Unless required by applicable law or agreed to in writing, -; software distributed under the License is distributed on an -; "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -; KIND, either express or implied. See the License for the -; specific language governing permissions and limitations -; under the License. - -; supervisord.conf - kdc-server - -[supervisord] -logfile=/var/log/supervisord/supervisord.log ; supervisord log file -logfile_maxbytes=50MB ; maximum size of logfile before rotation -logfile_backups=10 ; number of backed up logfiles -loglevel=error ; info, debug, warn, trace -pidfile=/var/run/supervisord.pid ; pidfile location -nodaemon=false ; run supervisord as a daemon -minfds=1024 ; number of startup file descriptors -minprocs=200 ; number of process descriptors -user=root ; default user -childlogdir=/var/log/supervisord/ ; where child log files will live - -[program:krb5-kdc] -command=service krb5-kdc start -autostart=true -autorestart=true - -[program:krb5-admin-server] -command=service krb5-admin-server start -autostart=true -autorestart=true - -[supervisorctl]