Skip to content

Commit 444102b

Browse files
authored
Merge pull request #244 from splunk/develop
Syncing develop with master
2 parents 6527292 + 6f498f8 commit 444102b

File tree

9 files changed

+350
-171
lines changed

9 files changed

+350
-171
lines changed

.circleci/config.yml

Lines changed: 102 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
version: 2
22
jobs:
3-
docker-splunk-test:
3+
security-scanning:
44
machine:
55
image: circleci/classic:latest
66
steps:
@@ -21,10 +21,6 @@ jobs:
2121
name: Build Container
2222
command: |
2323
make all
24-
- run:
25-
name: Export Build Images for Artifacts
26-
command: |
27-
make save_containers
2824
- run:
2925
name: Run Vulnerability Scanner
3026
command: |
@@ -33,29 +29,121 @@ jobs:
3329
name: Store Scanner Logs
3430
path: clair-scanner-logs
3531
destintation: clair-scanner-logs
32+
- store_artifacts:
33+
path: test-results
34+
destination: test-results
35+
debian10-testing:
36+
machine:
37+
image: circleci/classic:latest
38+
steps:
39+
- checkout
3640
- run:
37-
name: Test Python3 installation
38-
command: make test_python3_all
41+
name: Setup python3
42+
command: |
43+
pyenv global 2.7.12 3.5.2
44+
python --version
45+
pip --version
46+
python3 --version
47+
pip3 --version
3948
- run:
40-
name: Test Python2 as the default
41-
command: make test_python2_all
49+
name: Setup Tests / Scanner Requirements
50+
command: |
51+
make test_setup
52+
- run:
53+
name: Build Debian 10 Splunk
54+
command: |
55+
make splunk-debian-10
56+
- run:
57+
name: Build Debian 10 UF
58+
command: |
59+
make uf-debian-10
4260
- run:
4361
name: Test if image size increase
44-
command: make test_debian9_image_size
62+
command: make test_debian10_image_size
4563
- run:
46-
name: Running debian9 CI Tests
64+
name: Run Debian 10 image tests
4765
command: make run_tests_debian10
4866
no_output_timeout: 20m
4967
- store_artifacts:
5068
path: test-results
5169
destination: test-results
5270
- store_test_results:
5371
path: test-results
54-
72+
redhat8-testing:
73+
machine:
74+
image: circleci/classic:latest
75+
steps:
76+
- checkout
77+
- run:
78+
name: Setup python3
79+
command: |
80+
pyenv global 2.7.12 3.5.2
81+
python --version
82+
pip --version
83+
python3 --version
84+
pip3 --version
85+
- run:
86+
name: Setup Tests / Scanner Requirements
87+
command: |
88+
make test_setup
89+
- run:
90+
name: Build Redhat 8 Splunk
91+
command: |
92+
make splunk-redhat-8
93+
- run:
94+
name: Build Redhat 8 UF
95+
command: |
96+
make uf-redhat-8
97+
- run:
98+
name: Run Redhat 8 image tests
99+
command: make run_tests_redhat8
100+
no_output_timeout: 20m
101+
- store_artifacts:
102+
path: test-results
103+
destination: test-results
104+
- store_test_results:
105+
path: test-results
106+
container-validation:
107+
machine:
108+
image: circleci/classic:latest
109+
steps:
110+
- checkout
111+
- run:
112+
name: Setup python3
113+
command: |
114+
pyenv global 2.7.12 3.5.2
115+
python --version
116+
pip --version
117+
python3 --version
118+
pip3 --version
119+
- run:
120+
name: Setup Tests / Scanner Requirements
121+
command: |
122+
make test_setup
123+
- run:
124+
name: Build Container
125+
command: |
126+
make all
127+
- run:
128+
name: Export Build Images for Artifacts
129+
command: |
130+
make save_containers
131+
- run:
132+
name: Test Python3 installation
133+
command: make test_python3_all
134+
- run:
135+
name: Test Python2 as the default
136+
command: make test_python2_all
137+
- store_artifacts:
138+
path: test-results
139+
destination: test-results
55140
workflows:
56141
version: 2
57-
run_tests:
142+
build:
58143
jobs:
59-
- docker-splunk-test
144+
- security-scanning
145+
- debian10-testing
146+
- container-validation
147+
- redhat8-testing
60148

61149

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -400,16 +400,16 @@ docker exec -it $1 bash -c 'if [[ $$(python -V 2>&1) =~ "Python 2" ]] ; then ech
400400
docker kill $1
401401
endef
402402

403-
test_debian9_image_size:
404-
$(call test_image_size,splunk-debian-9)
403+
test_debian10_image_size:
404+
$(call test_image_size,splunk-debian-10)
405405

