Skip to content

Instantly share code, notes, and snippets.

View sherifabdlnaby's full-sized avatar

Sherif Abdel-Naby sherifabdlnaby

View GitHub Profile
# Exit on Error
set -e
OUTPUT_DIR=/secrets
CA_FILE=$OUTPUT_DIR/elastic-stack-ca.p12
CERT_FILE=$OUTPUT_DIR/elastic-certificates.p12
printf "====== Generating Elasticsearch Certifications ======\n"
printf "=====================================================\n"
if [ -f "$CA_FILE" ]; then
# Exit on Error
set -e
OUTPUT_DIR=/secrets
CA_FILE=$OUTPUT_DIR/elastic-stack-ca.p12
CERT_FILE=$OUTPUT_DIR/elastic-certificates.p12
printf "====== Generating Elasticsearch Certifications ======\n"
printf "=====================================================\n"
if [ -f "$CA_FILE" ]; then
COMPOSE_PROJECT_NAME=elastic
ELK_VERSION=7.7.0
#----------- Resources --------------------------#
ELASTICSEARCH_HEAP=1024m
LOGSTASH_HEAP=512m
#----------- Hosts and Ports --------------------#
# To be able to further "de-compose" the compose files, get hostnames from environment variables instead.
ELK_VERSION=7.7.0
ELASTIC_USERNAME=elastic
ELASTIC_PASSWORD=changeme
version: '3.5'
# will contain all elasticsearch data.
volumes:
elasticsearch-data:
secrets:
elasticsearch.keystore:
file: ./secrets/elasticsearch.keystore
version: '3.5'
services:
keystore:
build:
context: elasticsearch/
args:
ELK_VERSION: ${ELK_VERSION}
command: bash /setup/setup-keystore.sh
user: "0"
instances:
- name: elasticsearch
dns:
- elasticsearch
- localhost
ip:
- 127.0.0.1
- name: kibana
dns:
# Exit on Error
set -e
OUTPUT_DIR=/secrets/certs
ZIP_FILE=$OUTPUT_DIR/certs.zip
printf "======= Generating Elastic Stack Certificates =======\n"
printf "=====================================================\n"
if ! command -v unzip &>/dev/null; then
---
server.name: kibana
server.host: "0.0.0.0"
# Elasticsearch Connection
elasticsearch.hosts: [ "http://${ELASTICSEARCH_HOST_PORT}" ]
## X-Pack security credentials
elasticsearch.username: ${ELASTIC_USERNAME}
elasticsearch.password: ${ELASTIC_PASSWORD}
ARG ELK_VERSION
# https://github.com/elastic/kibana-docker
FROM docker.elastic.co/kibana/kibana:${ELK_VERSION}
# Add your kibana plugins setup here
# Example: RUN kibana-plugin install <name|url>
#RUN kibana-plugin install https://github.com/bitsensor/elastalert-kibana-plugin/releases/download/1.1.0/elastalert-kibana-plugin-1.1.0-7.3.0.zip