Skip to content

Commit f50797f

Browse files
Merge pull request #106 from sherifabdlnaby/8.10
Upgrade to 8.10.2 - Fixes #82 - Fixes #76 - Fixes #102
2 parents e9374d7 + 03cad17 commit f50797f

File tree

9 files changed

+23
-44
lines changed

9 files changed

+23
-44
lines changed

.env

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
COMPOSE_PROJECT_NAME=elastic
2-
ELK_VERSION=8.8.0
2+
ELK_VERSION=8.10.2
33

44
#----------- Resources --------------------------#
55
ELASTICSEARCH_HEAP=1024m
@@ -15,7 +15,6 @@ KIBANA_HOST=kibana
1515
KIBANA_PORT=5601
1616

1717
LOGSTASH_HOST=logstash
18-
LOGSTASH_PORT=8080
1918

2019
APMSERVER_HOST=apm-server
2120
APMSERVER_PORT=8200

Makefile

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
.DEFAULT_GOAL:=help
22

3-
COMPOSE_ALL_FILES := -f docker-compose.yml -f docker-compose.monitor.yml -f docker-compose.tools.yml -f docker-compose.nodes.yml -f docker-compose.logs.yml
3+
COMPOSE_ALL_FILES := -f docker-compose.yml -f docker-compose.monitor.yml -f docker-compose.nodes.yml -f docker-compose.logs.yml
44
COMPOSE_MONITORING := -f docker-compose.yml -f docker-compose.monitor.yml
55
COMPOSE_LOGGING := -f docker-compose.yml -f docker-compose.logs.yml
6-
COMPOSE_TOOLS := -f docker-compose.yml -f docker-compose.tools.yml
76
COMPOSE_NODES := -f docker-compose.yml -f docker-compose.nodes.yml
87
ELK_SERVICES := elasticsearch logstash kibana apm-server
98
ELK_LOG_COLLECTION := filebeat
109
ELK_MONITORING := elasticsearch-exporter logstash-exporter filebeat-cluster-logs
11-
ELK_TOOLS := rubban
1210
ELK_NODES := elasticsearch-1 elasticsearch-2
13-
ELK_MAIN_SERVICES := ${ELK_SERVICES} ${ELK_MONITORING} ${ELK_TOOLS}
11+
ELK_MAIN_SERVICES := ${ELK_SERVICES} ${ELK_MONITORING}
1412
ELK_ALL_SERVICES := ${ELK_MAIN_SERVICES} ${ELK_NODES} ${ELK_LOG_COLLECTION}
1513

1614
compose_v2_not_supported = $(shell command docker compose 2> /dev/null)
@@ -21,7 +19,7 @@ else
2119
endif
2220

2321
# --------------------------
24-
.PHONY: setup keystore certs all elk monitoring tools build down stop restart rm logs
22+
.PHONY: setup keystore certs all elk monitoring build down stop restart rm logs
2523

2624
keystore: ## Setup Elasticsearch Keystore, by initializing passwords, and add credentials defined in `keystore.sh`.
2725
$(DOCKER_COMPOSE_COMMAND) -f docker-compose.setup.yml run --rm keystore
@@ -41,17 +39,14 @@ elk: ## Start ELK.
4139

4240
up:
4341
@make elk
44-
@echo "Visit Kibana: https://localhost:5601"
42+
@echo "Visit Kibana: https://localhost:5601 (user: elastic, password: changeme) [Unless you changed values in .env]"
4543

4644
monitoring: ## Start ELK Monitoring.
4745
$(DOCKER_COMPOSE_COMMAND) ${COMPOSE_MONITORING} up -d --build ${ELK_MONITORING}
4846

49-
collect-docker-logs: ## Start Filebeat that collects all Host Docker Logs and ship it to ELK
47+
collect-docker-logs: ## Start Filebeat that collects all Host Docker Logs and ship it to ELK
5048
$(DOCKER_COMPOSE_COMMAND) ${COMPOSE_LOGGING} up -d --build ${ELK_LOG_COLLECTION}
5149

52-
tools: ## Start ELK Tools (ElastAlert, Curator).
53-
$(DOCKER_COMPOSE_COMMAND) ${COMPOSE_TOOLS} up -d --build ${ELK_TOOLS}
54-
5550
nodes: ## Start Two Extra Elasticsearch Nodes
5651
$(DOCKER_COMPOSE_COMMAND) ${COMPOSE_NODES} up -d --build ${ELK_NODES}
5752

README.md

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<h4 align="center">Configured to be ready to be used for Log, Metrics, APM, Alerting, Machine Learning, and Security (SIEM) usecases.</h4>
77
<p align="center">
88
<a>
9-
<img src="https://img.shields.io/badge/Elastic%20Stack-8.8.0-blue?style=flat&logo=elasticsearch" alt="Elastic Stack Version 7^^">
9+
<img src="https://img.shields.io/badge/Elastic%20Stack-8.10.2-blue?style=flat&logo=elasticsearch" alt="Elastic Stack Version 7^^">
1010
</a>
1111
<a>
1212
<img src="https://img.shields.io/github/v/tag/sherifabdlnaby/elastdocker?label=release&amp;sort=semver">
@@ -36,7 +36,7 @@ Elastic Stack (**ELK**) Docker Composition, preconfigured with **Security**, **M
3636

