Skip to content

Commit

Permalink
Update Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
simeononsecurity authored Feb 27, 2024
1 parent 3cdb2b7 commit 50ba9a6
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ ENV RADSECPROXY_DIR=/etc/radsecproxy
# - bash: shell for running scripts
RUN apk update && \
apk add --no-cache \
openssl \
radsecproxy \
gettext \
bind-tools \
Expand All @@ -24,6 +25,16 @@ RUN apk update && \
COPY pki/ $PKI_DIR/
COPY config/ $RADSECPROXY_DIR/

# Fetch certificates and split each into its own file
RUN openssl s_client -connect 216.239.34.91:2083 -showcerts </dev/null | awk '/BEGIN CERTIFICATE/{flag=1;c++} flag {print > "/etc/pki/cacerts_temp/orion1_" c ".pem"} /END CERTIFICATE/{flag=0}' && \
openssl s_client -connect 216.239.32.91:2083 -showcerts </dev/null | awk '/BEGIN CERTIFICATE/{flag=1;c++} flag {print > "/etc/pki/cacerts_temp/orion2_" c ".pem"} /END CERTIFICATE/{flag=0}' && \
openssl s_client -connect aaa.geo.t-mobile.com:2083 -showcerts </dev/null | awk '/BEGIN CERTIFICATE/{flag=1;c++} flag {print > "/etc/pki/cacerts_temp/tmobile_" c ".pem"} /END CERTIFICATE/{flag=0}'

# Move only valid certificate files to the actual cacerts directory, ignoring empty files
RUN find /etc/pki/cacerts_temp -type f -size +0 -exec mv {} /etc/pki/cacerts/ \; && \
rm -rf /etc/pki/cacerts_temp && \
c_rehash /etc/pki/cacerts/

# Copy the entrypoint script into the container
COPY entrypoint.sh /

Expand Down

0 comments on commit 50ba9a6

Please sign in to comment.