mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 09:12:45 +01:00
Merge pull request #6066 from Security-Onion-Solutions/fix/evtx-import-elastic-creds
Fix/evtx import elastic creds
This commit is contained in:
@@ -25,6 +25,7 @@
|
|||||||
|
|
||||||
INDEX_DATE=$(date +'%Y.%m.%d')
|
INDEX_DATE=$(date +'%Y.%m.%d')
|
||||||
RUNID=$(cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 8 | head -n 1)
|
RUNID=$(cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 8 | head -n 1)
|
||||||
|
LOG_FILE=/nsm/import/evtx-import.log
|
||||||
|
|
||||||
. /usr/sbin/so-common
|
. /usr/sbin/so-common
|
||||||
|
|
||||||
@@ -41,14 +42,17 @@ function evtx2es() {
|
|||||||
EVTX=$1
|
EVTX=$1
|
||||||
HASH=$2
|
HASH=$2
|
||||||
|
|
||||||
|
ES_PW=$(lookup_pillar "auth:users:so_elastic_user:pass" "elasticsearch")
|
||||||
|
ES_USER=$(lookup_pillar "auth:users:so_elastic_user:user" "elasticsearch")
|
||||||
|
|
||||||
docker run --rm \
|
docker run --rm \
|
||||||
-v "$EVTX:/tmp/$RUNID.evtx" \
|
-v "$EVTX:/tmp/$RUNID.evtx" \
|
||||||
--entrypoint evtx2es \
|
--entrypoint evtx2es \
|
||||||
{{ MANAGER }}:5000/{{ IMAGEREPO }}/so-pcaptools:{{ VERSION }} \
|
{{ MANAGER }}:5000/{{ IMAGEREPO }}/so-pcaptools:{{ VERSION }} \
|
||||||
--host {{ MANAGERIP }} --scheme https \
|
--host {{ MANAGERIP }} --scheme https \
|
||||||
--index so-beats-$INDEX_DATE --pipeline import.wel \
|
--index so-beats-$INDEX_DATE --pipeline import.wel \
|
||||||
--login {{ES_USER}} --pwd {{ES_PW}} \
|
--login $ES_USER --pwd $ES_PW \
|
||||||
"/tmp/$RUNID.evtx" 1>/dev/null 2>/dev/null
|
"/tmp/$RUNID.evtx" >> $LOG_FILE 2>&1
|
||||||
|
|
||||||
docker run --rm \
|
docker run --rm \
|
||||||
-v "$EVTX:/tmp/import.evtx" \
|
-v "$EVTX:/tmp/import.evtx" \
|
||||||
|
|||||||
Reference in New Issue
Block a user