Skip to content

Commit d06301c

Browse files
authored
Merge pull request #2 from AdsumSOK/master
Update Elastic search to 7.2.0
2 parents b5d9ce7 + 0f903be commit d06301c

File tree

3 files changed

+22
-11
lines changed

3 files changed

+22
-11
lines changed

Dockerfile

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ FROM centos:latest
33
EXPOSE 9200
44
EXPOSE 5601
55

6-
ENV ES_VERSION 5.6.3
7-
ENV KIBANA_VERSION 5.6.3
6+
ENV ES_VERSION 7.2.0
7+
ENV KIBANA_VERSION 7.2.0
88

99
RUN yum -y install epel-release && yum clean all
1010
RUN yum -y install unzip zip curl git java-1.8.0-openjdk python python-pip && yum clean all
@@ -14,12 +14,15 @@ RUN pip install beautifulsoup4 python-dateutil html5lib lxml tornado retrying py
1414

1515
RUN mkdir /toolbox
1616
ADD kibana.yml /toolbox
17-
RUN useradd -r elasticsearch
17+
#Trick to adjust access rights between host and docker shared directories
18+
RUN groupadd -g 1001 elasticsearch
19+
RUN useradd -r elasticsearch --uid 1000 --gid 1001
1820

1921
RUN cd /toolbox && \
20-
curl -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-${ES_VERSION}.zip && \
21-
unzip elasticsearch-${ES_VERSION}.zip && \
22-
rm -rf elasticsearch-${ES_VERSION}.zip && \
22+
#Elasticsearch is now a tar.gz file
23+
curl -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-${ES_VERSION}-linux-x86_64.tar.gz && \
24+
tar -xvzf elasticsearch-${ES_VERSION}-linux-x86_64.tar.gz && \
25+
rm -rf elasticsearch-${ES_VERSION}-linux-x86_64.tar.gz && \
2326
ln -s elasticsearch-${ES_VERSION} elasticsearch && \
2427
chown -R elasticsearch elasticsearch-${ES_VERSION}
2528

@@ -35,9 +38,17 @@ RUN cd /toolbox && \
3538

3639
RUN cd /toolbox && git clone https://github.com/bitsofinfo/elasticsearch-gmail.git
3740
RUN cd /toolbox && git clone https://github.com/bitsofinfo/csv2es.git
41+
#get this intersting repo too
42+
RUN cd /toolbox && git clone https://github.com/cvandeplas/ELK-forensics
43+
44+
#Trick to modify elasticsearch-gmail.git repo to comply to new elastic search requirements
45+
RUN sed -i 's~request = HTTPRequest(tornado.options.options.es_url + "/_bulk", method="POST", body=upload_data_txt, request_timeout=tornado.options.options.es_http_timeout_seconds)~request = HTTPRequest(tornado.options.options.es_url + "/_bulk", method="POST", body=upload_data_txt, request_timeout=tornado.options.options.es_http_timeout_seconds,headers={"content-type":"application/json"})~g' /toolbox/elasticsearch-gmail/src/index_emails.py
46+
#New elasticsearch mandatory params
47+
RUN sed -i 's/#node.name: node-1/node.name: node-1/g' /toolbox/elasticsearch/config/elasticsearch.yml
48+
RUN sed -i 's/#cluster.initial_master_nodes: \["node-1", "node-2"\]/cluster.initial_master_nodes: \["node-1"\]/g' /toolbox/elasticsearch/config/elasticsearch.yml
49+
50+
3851

3952
ADD entrypoint.sh /entrypoint.sh
4053
RUN chmod 755 /entrypoint.sh
4154
ENTRYPOINT ["/entrypoint.sh"]
42-
43-
#CMD ["python","/toolbox/elasticsearch-gmail/src/index_emails.py"]

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ Bring up a terminal or command prompt on your computer and run the following, be
118118
*Note: if using Docker Toolbox for Windows*: All of the mounted volumes below should live somewhere under your home directory under `c:\Users\[your username]\...` due to permissions issues.
119119

120120
```
121-
docker run --rm -ti -p 5601:5601 \
121+
docker run --rm -ti \
122+
--ulimit nofile=65536:65536 \
122123
-v PATH/TO/YOUR/my-email.mbox:/toolbox/email.mbox \
123124
-v PATH/TO/ELASTICSEARCH_DATA_DIR:/toolbox/elasticsearch/data \
124125
comms-analyzer-toolbox:latest \

entrypoint.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,10 @@ else
88
echo "using: ES_JAVA_OPTS=$ES_JAVA_OPTS"
99
fi
1010

11-
1211
echo
1312
echo "Starting ElasticSearch.... please wait"
1413
echo
15-
su -c "export ES_JAVA_OPTS='$ES_JAVA_OPTS'; nohup /toolbox/elasticsearch/bin/elasticsearch -d -Enetwork.host=0.0.0.0 &>/toolbox/elasticsearch/elasticsearch.log &" -s /bin/bash elasticsearch
14+
su -c "export ES_JAVA_OPTS='$ES_JAVA_OPTS'; nohup /toolbox/elasticsearch/bin/elasticsearch -d -Enetwork.host=0.0.0.0 &>/toolbox/elasticsearch/logs/elasticsearch.log &" -s /bin/bash elasticsearch
1615
sleep 10
1716
timeout 30 tail -f /toolbox/elasticsearch/logs/elasticsearch.log
1817

0 commit comments

Comments
 (0)