Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable SSL in Docker Image #2867

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 20 additions & 0 deletions Dockerfile
Expand Up @@ -19,6 +19,23 @@ RUN apt-get update && \
ARG WIN_BUILD=false
RUN if [ "$WIN_BUILD" = "true" ] ; then apt-get -y install mingw-w64; fi

# Install Haproxy, needed for SSL plugin
RUN apt-get install haproxy -y

# Arguments used to generate the self signed certificate
ARG COUNTRY=US
ARG ST=""
ARG L=""
ARG O=""
ARG OU=""
ARG CN=""

# Generate self signed certificate
RUN openssl req -x509 -newkey rsa:4096 -out plugins/ssl/conf/certificate.pem -keyout plugins/ssl/conf/certificate.pem -subj "/C=$COUNTRY/ST=$ST/L=$L/O=$O/OU=$OU/CN=$CN" -nodes

RUN cp plugins/ssl/templates/haproxy.conf plugins/ssl/conf/
RUN sed -i 's/insecure_certificate.pem/certificate.pem/' plugins/ssl/conf/haproxy.conf

# Set up python virtualenv
ENV VIRTUAL_ENV=/opt/venv/caldera
RUN python3 -m venv $VIRTUAL_ENV
Expand All @@ -31,6 +48,9 @@ RUN pip3 install --no-cache-dir -r requirements.txt
RUN python3 -c "import app; import app.utility.config_generator; app.utility.config_generator.ensure_local_config();"; \
sed -i '/\- atomic/d' conf/local.yml;

# Enable ssl plugin
RUN sed -i '/^\-\ manx/a \-\ ssl' conf/local.yml

# Compile default sandcat agent binaries, which will download basic golang dependencies.

# Install Go dependencies
Expand Down