From f59f0150555dc3cf2fa4f16cc9759de270a3ddf4 Mon Sep 17 00:00:00 2001 From: William Robinet Date: Tue, 23 Mar 2021 14:10:30 +0100 Subject: [PATCH] Docker files initial import --- docker/debian-bullseye/Dockerfile | 27 +++++++++++++++++ docker/debian-bullseye/docker_build.sh | 6 ++++ docker/debian-bullseye/docker_run.sh | 15 ++++++++++ docker/debian-buster/Dockerfile | 27 +++++++++++++++++ docker/debian-buster/docker_build.sh | 6 ++++ docker/debian-buster/docker_run.sh | 15 ++++++++++ docker/debian-stretch/Dockerfile | 27 +++++++++++++++++ docker/debian-stretch/docker_build.sh | 6 ++++ docker/debian-stretch/docker_run.sh | 15 ++++++++++ docker/ubuntu-bionic/Dockerfile | 27 +++++++++++++++++ docker/ubuntu-bionic/docker_build.sh | 6 ++++ docker/ubuntu-bionic/docker_run.sh | 15 ++++++++++ docker/ubuntu-focal/Dockerfile | 27 +++++++++++++++++ docker/ubuntu-focal/docker_build.sh | 6 ++++ docker/ubuntu-focal/docker_run.sh | 15 ++++++++++ docker/ubuntu-groovy/Dockerfile | 27 +++++++++++++++++ docker/ubuntu-groovy/docker_build.sh | 6 ++++ docker/ubuntu-groovy/docker_run.sh | 15 ++++++++++ docker/ubuntu-xenial/Dockerfile | 41 ++++++++++++++++++++++++++ docker/ubuntu-xenial/docker_build.sh | 6 ++++ docker/ubuntu-xenial/docker_run.sh | 15 ++++++++++ 21 files changed, 350 insertions(+) create mode 100644 docker/debian-bullseye/Dockerfile create mode 100755 docker/debian-bullseye/docker_build.sh create mode 100755 docker/debian-bullseye/docker_run.sh create mode 100644 docker/debian-buster/Dockerfile create mode 100755 docker/debian-buster/docker_build.sh create mode 100755 docker/debian-buster/docker_run.sh create mode 100644 docker/debian-stretch/Dockerfile create mode 100755 docker/debian-stretch/docker_build.sh create mode 100755 docker/debian-stretch/docker_run.sh create mode 100644 docker/ubuntu-bionic/Dockerfile create mode 100755 docker/ubuntu-bionic/docker_build.sh create mode 100755 docker/ubuntu-bionic/docker_run.sh create mode 100644 docker/ubuntu-focal/Dockerfile create mode 100755 docker/ubuntu-focal/docker_build.sh create mode 100755 docker/ubuntu-focal/docker_run.sh create mode 100644 docker/ubuntu-groovy/Dockerfile create mode 100755 docker/ubuntu-groovy/docker_build.sh create mode 100755 docker/ubuntu-groovy/docker_run.sh create mode 100644 docker/ubuntu-xenial/Dockerfile create mode 100755 docker/ubuntu-xenial/docker_build.sh create mode 100755 docker/ubuntu-xenial/docker_run.sh diff --git a/docker/debian-bullseye/Dockerfile b/docker/debian-bullseye/Dockerfile new file mode 100644 index 0000000..e179c2e --- /dev/null +++ b/docker/debian-bullseye/Dockerfile @@ -0,0 +1,27 @@ +FROM debian:bullseye-slim + +ENV LANG C +ENV DEBIAN_FRONTEND noninteractive + +RUN apt-get update && \ + apt-get dist-upgrade -y && \ + apt-get install -y --no-install-recommends ca-certificates sudo git build-essential automake autoconf clang libssl-dev libpcap-dev libnet1-dev libjson-c-dev iproute2 && \ + apt-get clean + +RUN useradd -ms /bin/bash ssldump +RUN passwd -d ssldump +RUN printf 'ssldump ALL=(ALL) ALL\n' | tee -a /etc/sudoers + +RUN cd /home/ssldump && \ + git clone https://github.com/adulau/ssldump.git build + +RUN cd /home/ssldump/build && \ + ./autogen.sh && \ + ./configure CC=/usr/bin/clang && \ + make && \ + sudo make install + +USER ssldump +WORKDIR "/home/ssldump" + +CMD ["/bin/bash"] diff --git a/docker/debian-bullseye/docker_build.sh b/docker/debian-bullseye/docker_build.sh new file mode 100755 index 0000000..382566c --- /dev/null +++ b/docker/debian-bullseye/docker_build.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +ssldump_version=1.4b +distribution=debian-bullseye + +docker build -t "ssldump-${distribution}:${ssldump_version}" . diff --git a/docker/debian-bullseye/docker_run.sh b/docker/debian-bullseye/docker_run.sh new file mode 100755 index 0000000..d415fe2 --- /dev/null +++ b/docker/debian-bullseye/docker_run.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +local_if=ens3f0 +container_ip=172.17.0.2 +ssldump_version=1.4b +distribution=debian-bullseye + +sudo iptables -t mangle -I PREROUTING 1 -i ${local_if} -j TEE --gateway ${container_ip} +sudo iptables -t mangle -I POSTROUTING 1 -o ${local_if} -j TEE --gateway ${container_ip} + +docker run -it ssldump-${distribution}:${ssldump_version} + +sudo iptables -t mangle -D PREROUTING 1 +sudo iptables -t mangle -D POSTROUTING 1 + diff --git a/docker/debian-buster/Dockerfile b/docker/debian-buster/Dockerfile new file mode 100644 index 0000000..4de60d0 --- /dev/null +++ b/docker/debian-buster/Dockerfile @@ -0,0 +1,27 @@ +FROM debian:buster-slim + +ENV LANG C +ENV DEBIAN_FRONTEND noninteractive + +RUN apt-get update && \ + apt-get dist-upgrade -y && \ + apt-get install -y --no-install-recommends ca-certificates sudo git build-essential automake autoconf clang libssl-dev libpcap-dev libnet1-dev libjson-c-dev iproute2 && \ + apt-get clean + +RUN useradd -ms /bin/bash ssldump +RUN passwd -d ssldump +RUN printf 'ssldump ALL=(ALL) ALL\n' | tee -a /etc/sudoers + +RUN cd /home/ssldump && \ + git clone https://github.com/adulau/ssldump.git build + +RUN cd /home/ssldump/build && \ + ./autogen.sh && \ + ./configure CC=/usr/bin/clang && \ + make && \ + sudo make install + +USER ssldump +WORKDIR "/home/ssldump" + +CMD ["/bin/bash"] diff --git a/docker/debian-buster/docker_build.sh b/docker/debian-buster/docker_build.sh new file mode 100755 index 0000000..9cd8f9c --- /dev/null +++ b/docker/debian-buster/docker_build.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +ssldump_version=1.4b +distribution=debian-buster + +docker build -t "ssldump-${distribution}:${ssldump_version}" . diff --git a/docker/debian-buster/docker_run.sh b/docker/debian-buster/docker_run.sh new file mode 100755 index 0000000..f8b0106 --- /dev/null +++ b/docker/debian-buster/docker_run.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +local_if=ens3f0 +container_ip=172.17.0.2 +ssldump_version=1.4b +distribution=debian-buster + +sudo iptables -t mangle -I PREROUTING 1 -i ${local_if} -j TEE --gateway ${container_ip} +sudo iptables -t mangle -I POSTROUTING 1 -o ${local_if} -j TEE --gateway ${container_ip} + +docker run -it ssldump-${distribution}:${ssldump_version} + +sudo iptables -t mangle -D PREROUTING 1 +sudo iptables -t mangle -D POSTROUTING 1 + diff --git a/docker/debian-stretch/Dockerfile b/docker/debian-stretch/Dockerfile new file mode 100644 index 0000000..8fd5775 --- /dev/null +++ b/docker/debian-stretch/Dockerfile @@ -0,0 +1,27 @@ +FROM debian:stretch-slim + +ENV LANG C +ENV DEBIAN_FRONTEND noninteractive + +RUN apt-get update && \ + apt-get dist-upgrade -y && \ + apt-get install -y --no-install-recommends ca-certificates sudo git build-essential automake autoconf clang libssl-dev libpcap-dev libnet1-dev libjson-c-dev iproute2 && \ + apt-get clean + +RUN useradd -ms /bin/bash ssldump +RUN passwd -d ssldump +RUN printf 'ssldump ALL=(ALL) ALL\n' | tee -a /etc/sudoers + +RUN cd /home/ssldump && \ + git clone https://github.com/adulau/ssldump.git build + +RUN cd /home/ssldump/build && \ + ./autogen.sh && \ + ./configure CC=/usr/bin/clang && \ + make && \ + sudo make install + +USER ssldump +WORKDIR "/home/ssldump" + +CMD ["/bin/bash"] diff --git a/docker/debian-stretch/docker_build.sh b/docker/debian-stretch/docker_build.sh new file mode 100755 index 0000000..824a84f --- /dev/null +++ b/docker/debian-stretch/docker_build.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +ssldump_version=1.4b +distribution=debian-stretch + +docker build -t "ssldump-${distribution}:${ssldump_version}" . diff --git a/docker/debian-stretch/docker_run.sh b/docker/debian-stretch/docker_run.sh new file mode 100755 index 0000000..a2650c0 --- /dev/null +++ b/docker/debian-stretch/docker_run.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +local_if=ens3f0 +container_ip=172.17.0.2 +ssldump_version=1.4b +distribution=debian-stretch + +sudo iptables -t mangle -I PREROUTING 1 -i ${local_if} -j TEE --gateway ${container_ip} +sudo iptables -t mangle -I POSTROUTING 1 -o ${local_if} -j TEE --gateway ${container_ip} + +docker run -it ssldump-${distribution}:${ssldump_version} + +sudo iptables -t mangle -D PREROUTING 1 +sudo iptables -t mangle -D POSTROUTING 1 + diff --git a/docker/ubuntu-bionic/Dockerfile b/docker/ubuntu-bionic/Dockerfile new file mode 100644 index 0000000..9408a02 --- /dev/null +++ b/docker/ubuntu-bionic/Dockerfile @@ -0,0 +1,27 @@ +FROM ubuntu:bionic + +ENV LANG C +ENV DEBIAN_FRONTEND noninteractive + +RUN apt-get update && \ + apt-get dist-upgrade -y && \ + apt-get install -y --no-install-recommends ca-certificates sudo git build-essential automake autoconf clang libssl-dev libpcap-dev libnet1-dev libjson-c-dev iproute2 && \ + apt-get clean + +RUN useradd -ms /bin/bash ssldump +RUN passwd -d ssldump +RUN printf 'ssldump ALL=(ALL) ALL\n' | tee -a /etc/sudoers + +RUN cd /home/ssldump && \ + git clone https://github.com/adulau/ssldump.git build + +RUN cd /home/ssldump/build && \ + ./autogen.sh && \ + ./configure CC=/usr/bin/clang && \ + make && \ + sudo make install + +USER ssldump +WORKDIR "/home/ssldump" + +CMD ["/bin/bash"] diff --git a/docker/ubuntu-bionic/docker_build.sh b/docker/ubuntu-bionic/docker_build.sh new file mode 100755 index 0000000..c9f169b --- /dev/null +++ b/docker/ubuntu-bionic/docker_build.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +ssldump_version=1.4b +distribution=ubuntu-bionic + +docker build -t "ssldump-${distribution}:${ssldump_version}" . diff --git a/docker/ubuntu-bionic/docker_run.sh b/docker/ubuntu-bionic/docker_run.sh new file mode 100755 index 0000000..c2ec286 --- /dev/null +++ b/docker/ubuntu-bionic/docker_run.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +local_if=ens3f0 +container_ip=172.17.0.2 +ssldump_version=1.4b +distribution=ubuntu-bionic + +sudo iptables -t mangle -I PREROUTING 1 -i ${local_if} -j TEE --gateway ${container_ip} +sudo iptables -t mangle -I POSTROUTING 1 -o ${local_if} -j TEE --gateway ${container_ip} + +docker run -it ssldump-${distribution}:${ssldump_version} + +sudo iptables -t mangle -D PREROUTING 1 +sudo iptables -t mangle -D POSTROUTING 1 + diff --git a/docker/ubuntu-focal/Dockerfile b/docker/ubuntu-focal/Dockerfile new file mode 100644 index 0000000..c4e02ab --- /dev/null +++ b/docker/ubuntu-focal/Dockerfile @@ -0,0 +1,27 @@ +FROM ubuntu:focal + +ENV LANG C +ENV DEBIAN_FRONTEND noninteractive + +RUN apt-get update && \ + apt-get dist-upgrade -y && \ + apt-get install -y --no-install-recommends ca-certificates sudo git build-essential automake autoconf clang libssl-dev libpcap-dev libnet1-dev libjson-c-dev iproute2 && \ + apt-get clean + +RUN useradd -ms /bin/bash ssldump +RUN passwd -d ssldump +RUN printf 'ssldump ALL=(ALL) ALL\n' | tee -a /etc/sudoers + +RUN cd /home/ssldump && \ + git clone https://github.com/adulau/ssldump.git build + +RUN cd /home/ssldump/build && \ + ./autogen.sh && \ + ./configure CC=/usr/bin/clang && \ + make && \ + sudo make install + +USER ssldump +WORKDIR "/home/ssldump" + +CMD ["/bin/bash"] diff --git a/docker/ubuntu-focal/docker_build.sh b/docker/ubuntu-focal/docker_build.sh new file mode 100755 index 0000000..89e99d2 --- /dev/null +++ b/docker/ubuntu-focal/docker_build.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +ssldump_version=1.4b +distribution=ubuntu-focal + +docker build -t "ssldump-${distribution}:${ssldump_version}" . diff --git a/docker/ubuntu-focal/docker_run.sh b/docker/ubuntu-focal/docker_run.sh new file mode 100755 index 0000000..bb385d8 --- /dev/null +++ b/docker/ubuntu-focal/docker_run.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +local_if=ens3f0 +container_ip=172.17.0.2 +ssldump_version=1.4b +distribution=ubuntu-focal + +sudo iptables -t mangle -I PREROUTING 1 -i ${local_if} -j TEE --gateway ${container_ip} +sudo iptables -t mangle -I POSTROUTING 1 -o ${local_if} -j TEE --gateway ${container_ip} + +docker run -it ssldump-${distribution}:${ssldump_version} + +sudo iptables -t mangle -D PREROUTING 1 +sudo iptables -t mangle -D POSTROUTING 1 + diff --git a/docker/ubuntu-groovy/Dockerfile b/docker/ubuntu-groovy/Dockerfile new file mode 100644 index 0000000..4d3abf8 --- /dev/null +++ b/docker/ubuntu-groovy/Dockerfile @@ -0,0 +1,27 @@ +FROM ubuntu:groovy + +ENV LANG C +ENV DEBIAN_FRONTEND noninteractive + +RUN apt-get update && \ + apt-get dist-upgrade -y && \ + apt-get install -y --no-install-recommends ca-certificates sudo git build-essential automake autoconf clang libssl-dev libpcap-dev libnet1-dev libjson-c-dev iproute2 && \ + apt-get clean + +RUN useradd -ms /bin/bash ssldump +RUN passwd -d ssldump +RUN printf 'ssldump ALL=(ALL) ALL\n' | tee -a /etc/sudoers + +RUN cd /home/ssldump && \ + git clone https://github.com/adulau/ssldump.git build + +RUN cd /home/ssldump/build && \ + ./autogen.sh && \ + ./configure CC=/usr/bin/clang && \ + make && \ + sudo make install + +USER ssldump +WORKDIR "/home/ssldump" + +CMD ["/bin/bash"] diff --git a/docker/ubuntu-groovy/docker_build.sh b/docker/ubuntu-groovy/docker_build.sh new file mode 100755 index 0000000..c700c85 --- /dev/null +++ b/docker/ubuntu-groovy/docker_build.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +ssldump_version=1.4b +distribution=ubuntu-groovy + +docker build -t "ssldump-${distribution}:${ssldump_version}" . diff --git a/docker/ubuntu-groovy/docker_run.sh b/docker/ubuntu-groovy/docker_run.sh new file mode 100755 index 0000000..7c1d459 --- /dev/null +++ b/docker/ubuntu-groovy/docker_run.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +local_if=ens3f0 +container_ip=172.17.0.2 +ssldump_version=1.4b +distribution=ubuntu-groovy + +sudo iptables -t mangle -I PREROUTING 1 -i ${local_if} -j TEE --gateway ${container_ip} +sudo iptables -t mangle -I POSTROUTING 1 -o ${local_if} -j TEE --gateway ${container_ip} + +docker run -it ssldump-${distribution}:${ssldump_version} + +sudo iptables -t mangle -D PREROUTING 1 +sudo iptables -t mangle -D POSTROUTING 1 + diff --git a/docker/ubuntu-xenial/Dockerfile b/docker/ubuntu-xenial/Dockerfile new file mode 100644 index 0000000..493c874 --- /dev/null +++ b/docker/ubuntu-xenial/Dockerfile @@ -0,0 +1,41 @@ +FROM ubuntu:xenial + +ENV LANG C +ENV DEBIAN_FRONTEND noninteractive + +RUN apt-get update && \ + apt-get dist-upgrade -y && \ + apt-get install -y --no-install-recommends ca-certificates sudo git build-essential automake autoconf clang wget libpcap-dev libnet1-dev libjson-c-dev iproute2 && \ + apt-get clean + +RUN useradd -ms /bin/bash ssldump +RUN passwd -d ssldump +RUN printf 'Defaults:ssldump env_keep=LD_LIBRARY_PATH\n' | tee -a /etc/sudoers +RUN printf 'ssldump ALL=(ALL) ALL\n' | tee -a /etc/sudoers + +USER ssldump + +RUN mkdir /home/ssldump/openssl && \ + cd /home/ssldump/openssl && \ + wget https://www.openssl.org/source/openssl-1.1.1j.tar.gz && \ + tar xvfz openssl-1.1.1j.tar.gz && \ + cd openssl-1.1.1j && \ + ./config && \ + make -j 2 + +RUN cd /home/ssldump && \ + git clone https://github.com/adulau/ssldump.git build + +RUN cd /home/ssldump/build && \ + ./autogen.sh && \ + ./configure CFLAGS="-I../openssl/openssl-1.1.1j/include" LDFLAGS="-L../openssl/openssl-1.1.1j -lcrypto -lssl" && \ + make && \ + sudo make install + +ENV LD_LIBRARY_PATH /home/ssldump/openssl/openssl-1.1.1j +RUN printf '#!/bin/bash\nexport LD_LIBRARY_PATH=/home/ssldump/openssl/openssl-1.1.1j\nssldump $@\n' > /home/ssldump/run_ssldump.sh +RUN chmod +x /home/ssldump/run_ssldump.sh + +WORKDIR "/home/ssldump" + +CMD ["/bin/bash"] diff --git a/docker/ubuntu-xenial/docker_build.sh b/docker/ubuntu-xenial/docker_build.sh new file mode 100755 index 0000000..0aff63e --- /dev/null +++ b/docker/ubuntu-xenial/docker_build.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +ssldump_version=1.4b +distribution=ubuntu-xenial + +docker build -t "ssldump-${distribution}:${ssldump_version}" . diff --git a/docker/ubuntu-xenial/docker_run.sh b/docker/ubuntu-xenial/docker_run.sh new file mode 100755 index 0000000..582ad04 --- /dev/null +++ b/docker/ubuntu-xenial/docker_run.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +local_if=ens3f0 +container_ip=172.17.0.2 +ssldump_version=1.4b +distribution=ubuntu-xenial + +sudo iptables -t mangle -I PREROUTING 1 -i ${local_if} -j TEE --gateway ${container_ip} +sudo iptables -t mangle -I POSTROUTING 1 -o ${local_if} -j TEE --gateway ${container_ip} + +docker run -it ssldump-${distribution}:${ssldump_version} + +sudo iptables -t mangle -D PREROUTING 1 +sudo iptables -t mangle -D POSTROUTING 1 +