From 7468cd9886f8f1dcce0335c7b3cab504558a1a63 Mon Sep 17 00:00:00 2001 From: Steven Goossens Date: Wed, 13 Nov 2024 10:27:13 +0100 Subject: [PATCH] Add UUID for the Admin organisation when deploying (#183) * Update template.env - Add ADMIN_ORG * Update docker-compose.yml - Add ADMIN_ORG_UUID * Update configure_misp.sh - Add uuid to database --- core/files/configure_misp.sh | 4 ++++ docker-compose.yml | 1 + template.env | 2 ++ 3 files changed, 7 insertions(+) diff --git a/core/files/configure_misp.sh b/core/files/configure_misp.sh index 1767cbb..a1512b3 100755 --- a/core/files/configure_misp.sh +++ b/core/files/configure_misp.sh @@ -282,6 +282,10 @@ init_user() { echo "UPDATE $MYSQL_DATABASE.organisations SET name = \"${ADMIN_ORG}\" where id = 1;" | ${MYSQL_CMD} fi + if [ ! -z "$ADMIN_ORG_UUID" ]; then + echo "UPDATE $MYSQL_DATABASE.organisations SET uuid = \"${ADMIN_ORG_UUID}\" where id = 1;" | ${MYSQL_CMD} + fi + if [ -n "$ADMIN_KEY" ]; then echo "... setting admin key to '${ADMIN_KEY}'" CHANGE_CMD=(sudo -u www-data /var/www/MISP/app/Console/cake User change_authkey 1 "${ADMIN_KEY}") diff --git a/docker-compose.yml b/docker-compose.yml index 4ec9704..c94ab52 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -112,6 +112,7 @@ services: - "ADMIN_PASSWORD=${ADMIN_PASSWORD}" - "ADMIN_KEY=${ADMIN_KEY}" - "ADMIN_ORG=${ADMIN_ORG}" + - "ADMIN_ORG_UUID=${ADMIN_ORG_UUID}" - "GPG_PASSPHRASE=${GPG_PASSPHRASE}" # OIDC authentication settings - "OIDC_ENABLE=${OIDC_ENABLE}" diff --git a/template.env b/template.env index df66f7b..13b8c1e 100644 --- a/template.env +++ b/template.env @@ -35,6 +35,8 @@ LIBFAUP_COMMIT=3a26d0a ADMIN_EMAIL= # name of org #1, default to MISP's default (ORGNAME) ADMIN_ORG= +# uuid of org #1, defaults to an automatically generated one +ADMIN_ORG_UUID= # defaults to an automatically generated one ADMIN_KEY= # defaults to MISP's default (admin)