Skip to content

Commit

Permalink
Add syncservers pull rules
Browse files Browse the repository at this point in the history
  • Loading branch information
ostefano committed Aug 6, 2024
1 parent 2f24067 commit 5ef80d3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion core/files/configure_misp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ create_sync_servers() {

# Add sync server
echo "... adding new sync server ${NAME} with organization id ${ORG_ID}"
JSON_DATA=$(echo "${!DATA}" | jq --arg org_id ${ORG_ID} 'del(.remote_org_uuid) | . + {remote_org_id: $org_id}')
JSON_DATA=$(echo "${!DATA}" | jq --arg org_id ${ORG_ID} 'del(.remote_org_uuid) | . + {remote_org_id: $org_id} | del(..|select(. == ""))')
add_server ${BASE_URL} ${ADMIN_KEY} "$JSON_DATA" > /dev/null
done
}
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ services:
"name": "${SYNCSERVERS_1_NAME}",
"authkey": "${SYNCSERVERS_1_KEY}",
"url": "${SYNCSERVERS_1_URL}",
"pull_rules": "${SYNCSERVERS_1_PULL_RULES}",
"pull": true
}
# mysql settings
Expand Down
4 changes: 4 additions & 0 deletions template.env
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ SYNCSERVERS_1_URL=
SYNCSERVERS_1_NAME=
SYNCSERVERS_1_UUID=
SYNCSERVERS_1_KEY=
# pull rules are JSON encoded (and escaped) dictionaries
# Example: only pull events where the analysis is complete
# SYNCSERVERS_1_PULL_RULES='{\"tags\":{\"OR\":[],\"NOT\":[]},\"orgs\":{\"OR\":[],\"NOT\":[]},\"url_params\":\"{\\\"searchanalysis\\\": \\\"2\\\"}\"}'
SYNCSERVERS_1_PULL_RULES=

# optional and used to set mysql db and credentials
# MYSQL_HOST=
Expand Down

0 comments on commit 5ef80d3

Please sign in to comment.