From 927d9ff04376f963c1d31c6e93734646daa1a0da Mon Sep 17 00:00:00 2001 From: Body4 Date: Fri, 4 Dec 2020 22:22:00 +0100 Subject: [PATCH 1/5] Update run.sh --- web/run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/run.sh b/web/run.sh index 93e396f..aa3d5b1 100755 --- a/web/run.sh +++ b/web/run.sh @@ -27,7 +27,7 @@ if [ -r /.firstboot.tmp ]; then if [ -z "$POSTFIX_RELAY_HOST" ]; then echo "POSTFIX_RELAY_HOST is not set, please configure Postfix manually later..." else - postconf -e "relayhost = $POSTFIX_RELAY" + postconf -e "relayhost = $POSTFIX_RELAY_HOST" fi # Fix timezone (adapt to your local zone) From 46b2cc37bd11f9331b042d8f4f44b1be21d06663 Mon Sep 17 00:00:00 2001 From: Coleman Kane Date: Sat, 6 Mar 2021 13:10:36 -0500 Subject: [PATCH 2/5] Fix bug in patching the MISP.baseurl from environment The web/run.sh script was using a sed command that had two defects, preventing the MISP_BASEURL environment from setting the MISP.baseurl in config.php: - pattern used '/' as boundaries, making it incompatible with a baseurl containing that character - pattern assumed 1 space between 'baseurl' and '=>', but the config.php has multiple whitespace/tabs, so broadened the pattern to support any arbitrary length whitespace there Signed-off-by: Coleman Kane --- web/run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/run.sh b/web/run.sh index 93e396f..c007f59 100755 --- a/web/run.sh +++ b/web/run.sh @@ -100,7 +100,7 @@ if [ -r /.firstboot.tmp ]; then echo "No base URL defined, don't forget to define it manually!" else echo "Fixing the MISP base URL ($MISP_BASEURL) ..." - sed -i "s/'baseurl' => '',/'baseurl' => '$MISP_BASEURL',/g" /var/www/MISP/app/Config/config.php + sed -i "s@'baseurl'[\t ]*=>[\t ]*'',@'baseurl' => '$MISP_BASEURL',@g" /var/www/MISP/app/Config/config.php fi # Generate the admin user PGP key From 33421a53e3c33aff9eddf67494a91206f3dc3faa Mon Sep 17 00:00:00 2001 From: Coleman Kane Date: Sun, 7 Mar 2021 12:49:14 -0500 Subject: [PATCH 3/5] Update to Ubuntu "focal" 20.04 LTS The "bionic" distro is older and includes a version of PHP (7.2) that is older than what MISP recommends (>=7.4). Additionally, "bionic" is supposed to be EOL later this year, so updating the project to keep current. Necessary changes to PHP & libpoppler versions. Signed-off-by: Coleman Kane --- web/Dockerfile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/web/Dockerfile b/web/Dockerfile index 3578938..095bb02 100644 --- a/web/Dockerfile +++ b/web/Dockerfile @@ -1,5 +1,5 @@ -FROM ubuntu:bionic +FROM ubuntu:focal # Install core components ENV DEBIAN_FRONTEND noninteractive @@ -19,7 +19,8 @@ RUN apt-get install -y apache2 apache2-doc apache2-utils && \ a2dismod status && \ a2dissite 000-default -# PHP 7.2 and install MySQL PDO extension +# PHP 7.4 and install MySQL PDO extension +RUN apt-get update RUN apt-get install -y libapache2-mod-php php php-dev php-json \ php-mysql php-redis php-xml php-mbstring \ php-gd php-pear php-opcache \ @@ -31,7 +32,7 @@ RUN sed -i \ -e "s/memory_limit = 128M/memory_limit = 2048M/" \ -e "s/upload_max_filesize = 2M/upload_max_filesize = 50M/" \ -e "s/post_max_size = 8M/post_max_size = 50M/" \ - /etc/php/7.2/apache2/php.ini + /etc/php/7.4/apache2/php.ini RUN apt-get install -y python3-dev python3-pip python3-setuptools \ python3-lxml libjpeg-dev \ @@ -133,7 +134,7 @@ RUN rm -rf misp-objects && git clone https://github.com/MISP/misp-objects.git && chown -R www-data:www-data misp-objects misp-galaxy warninglists taxonomies # Install MISP build requirements -RUN sudo -E apt-get -y install libpoppler73 libpoppler-dev libpoppler-cpp-dev +RUN sudo -E apt-get -y install libpoppler97 libpoppler-dev libpoppler-cpp-dev # Install MISP Modules WORKDIR /opt From 5fa787cb7e96975d25b5f8cf89f39d97eef5e489 Mon Sep 17 00:00:00 2001 From: Coleman Kane Date: Sun, 7 Mar 2021 12:51:23 -0500 Subject: [PATCH 4/5] Run apt-get with --fix-missing to fix any version discrepancies for installed packages. Signed-off-by: Coleman Kane --- web/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/Dockerfile b/web/Dockerfile index 095bb02..07f5c52 100644 --- a/web/Dockerfile +++ b/web/Dockerfile @@ -21,7 +21,7 @@ RUN apt-get install -y apache2 apache2-doc apache2-utils && \ # PHP 7.4 and install MySQL PDO extension RUN apt-get update -RUN apt-get install -y libapache2-mod-php php php-dev php-json \ +RUN apt-get install -y --fix-missing libapache2-mod-php php php-dev php-json \ php-mysql php-redis php-xml php-mbstring \ php-gd php-pear php-opcache \ pkg-config libbson-1.0 libmongoc-1.0-0 From 94a4740bc8a49b0d0f8ada746573eabe893e2f22 Mon Sep 17 00:00:00 2001 From: Coleman Kane Date: Sun, 7 Mar 2021 12:52:42 -0500 Subject: [PATCH 5/5] Add "zip", "bcmath", and "intl" modules to PHP These three are recommended in the latest MISP diagnostics page, so I decided to add them to the docker build as well. Signed-off-by: Coleman Kane --- web/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web/Dockerfile b/web/Dockerfile index 07f5c52..c5bafae 100644 --- a/web/Dockerfile +++ b/web/Dockerfile @@ -24,7 +24,8 @@ RUN apt-get update RUN apt-get install -y --fix-missing libapache2-mod-php php php-dev php-json \ php-mysql php-redis php-xml php-mbstring \ php-gd php-pear php-opcache \ - pkg-config libbson-1.0 libmongoc-1.0-0 + pkg-config libbson-1.0 libmongoc-1.0-0 \ + php-zip php-bcmath php-intl # Fix php.ini with recommended settings RUN sed -i \