From eb0d53e8c2b976393a9cd193030a3b85947ffd50 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Delpech Date: Tue, 16 Apr 2019 16:16:28 +0200 Subject: [PATCH 1/5] chore: run image as node user Run elastalert image as unpriviledged user --- Dockerfile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Dockerfile b/Dockerfile index c638b783..f1aee048 100644 --- a/Dockerfile +++ b/Dockerfile @@ -45,5 +45,12 @@ COPY config/config.json config/config.json COPY rule_templates/ /opt/elastalert/rule_templates COPY elastalert_modules/ /opt/elastalert/elastalert_modules +# Add default rules directory +# Set permission as unpriviledged user (1000:1000), compatible with Kubernetes +RUN mkdir -p /opt/elastalert/rules/ /opt/elastalert/server_data/tests/ \ + && chown -R node:node /opt + +USER node + EXPOSE 3030 ENTRYPOINT ["npm", "start"] From baf90a96a69c3438b56e9f3d35adae9d7ee1e853 Mon Sep 17 00:00:00 2001 From: Martijn Rondeel Date: Tue, 14 May 2019 09:58:58 +0200 Subject: [PATCH 2/5] Bump version to 3.0.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0ea6ac65..306f7b08 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@bitsensor/elastalert", - "version": "2.0.1", + "version": "3.0.0", "description": "A server that runs ElastAlert and exposes REST API's for manipulating rules and alerts.", "license": "MIT", "main": "index.js", From 5c3155c69da6c58d7259a69336d0b2fe69de517b Mon Sep 17 00:00:00 2001 From: Martijn Rondeel Date: Tue, 14 May 2019 10:00:39 +0200 Subject: [PATCH 3/5] Fix error when starting ElastAlert --- src/controllers/process/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/controllers/process/index.js b/src/controllers/process/index.js index 83e7f40d..6ad53432 100644 --- a/src/controllers/process/index.js +++ b/src/controllers/process/index.js @@ -48,10 +48,10 @@ export default class ProcessController { }); // Redirect stdin/stderr to logger - if (indexCreate.stdout.toString() !== '') { + if (indexCreate.stdout && indexCreate.stdout.toString() !== '') { logger.info(indexCreate.stdout.toString()); } - if (indexCreate.stderr.toString() !== '') { + if (indexCreate.stderr && indexCreate.stderr.toString() !== '') { logger.error(indexCreate.stderr.toString()); } From 3806188716970f7f2bac6c3f41c81c15062e3357 Mon Sep 17 00:00:00 2001 From: Martijn Rondeel Date: Tue, 14 May 2019 11:07:04 +0200 Subject: [PATCH 4/5] Bump version to 3.0.0-beta.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 306f7b08..b1150496 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@bitsensor/elastalert", - "version": "3.0.0", + "version": "3.0.0-beta.0", "description": "A server that runs ElastAlert and exposes REST API's for manipulating rules and alerts.", "license": "MIT", "main": "index.js", From 6720985ae59acbf1145189b6a44d74fbf45b415d Mon Sep 17 00:00:00 2001 From: Martijn Rondeel Date: Tue, 14 May 2019 11:07:24 +0200 Subject: [PATCH 5/5] Bump ElastAlert to v0.2.0b2 --- Dockerfile | 2 +- Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index c638b783..226d70df 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ FROM alpine:latest as py-ea -ARG ELASTALERT_VERSION=v0.1.39 +ARG ELASTALERT_VERSION=v0.2.0b2 ENV ELASTALERT_VERSION=${ELASTALERT_VERSION} # URL from which to download Elastalert. ARG ELASTALERT_URL=https://github.com/Yelp/elastalert/archive/$ELASTALERT_VERSION.zip diff --git a/Makefile b/Makefile index 82255fc0..9a7610e0 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -v ?= v0.1.39 +v ?= v0.2.0b2 all: build