3737
Suitable for Demoing, MVPs and small production deployments.
3838

39-
Stack Version: [8.8.0](https://www.elastic.co/blog/whats-new-elastic-8-8-0) 🎉 - Based on [Official Elastic Docker Images](https://www.docker.elastic.co/)
39+
Stack Version: [8.10.2](https://www.elastic.co/blog/whats-new-elastic-8-10-0) 🎉 - Based on [Official Elastic Docker Images](https://www.docker.elastic.co/)
4040
> You can change Elastic Stack version by setting `ELK_VERSION` in `.env` file and rebuild your images. Any version >= 8.0.0 is compatible with this template.
4141
4242
### Main Features 📜
@@ -45,18 +45,18 @@ Stack Version: [8.8.0](https://www.elastic.co/blog/whats-new-elastic-8-8-0) 🎉
4545
- Security Enabled By Default.
4646
- Configured to Enable:
4747
- Logging & Metrics Ingestion
48+
- Option to collect logs of all Docker Containers running on the host. via `make collect-docker-logs`.
4849
- APM
4950
- Alerting
5051
- Machine Learning
51-
- SIEM
52+
- Anomaly Detection
53+
- SIEM (Security information and event management).
5254
- Enabling Trial License
5355
- Use Docker-Compose and `.env` to configure your entire stack parameters.
5456
- Persist Elasticsearch's Keystore and SSL Certifications.
5557
- Self-Monitoring Metrics Enabled.
5658
- Prometheus Exporters for Stack Metrics.
57-
- Collect Docker Host Logs to ELK via `make collect-docker-logs`.
5859
- Embedded Container Healthchecks for Stack Images.
59-
- [Rubban](https://github.com/sherifabdlnaby/rubban) for Kibana curating tasks.
6060

6161
#### More points
6262
And comparing Elastdocker and the popular [deviantony/docker-elk](https://github.com/deviantony/docker-elk)
@@ -85,7 +85,7 @@ Elastdocker differs from `deviantony/docker-elk` in the following points.
8585

8686
- Configuring the Self-Monitoring and the Filebeat agent that ship ELK logs to ELK itself. (as a step to shipping it to a monitoring cluster in the future).
8787

88-
- Configured tools and Prometheus Exporters.
88+
- Configured Prometheus Exporters.
8989

9090
- The Makefile that simplifies everything into some simple commands.
9191

@@ -135,10 +135,6 @@ Elastdocker differs from `deviantony/docker-elk` in the following points.
135135
```shell
136136
$ make monitoring
137137
```
138-
#### To Start Tools
139-
```shell
140-
$ make tools
141-
```
142138
#### To Ship Docker Container Logs to ELK
143139
```shell
144140
$ make collect-docker-logs
@@ -172,15 +168,14 @@ $ make prune
172168

173169
* Some Configuration are parameterized in the `.env` file.
174170
* `ELASTIC_PASSWORD`, user `elastic`'s password (default: `changeme` _pls_).
175-
* `ELK_VERSION` Elastic Stack Version (default: `8.8.0`)
171+
* `ELK_VERSION` Elastic Stack Version (default: `8.10.2`)
176172
* `ELASTICSEARCH_HEAP`, how much Elasticsearch allocate from memory (default: 1GB -good for development only-)
177173
* `LOGSTASH_HEAP`, how much Logstash allocate from memory.
178174
* Other configurations which their such as cluster name, and node name, etc.
179175
* Elasticsearch Configuration in `elasticsearch.yml` at `./elasticsearch/config`.
180176
* Logstash Configuration in `logstash.yml` at `./logstash/config/logstash.yml`.
181177
* Logstash Pipeline in `main.conf` at `./logstash/pipeline/main.conf`.
182178
* Kibana Configuration in `kibana.yml` at `./kibana/config`.
183-
* Rubban Configuration using Docker-Compose passed Environment Variables.
184179

185180
### Setting Up Keystore
186181

docker-compose.nodes.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ services:
2020
ELASTIC_NODE_NAME: ${ELASTIC_NODE_NAME_1}
2121
ELASTIC_INIT_MASTER_NODE: ${ELASTIC_INIT_MASTER_NODE}
2222
ELASTIC_DISCOVERY_SEEDS: ${ELASTIC_DISCOVERY_SEEDS}
23+
ELASTICSEARCH_PORT: ${ELASTICSEARCH_PORT}
2324
ES_JAVA_OPTS: -Xmx${ELASTICSEARCH_HEAP} -Xms${ELASTICSEARCH_HEAP} -Des.enforce.bootstrap.checks=true
2425
bootstrap.memory_lock: "true"
2526
volumes:
@@ -56,6 +57,7 @@ services:
5657
ELASTIC_NODE_NAME: ${ELASTIC_NODE_NAME_2}
5758
ELASTIC_INIT_MASTER_NODE: ${ELASTIC_INIT_MASTER_NODE}
5859
ELASTIC_DISCOVERY_SEEDS: ${ELASTIC_DISCOVERY_SEEDS}
60+
ELASTICSEARCH_PORT: ${ELASTICSEARCH_PORT}
5961
ES_JAVA_OPTS: -Xmx${ELASTICSEARCH_HEAP} -Xms${ELASTICSEARCH_HEAP} -Des.enforce.bootstrap.checks=true
6062
bootstrap.memory_lock: "true"
6163
volumes:

docker-compose.tools.yml

Lines changed: 0 additions & 16 deletions
This file was deleted.

docker-compose.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ services:
4545
ELASTIC_NODE_NAME: ${ELASTIC_NODE_NAME}
4646
ELASTIC_INIT_MASTER_NODE: ${ELASTIC_INIT_MASTER_NODE}
4747
ELASTIC_DISCOVERY_SEEDS: ${ELASTIC_DISCOVERY_SEEDS}
48+
ELASTICSEARCH_PORT: ${ELASTICSEARCH_PORT}
4849
ES_JAVA_OPTS: "-Xmx${ELASTICSEARCH_HEAP} -Xms${ELASTICSEARCH_HEAP} -Des.enforce.bootstrap.checks=true -Dlog4j2.formatMsgNoLookups=true"
4950
bootstrap.memory_lock: "true"
5051
volumes:
@@ -63,7 +64,7 @@ services:
6364
- source: elasticsearch.key
6465
target: /usr/share/elasticsearch/config/certs/elasticsearch.key
6566
ports:
66-
- "9200:9200"
67+
- "${ELASTICSEARCH_PORT}:${ELASTICSEARCH_PORT}"
6768
- "9300:9300"
6869
ulimits:
6970
memlock:
@@ -73,7 +74,7 @@ services:
7374
soft: 200000
7475
hard: 200000
7576
healthcheck:
76-
test: ["CMD", "sh", "-c", "curl -sf --insecure https://$ELASTIC_USERNAME:$ELASTIC_PASSWORD@localhost:9200/_cat/health | grep -ioE 'green|yellow' || echo 'not green/yellow cluster status'"]
77+
test: ["CMD", "sh", "-c", "curl -sf --insecure https://$ELASTIC_USERNAME:$ELASTIC_PASSWORD@localhost:$ELASTICSEARCH_PORT/_cat/health | grep -ioE 'green|yellow' || echo 'not green/yellow cluster status'"]
7778

7879
logstash:
7980
image: elastdocker/logstash:${ELK_VERSION}
@@ -113,6 +114,7 @@ services:
113114
ELASTIC_USERNAME: ${ELASTIC_USERNAME}
114115
ELASTIC_PASSWORD: ${ELASTIC_PASSWORD}
115116
ELASTICSEARCH_HOST_PORT: https://${ELASTICSEARCH_HOST}:${ELASTICSEARCH_PORT}
117+
KIBANA_PORT: ${KIBANA_PORT}
116118
env_file:
117119
- ./secrets/.env.kibana.token
118120
secrets:
@@ -123,7 +125,7 @@ services:
123125
- source: kibana.key
124126
target: /certs/kibana.key
125127
ports:
126-
- "5601:5601"
128+
- "${KIBANA_PORT}:${KIBANA_PORT}"
127129

128130
apm-server:
129131
image: elastdocker/apm-server:${ELK_VERSION}

elasticsearch/config/elasticsearch.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ cluster.name: ${ELASTIC_CLUSTER_NAME}
55
node.name: ${ELASTIC_NODE_NAME}
66
network.host: 0.0.0.0
77
transport.host: 0.0.0.0
8+
http.port: ${ELASTICSEARCH_PORT}
89

910
## Cluster Settings
1011
discovery.seed_hosts: ${ELASTIC_DISCOVERY_SEEDS}

elasticsearch/scripts/docker-healthcheck

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ set -eo pipefail
33

44
host="$(hostname --ip-address || echo '127.0.0.1')"
55

6-
if health="$(curl -fsSL "http://$ELASTIC_USERNAME:$ELASTIC_PASSWORD@$host:9200/_cat/health?h=status")"; then
6+
if health="$(curl -fsSL "https://$ELASTIC_USERNAME:$ELASTIC_PASSWORD@$host:$ELASTICSEARCH_PORT/_cat/health?h=status" --insecure")"; then
77
health="$(echo "$health" | sed -r 's/^[[:space:]]+|[[:space:]]+$//g')" # trim whitespace (otherwise we'll have "green ")
88
if [ "$health" = 'green' ] || [ "$health" = "yellow" ]; then
99
exit 0

kibana/config/kibana.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#
55
server.name: kibana
66
server.host: "0.0.0.0"
7+
server.port: ${KIBANA_PORT}
78

89
# Elasticsearch Connection
910
elasticsearch.hosts: [ "${ELASTICSEARCH_HOST_PORT}" ]

0 commit comments

Comments
 (0)