diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..83b75ba --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +# https://docs.docker.com/reference/builder/#the-dockerignore-file +.git +*/.git +README.md +LICENSE diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..4fe60bd --- /dev/null +++ b/Dockerfile @@ -0,0 +1,33 @@ +FROM centos:centos6 + +# Ensure pre-installed packages are up-to-date. +RUN yum -y update; yum clean all +ONBUILD RUN yum -y update; yum clean all + +# Install dependencies. +RUN yum -y install epel-release; yum clean all + +# https://www.duosecurity.com/docs/authproxy_reference#installation +RUN yum -y install \ + gcc make openssl-devel python-devel \ + tar \ + which \ + patch \ + ; yum clean all + +ADD install.patch /root/ +ADD https://dl.duosecurity.com/duoauthproxy-latest-src.tgz /root/ +RUN useradd duo + +# Build and install authproxy. +RUN cd /root; \ + tar xzf duoauthproxy-latest-src.tgz; \ + cd duoauthproxy*; \ + export PYTHON=$(which python); \ + make; \ + cd duoauthproxy-build; \ + patch -p0 < /root/install.patch; \ + ./install + +# `docker run' starts bash by default. +CMD ["/bin/bash"] diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..99c8a8d --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Paul Morgan + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..6867fc1 --- /dev/null +++ b/README.md @@ -0,0 +1,76 @@ +Duo Authproxy on Centos6 +======================== + +Overview +-------- + +[Duo Authentication Proxy](https://www.duosecurity.com/docs/authproxy_reference) +provides a local proxy service to enable on-premise integrations +between VPNs, devices, applications, and +[Duo two-factor authentication](https://www.duosecurity.com/docs). + +This repo provides a way to build Duo Authentication Proxy into +a docker image and run it as a container. + + +Status +------ + +:warning: This is not ready for deployment. + + +References +---------------- + +* [Duo Authentication Proxy](https://www.duosecurity.com/docs/authproxy_reference) +* [Duo two-factor authentication](https://www.duosecurity.com/docs) + + +How-to +------ + +Build this image locally on a host with Docker: + + git clone https://github.com/jumanjihouse/docker-duoauthproxy.git + cd docker-duoauthproxy + docker build --rm -t duoauthproxy . + +Run a container with bash from the built image: + + docker run --rm -it duoauthproxy bash + + +Licenses +-------- + +All files in this repo are subject to LICENSE (also in this repo). + +Your usage of the built docker image is subject to the terms at +/root/duoauthproxy-*-src/duoauthproxy-build/doc/eula-linux.txt +within the built image. + +View the Duo end-user license agreement: + + eula='/root/duoauthproxy-*-src/duoauthproxy-build/doc/eula-linux.txt' + docker run --rm -it duoauthproxy bash -c "cat $eula" + +Get a list of licenses for third-party components within the image: + + dir='duoauthproxy-*-src + docker run --rm -it duoauthproxy bash -c "find $dir -iregex '.*license.*'" + +At the time this document is created, the above commands shows: + + duoauthproxy-2.4.8-src/pkgs/Twisted-14.0.2/LICENSE + duoauthproxy-2.4.8-src/pkgs/netaddr-0.7.10/docs/source/license.rst + duoauthproxy-2.4.8-src/pkgs/netaddr-0.7.10/LICENSE + duoauthproxy-2.4.8-src/pkgs/pyOpenSSL-0.13.1/LICENSE + duoauthproxy-2.4.8-src/pkgs/six-1.3.0/LICENSE + duoauthproxy-2.4.8-src/pkgs/zope.interface-4.0.5/LICENSE.txt + duoauthproxy-2.4.8-src/pkgs/dpkt-1.7/LICENSE + duoauthproxy-2.4.8-src/pkgs/pycrypto-2.6/LEGAL/copy/LICENSE.libtom + duoauthproxy-2.4.8-src/pkgs/pycrypto-2.6/LEGAL/copy/LICENSE.orig + duoauthproxy-2.4.8-src/pkgs/pycrypto-2.6/LEGAL/copy/LICENSE.python-2.2 + duoauthproxy-2.4.8-src/pkgs/virtualenv-1.9.1/LICENSE.txt + duoauthproxy-2.4.8-src/pkgs/pyparsing-1.5.7/LICENSE + duoauthproxy-2.4.8-src/pkgs/pyrad-2.0/LICENSE.txt diff --git a/install.patch b/install.patch new file mode 100644 index 0000000..efa41b4 --- /dev/null +++ b/install.patch @@ -0,0 +1,23 @@ +--- install.orig 2014-12-23 19:08:11.295300746 +0000 ++++ install 2014-12-23 19:09:14.960571585 +0000 +@@ -358,9 +358,9 @@ + + class AuthproxyInstaller(object): + INSTALL_DIR_DEFAULT = os.path.join('/opt', PRODUCT_NAME) +- USER_DEFAULT = 'nobody' ++ USER_DEFAULT = 'duo' + +- def __init__(self, install_dir=None, service_user=None, do_initscript=None): ++ def __init__(self, install_dir=INSTALL_DIR_DEFAULT, service_user=USER_DEFAULT, do_initscript='yes'): + self.install_dir = install_dir + self.service_user = service_user + self.service_uid = None +@@ -374,7 +374,7 @@ + + def install(self): + # user interaction +- self.show_license() ++ # self.show_license() + self.get_install_dir() + self.get_user() +