Skip to content

Commit 5ef80d3

Browse files
committed
Add syncservers pull rules
1 parent 2f24067 commit 5ef80d3

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

core/files/configure_misp.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ create_sync_servers() {
421421

422422
# Add sync server
423423
echo "... adding new sync server ${NAME} with organization id ${ORG_ID}"
424-
JSON_DATA=$(echo "${!DATA}" | jq --arg org_id ${ORG_ID} 'del(.remote_org_uuid) | . + {remote_org_id: $org_id}')
424+
JSON_DATA=$(echo "${!DATA}" | jq --arg org_id ${ORG_ID} 'del(.remote_org_uuid) | . + {remote_org_id: $org_id} | del(..|select(. == ""))')
425425
add_server ${BASE_URL} ${ADMIN_KEY} "$JSON_DATA" > /dev/null
426426
done
427427
}

docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ services:
148148
"name": "${SYNCSERVERS_1_NAME}",
149149
"authkey": "${SYNCSERVERS_1_KEY}",
150150
"url": "${SYNCSERVERS_1_URL}",
151+
"pull_rules": "${SYNCSERVERS_1_PULL_RULES}",
151152
"pull": true
152153
}
153154
# mysql settings

template.env

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ SYNCSERVERS_1_URL=
6363
SYNCSERVERS_1_NAME=
6464
SYNCSERVERS_1_UUID=
6565
SYNCSERVERS_1_KEY=
66+
# pull rules are JSON encoded (and escaped) dictionaries
67+
# Example: only pull events where the analysis is complete
68+
# SYNCSERVERS_1_PULL_RULES='{\"tags\":{\"OR\":[],\"NOT\":[]},\"orgs\":{\"OR\":[],\"NOT\":[]},\"url_params\":\"{\\\"searchanalysis\\\": \\\"2\\\"}\"}'
69+
SYNCSERVERS_1_PULL_RULES=
6670

6771
# optional and used to set mysql db and credentials
6872
# MYSQL_HOST=

0 commit comments

Comments
 (0)