406406
define test_image_size
407407
docker pull splunk/splunk:edge
408408
CUR_SIZE=$$(docker image inspect $1:latest --format='{{.Size}}') ; \
409409
EDGE_SIZE=$$(docker image inspect splunk/splunk:edge --format='{{.Size}}') ; \
410410
echo "current $1 image size = "$$CUR_SIZE ; \
411411
echo "edge image size = "$$EDGE_SIZE ; \
412-
if [[ $$CUR_SIZE -gt $$EDGE_SIZE*102/100 ]] ; then echo "current image size is 2% more than edge image" ; exit 1 ; fi
412+
if [[ $$CUR_SIZE -gt $$EDGE_SIZE*120/100 ]] ; then echo "current image size is 20% more than edge image" ; exit 1 ; fi
413413
endef
414414

415415
setup_clair_scanner:

base/redhat-8/Dockerfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ LABEL name="splunk" \
2525
summary="UBI 8 Docker image of Splunk Enterprise" \
2626
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."
2727

28-
RUN mkdir /licenses; \
29-
curl -o /licenses/apache-2.0.txt https://www.apache.org/licenses/LICENSE-2.0.txt; \
30-
curl -o /licenses/EULA_Red_Hat_Universal_Base_Image_English_20190422.pdf https://www.redhat.com/licenses/EULA_Red_Hat_Universal_Base_Image_English_20190422.pdf
31-
3228
COPY install.sh /install.sh
33-
RUN /install.sh && rm -rf /install.sh
29+
30+
RUN mkdir /licenses \
31+
&& curl -o /licenses/apache-2.0.txt https://www.apache.org/licenses/LICENSE-2.0.txt \
32+
&& curl -o /licenses/EULA_Red_Hat_Universal_Base_Image_English_20190422.pdf https://www.redhat.com/licenses/EULA_Red_Hat_Universal_Base_Image_English_20190422.pdf \
33+
&& /install.sh && rm -rf /install.sh

base/redhat-8/install.sh

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
set -e
1717

1818
# reinstalling local en def for now, removed in minimal image https://bugzilla.redhat.com/show_bug.cgi?id=1665251
19+
microdnf -y update
1920
microdnf -y --nodocs install glibc-langpack-en
2021

2122
#Currently there is no access to the UTF-8 char map, the following command is commented out until
@@ -27,24 +28,26 @@ export LANG=en_US.utf8
2728

2829
microdnf -y --nodocs install wget sudo shadow-utils procps
2930
#install busybox direct from the multiarch since epel isn't availible yet for redhat8
30-
wget https://busybox.net/downloads/binaries/1.28.1-defconfig-multiarch/busybox-x86_64
31-
mv busybox-x86_64 /bin/busybox
31+
wget -O /bin/busybox https://busybox.net/downloads/binaries/1.28.1-defconfig-multiarch/busybox-`arch`
3232
chmod +x /bin/busybox
33-
microdnf -y --nodocs install python2 tar
34-
pip2 -q --no-cache-dir install requests ansible
33+
microdnf -y --nodocs install gcc redhat-rpm-config python2-devel libffi-devel openssl-devel tar
34+
pip2 --no-cache-dir install requests ansible
35+
microdnf -y remove gcc libffi-devel openssl-devel
36+
microdnf clean all
3537

3638
cd /bin
37-
ln -s busybox diff
38-
ln -s busybox hostname
39-
ln -s busybox killall
40-
ln -s busybox netstat
41-
ln -s busybox nslookup
42-
ln -s busybox ping
43-
ln -s busybox ping6
44-
ln -s busybox readline
45-
ln -s busybox route
46-
ln -s busybox syslogd
47-
ln -s busybox traceroute
39+
ln -s python2 python || true
40+
ln -s busybox diff || true
41+
ln -s busybox hostname || true
42+
ln -s busybox killall || true
43+
ln -s busybox netstat || true
44+
ln -s busybox nslookup || true
45+
ln -s busybox ping || true
46+
ln -s busybox ping6 || true
47+
ln -s busybox readline || true
48+
ln -s busybox route || true
49+
ln -s busybox syslogd || true
50+
ln -s busybox traceroute || true
4851
chmod u+s /bin/ping
4952
groupadd sudo
5053

