Skip to content

Commit 947a9b6

Browse files
nwang92alishamayorjrigassio-splunk
authored
Feature/scloud (#388)
* install scloud with splunk * update copyright year * fix /usr/local/bin path error * -c flag tar * Changing scloud location * include toml pypi module * Adding jmespath * Adding scloud to base images to interact with SCS * Adding jmespath to all base images * Adding URL to Makefile; adding a few tests Co-authored-by: Alisha Mayor <alishamayor@gmail.com> Co-authored-by: James Rigassio <jrigassio@splunk.com> Co-authored-by: James Rigassio <51932491+jrigassio-splunk@users.noreply.github.com>
1 parent 4165874 commit 947a9b6

File tree

11 files changed

+60
-22
lines changed

11 files changed

+60
-22
lines changed

Makefile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ SPLUNK_WIN_FILENAME ?= splunk-${SPLUNK_VERSION}-${SPLUNK_BUILD}-x64-release.msi
2525
SPLUNK_WIN_BUILD_URL ?= https://download.splunk.com/products/${SPLUNK_PRODUCT}/releases/${SPLUNK_VERSION}/windows/${SPLUNK_WIN_FILENAME}
2626
UF_WIN_FILENAME ?= splunkforwarder-${SPLUNK_VERSION}-${SPLUNK_BUILD}-x64-release.msi
2727
UF_WIN_BUILD_URL ?= https://download.splunk.com/products/universalforwarder/releases/${SPLUNK_VERSION}/windows/${UF_WIN_FILENAME}
28+
# Splunk Cloud SDK binary
29+
SCLOUD_URL ?= https://github.com/splunk/splunk-cloud-sdk-go/releases/download/v1.7.0/scloud_v4.0.0_linux_amd64.tar.gz
2830

2931
# Security Scanner Variables
3032
SCANNER_DATE := `date +%Y-%m-%d`
@@ -59,16 +61,16 @@ ansible:
5961
base: base-debian-9 base-debian-10 base-centos-7 base-redhat-8 base-windows-2016
6062

6163
base-debian-10:
62-
docker build ${DOCKER_BUILD_FLAGS} -t base-debian-10:${IMAGE_VERSION} ./base/debian-10
64+
docker build ${DOCKER_BUILD_FLAGS} --build-arg SCLOUD_URL=${SCLOUD_URL} -t base-debian-10:${IMAGE_VERSION} ./base/debian-10
6365

6466
base-debian-9:
65-
docker build ${DOCKER_BUILD_FLAGS} -t base-debian-9:${IMAGE_VERSION} ./base/debian-9
67+
docker build ${DOCKER_BUILD_FLAGS} --build-arg SCLOUD_URL=${SCLOUD_URL} -t base-debian-9:${IMAGE_VERSION} ./base/debian-9
6668

6769
base-centos-7:
68-
docker build ${DOCKER_BUILD_FLAGS} -t base-centos-7:${IMAGE_VERSION} ./base/centos-7
70+
docker build ${DOCKER_BUILD_FLAGS} --build-arg SCLOUD_URL=${SCLOUD_URL} -t base-centos-7:${IMAGE_VERSION} ./base/centos-7
6971

7072
base-redhat-8:
71-
docker build ${DOCKER_BUILD_FLAGS} --label version=${SPLUNK_VERSION} -t base-redhat-8:${IMAGE_VERSION} ./base/redhat-8
73+
docker build ${DOCKER_BUILD_FLAGS} --build-arg SCLOUD_URL=${SCLOUD_URL} --label version=${SPLUNK_VERSION} -t base-redhat-8:${IMAGE_VERSION} ./base/redhat-8
7274

7375
base-windows-2016:
7476
docker build ${DOCKER_BUILD_FLAGS} -t base-windows-2016:${IMAGE_VERSION} ./base/windows-2016

base/centos-7/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,8 @@
1515
FROM centos:7
1616
LABEL maintainer="support@splunk.com"
1717

18+
ARG SCLOUD_URL
19+
ENV SCLOUD_URL ${SCLOUD_URL}
20+
1821
COPY install.sh /install.sh
1922
RUN /install.sh && rm -rf /install.sh

base/centos-7/install.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,12 @@ localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
1919
export LANG=en_US.utf8
2020

2121
yum -y update && yum -y install wget sudo epel-release
22-
yum -y install busybox ansible python-requests
22+
yum -y install busybox ansible python-requests python-jmespath
23+
24+
# Install scloud
25+
wget -O /usr/bin/scloud.tar.gz ${SCLOUD_URL}
26+
tar -xf /usr/bin/scloud.tar.gz -C /usr/bin/
27+
rm /usr/bin/scloud.tar.gz
2328

2429
cd /bin
2530
ln -s busybox killall

base/debian-10/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
FROM debian:buster-slim
1616
LABEL maintainer="support@splunk.com"
1717

18+
ARG SCLOUD_URL
19+
ENV SCLOUD_URL ${SCLOUD_URL}
20+
1821
ENV DEBIAN_FRONTEND=noninteractive
1922

2023
COPY install.sh /install.sh

base/debian-10/install.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,15 @@ apt update
3333
# put back tools for customer support
3434
apt-get install -y --no-install-recommends curl sudo libgssapi-krb5-2 busybox procps acl gcc libpython-dev libffi-dev libssl-dev
3535
apt-get install -y --no-install-recommends python-pip python-setuptools python-requests python-yaml
36-
pip --no-cache-dir install ansible
36+
pip --no-cache-dir install ansible jmespath
3737
apt-get remove -y gcc libffi-dev libssl-dev libpython-dev
3838
apt-get autoremove -y
3939

40+
# Install scloud
41+
wget -O /usr/bin/scloud.tar.gz ${SCLOUD_URL}
42+
tar -xf /usr/bin/scloud.tar.gz -C /usr/bin/
43+
rm /usr/bin/scloud.tar.gz
44+
4045
cd /bin
4146
ln -s busybox killall
4247
ln -s busybox netstat

base/debian-9/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
FROM debian:stretch-slim
1616
LABEL maintainer="support@splunk.com"
1717

18+
ARG SCLOUD_URL
19+
ENV SCLOUD_URL ${SCLOUD_URL}
20+
1821
ENV DEBIAN_FRONTEND=noninteractive
1922

2023
COPY install.sh /install.sh

base/debian-9/install.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,12 @@ apt-get update
3535
# put back tools for customer support
3636
apt-cache show ansible
3737
apt-get install -y --no-install-recommends ansible curl sudo libgssapi-krb5-2 busybox procps acl
38-
apt-get install -y --no-install-recommends python-requests
38+
apt-get install -y --no-install-recommends python-requests python-jmespath
39+
40+
# Install scloud
41+
wget -O /usr/bin/scloud.tar.gz ${SCLOUD_URL}
42+
tar -xf /usr/bin/scloud.tar.gz -C /usr/bin/
43+
rm /usr/bin/scloud.tar.gz
3944

4045
cd /bin
4146
ln -s busybox diff

base/redhat-8/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ LABEL name="splunk" \
2424
summary="UBI 8 Docker image of Splunk Enterprise" \
2525
description="Splunk Enterprise is a platform for operational intelligence. Our software lets you collect, analyze, and act upon the untapped value of big data that your technology infrastructure, security systems, and business applications generate. It gives you insights to drive operational performance and business results."
2626

27+
ARG SCLOUD_URL
28+
ENV SCLOUD_URL ${SCLOUD_URL}
29+
2730
COPY install.sh /install.sh
2831

2932
RUN mkdir /licenses \

base/redhat-8/install.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ wget -O /bin/busybox https://busybox.net/downloads/binaries/1.28.1-defconfig-mul
3434
chmod +x /bin/busybox
3535
microdnf -y --nodocs update gnutls kernel-headers
3636
microdnf -y --nodocs install python2-pip python2-devel redhat-rpm-config gcc libffi-devel openssl-devel
37-
pip2 --no-cache-dir install requests ansible
37+
pip2 --no-cache-dir install requests ansible jmespath
3838
microdnf -y remove gcc openssl-devel redhat-rpm-config python2-devel device-mapper-libs device-mapper trousers systemd systemd-pam \
3939
dwz dbus dbus-common dbus-daemon dbus-tools dbus-libs go-srpm-macros iptables-libs annobin cryptsetup-libs \
4040
ocaml-srpm-macros openblas-srpm-macros qt5-srpm-macros perl-srpm-macros rust-srpm-macros ghc-srpm-macros \
@@ -44,6 +44,11 @@ microdnf -y remove gcc openssl-devel redhat-rpm-config python2-devel device-mapp
4444
libfdisk libpcap libseccomp libselinux-devel libutempter binutils libxcrypt-devel cpp glibc-devel glibc-headers \
4545
krb5-devel libkadm5 platform-python-pip
4646

47+
# Install scloud
48+
wget -O /usr/bin/scloud.tar.gz ${SCLOUD_URL}
49+
tar -xf /usr/bin/scloud.tar.gz -C /usr/bin/
50+
rm /usr/bin/scloud.tar.gz
51+
4752
cd /bin
4853
ln -s python2 python || true
4954
ln -s busybox diff || true

splunk/common-files/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2018 Splunk
1+
# Copyright 2018-2020 Splunk
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)