aboutsummaryrefslogtreecommitdiff
path: root/docker/keystone/keystone-ssh
diff options
context:
space:
mode:
authorShaun Smekel <shaun.smekel@theorem.net.au>2016-08-05 07:44:42 +1000
committerShaun Smekel <shaun.smekel@theorem.net.au>2016-08-25 20:13:02 +1000
commit524868c632b23385145d140e5e6abab82cda50cf (patch)
tree0e9b67ec49047c8a849c261a629942b9a7a6a60c /docker/keystone/keystone-ssh
parent1e222274e155d6db11c80aee4c48d9e5f3713e22 (diff)
downloadkolla-524868c632b23385145d140e5e6abab82cda50cf.tar.gz
kolla-524868c632b23385145d140e5e6abab82cda50cf.zip
Add dockerfiles for keystone fernet
This adds the docker aspects of fernet key bootstrapping as well as distributed key rotation. - Bootstrapping is handled in the same way as keystone bootstrap. - A new keystone-fernet and keystone-ssh container is created to allow the nodes to communicate with each other (taken from nova-ssh). - The keystone-fernet is a keystone container with crontab installed. This will handle key rotations through keystone-manage and trigger an rsync to push new tokens to other nodes. The Ansible component is implemented in: https://review.openstack.org/#/c/349366 Change-Id: Id610e00e8c63c7f1bc0974c0aa1b3f44c18e1019 Partially-Implements: blueprint keystone-fernet-token Partially-Implements: blueprint third-party-plugin-support
Diffstat (limited to 'docker/keystone/keystone-ssh')
-rw-r--r--docker/keystone/keystone-ssh/Dockerfile.j221
-rw-r--r--docker/keystone/keystone-ssh/extend_start.sh20
2 files changed, 41 insertions, 0 deletions
diff --git a/docker/keystone/keystone-ssh/Dockerfile.j2 b/docker/keystone/keystone-ssh/Dockerfile.j2
new file mode 100644
index 000000000..2f5389742
--- /dev/null
+++ b/docker/keystone/keystone-ssh/Dockerfile.j2
@@ -0,0 +1,21 @@
+FROM {{ namespace }}/{{ image_prefix }}keystone-base:{{ tag }}
+MAINTAINER {{ maintainer }}
+{% import "macros.j2" as macros with context %}
+
+{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
+ {% set keystone_ssh_packages = ['openssh-server'] %}
+{% elif base_distro in ['ubuntu', 'debian'] %}
+ {% set keystone_ssh_packages = ['openssh-server'] %}
+
+RUN mkdir -p /var/run/sshd \
+ && chmod 0755 /var/run/sshd
+
+{% endif %}
+{{ macros.install_packages(keystone_ssh_packages | customizable("packages")) }}
+
+COPY extend_start.sh /usr/local/bin/kolla_extend_start
+RUN chmod 755 /usr/local/bin/kolla_extend_start
+
+{% block keystone_ssh_footer %}{% endblock %}
+{% block footer %}{% endblock %}
+{{ include_footer }}
diff --git a/docker/keystone/keystone-ssh/extend_start.sh b/docker/keystone/keystone-ssh/extend_start.sh
new file mode 100644
index 000000000..23744cead
--- /dev/null
+++ b/docker/keystone/keystone-ssh/extend_start.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+if [[ ! -L /dev/log ]]; then
+ ln -sf /var/lib/kolla/heka/log /dev/log
+fi
+
+SSH_HOST_KEY_TYPES=( "rsa" "dsa" "ecdsa" "ed25519" )
+
+for key_type in ${SSH_HOST_KEY_TYPES[@]}; do
+ KEY_PATH=/etc/ssh/ssh_host_${key_type}_key
+ if [[ ! -f "${KEY_PATH}" ]]; then
+ ssh-keygen -q -t ${key_type} -f ${KEY_PATH} -N ""
+ fi
+done
+
+mkdir -p /var/lib/keystone/.ssh
+
+if [[ $(stat -c %U:%G /var/lib/keystone/.ssh) != "keystone:keystone" ]]; then
+ sudo chown keystone: /var/lib/keystone/.ssh
+fi