docs/EXAMPLES.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Note that for more complex scenarios, we will opt to use a [Docker compose file]
1313
* [...with HEC](#create-standalone-with-hec)
1414
* [...with any app](#create-standalone-with-app)
1515
* [...with a SplunkBase app](#create-standalone-with-splunkbase-app)
16+
* [...with SSL enabled](#create-standalone-with-ssl-enabled)
1617
* [Create standalone and universal forwarder](#create-standalone-and-universal-forwarder)
1718
* [Create heavy forwarder](#create-heavy-forwarder)
1819
* [Create heavy forwarder and deployment server](#create-heavy-forwarder-and-deployment-server)
@@ -186,6 +187,26 @@ Execute the following to bring up your deployment:
186187
$ SPLUNKBASE_PASSWORD=<splunkbase_password> SPLUNK_PASSWORD=<password> docker-compose up -d
187188
```
188189

190+
## Create standalone with SSL enabled
191+
192+
To enable SSL over SplunkWeb, you'll first need to generate your self-signed certificates. Please see the [Splunk docs](https://docs.splunk.com/Documentation/Splunk/latest/Security/Self-signcertificatesforSplunkWeb) on how to go about doing this. For the purposes of local development, you can use:
193+
```
194+
openssl req -x509 -newkey rsa:4096 -passout pass:abcd1234 -keyout /home/key.pem -out /home/cert.pem -days 365 -subj /CN=localhost
195+
```
196+
197+
Once you have your certificates available, you can execute the following to bring up your deployment with SSL enabled on the Splunk Web UI:
198+
```
199+
$ docker run --name so1 --hostname so1 -p 8000:8000 \
200+
-e "SPLUNK_HTTP_ENABLESSL=true" \
201+
-e "SPLUNK_HTTP_ENABLESSL_CERT=/home/cert.pem" \
202+
-e "SPLUNK_HTTP_ENABLESSL_PRIVKEY=/home/key.pem" \
203+
-e "SPLUNK_HTTP_ENABLESSL_PRIVKEY_PASSWORD=abcd1234" \
204+
-e "SPLUNK_PASSWORD=<password>" \
205+
-e "SPLUNK_START_ARGS=--accept-license" \
206+
-v /home:/home \
207+
-it splunk/splunk:latest
208+
```
209+
189210
## Create standalone and universal forwarder
190211
You can also enable distributed deployments. In this case, we can create a Splunk universal forwarder running in a container to stream logs to a Splunk standalone, also running in a container.
191212

docs/SETUP.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ Let's break down what this command does:
5252
After the container starts up successfully, you should be able to access SplunkWeb at http://localhost:8000 with `admin:<password>`.
5353

5454
##### Splunk Universal Forwarder
55-
Use the following command to start a single standalone instance of Splunk Enterprise:
55+
Use the following command to start a single standalone instance of Splunk Universal Forwarder:
5656
```
5757
$ docker run --network skynet --name uf1 --hostname uf1 -e "SPLUNK_PASSWORD=<password>" -e "SPLUNK_START_ARGS=--accept-license" -e "SPLUNK_STANDALONE_URL=so1" -it splunk/universalforwarder:latest
5858
```

splunk/common-files/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,12 @@ COPY splunk-ansible ${SPLUNK_ANSIBLE_HOME}
9797
# Set sudo rights
9898
RUN sed -i -e 's/%sudo\s\+ALL=(ALL\(:ALL\)\?)\s\+ALL/%sudo ALL=NOPASSWD:ALL/g' /etc/sudoers \
9999
&& sudo echo -e '\nansible ALL=(splunk)NOPASSWD:ALL' >> /etc/sudoers \
100-
# Create the ansible user/group
100+
&& echo 'Create the ansible user/group' \
101101
&& groupadd -r ${ANSIBLE_GROUP} \
102102
&& useradd -r -m -g ${ANSIBLE_GROUP} ${ANSIBLE_USER} \
103103
&& usermod -aG sudo ${ANSIBLE_USER} \
104104
&& usermod -aG ${ANSIBLE_GROUP} ${SPLUNK_USER} \
105-
# Container Artifact Directory is a place for all artifacts and logs that are generated by the provisioning process. The directory is owned by the user "ansible".
105+
&& echo 'Container Artifact Directory is a place for all artifacts and logs that are generated by the provisioning process. The directory is owned by the user "ansible".' \
106106
&& mkdir ${CONTAINER_ARTIFACT_DIR} \
107107
&& chown -R ${ANSIBLE_USER}:${ANSIBLE_GROUP} ${CONTAINER_ARTIFACT_DIR} \
108108
&& chmod -R 775 ${CONTAINER_ARTIFACT_DIR} \

splunk/common-files/entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ case "$1" in
163163
configure_multisite $0
164164
;;
165165
create-defaults)
166-
create_defaults
166+
create_defaults
167167
;;
168168
restart)
169169
shift

0 commit comments

Comments
 (0)