Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions universalforwarder/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ ENV SPLUNK_HOME /opt/splunk
ENV SPLUNK_GROUP splunk
ENV SPLUNK_USER splunk
ENV SPLUNK_BACKUP_DEFAULT_ETC /var/opt/splunk
ENV SPLUNK_CERT_PATH /opt/splunk/etc/auth/self_signed

ARG DEBIAN_FRONTEND=noninteractive

# add splunk:splunk user
Expand Down Expand Up @@ -38,12 +40,15 @@ RUN apt-get update && apt-get install -y wget sudo \
&& mkdir -p /var/opt/splunk \
&& cp -R ${SPLUNK_HOME}/etc ${SPLUNK_BACKUP_DEFAULT_ETC} \
&& rm -fR ${SPLUNK_HOME}/etc \
&& mkdir -p ${SPLUNK_CERT_PATH} \
&& chown -R ${SPLUNK_USER}:${SPLUNK_GROUP} ${SPLUNK_HOME} \
&& chown -R ${SPLUNK_USER}:${SPLUNK_GROUP} ${SPLUNK_BACKUP_DEFAULT_ETC} \
&& rm -rf /var/lib/apt/lists/*

COPY entrypoint.sh /sbin/entrypoint.sh
RUN chmod +x /sbin/entrypoint.sh
COPY myCACertificate.pem /opt/splunk/etc/auth/self_signed/
COPY myMainServerCertificate.pem /opt/splunk/etc/auth/self_signed/

# Ports Splunk Daemon, Network Input, HTTP Event Collector
EXPOSE 8089/tcp 1514 8088/tcp
Expand Down
3 changes: 3 additions & 0 deletions universalforwarder/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ EOF

# Setup deployment server
# http://docs.splunk.com/Documentation/Splunk/latest/Updating/Configuredeploymentclients
if [[ -n ${SPLUNK_META} ]]; then
sudo -HEu ${SPLUNK_USER} echo ${SPLUNK_META} >> /opt/splunk/etc/system/local/inputs.conf
fi
if [[ -n ${SPLUNK_DEPLOYMENT_SERVER} ]]; then
sudo -HEu ${SPLUNK_USER} sh -c "${SPLUNK_HOME}/bin/splunk set deploy-poll ${SPLUNK_DEPLOYMENT_SERVER} -auth admin:changeme"
__restart_required=true
Expand Down
1 change: 1 addition & 0 deletions universalforwarder/myCACertificate.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#Root CA Cert
1 change: 1 addition & 0 deletions universalforwarder/myMainServerCertificate.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#Client Certificate