From f866ef63253b3002142f2de8d44067d4adcfe431 Mon Sep 17 00:00:00 2001 From: bunkerity Date: Thu, 29 Jul 2021 17:32:33 +0200 Subject: [PATCH] autoconf - minor fixes, prepare Swarm testing --- Dockerfile | 6 ++---- entrypoint/entrypoint.sh | 2 +- entrypoint/permissions.sh | 32 +++++++++++++++++--------------- examples/swarm/stack.yml | 2 +- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/Dockerfile b/Dockerfile index 603e488..f7b18ba 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,10 +12,8 @@ RUN chmod +x /tmp/docker.sh && \ /tmp/docker.sh && \ rm -f /tmp/docker.sh -# Fix CVE-2021-22901, CVE-2021-22898, CVE-2021-22897 and CVE-2021-33560 -RUN apk add "curl>=7.77.0-r0" "libgcrypt>=1.8.8-r0" -# Fix CVE-2021-36159 -#RUN apk add "apk-tools>=2.12.6-r0" +# Fix CVE-2021-22901, CVE-2021-22898, CVE-2021-22897, CVE-2021-33560 and CVE-2021-36159 +RUN apk add "curl>=7.77.0-r0" "libgcrypt>=1.8.8-r0" "apk-tools>=2.12.6-r0" VOLUME /www /http-confs /server-confs /modsec-confs /modsec-crs-confs /cache /pre-server-confs /acme-challenge /plugins diff --git a/entrypoint/entrypoint.sh b/entrypoint/entrypoint.sh index 4941af8..c395cde 100644 --- a/entrypoint/entrypoint.sh +++ b/entrypoint/entrypoint.sh @@ -1,6 +1,6 @@ #!/bin/bash -. /opt/bunkerize-nginx/entrypoint/utils.sh +. /opt/bunkerized-nginx/entrypoint/utils.sh log "entrypoint" "INFO" "starting bunkerized-nginx ..." diff --git a/entrypoint/permissions.sh b/entrypoint/permissions.sh index 54d2771..662cfe5 100644 --- a/entrypoint/permissions.sh +++ b/entrypoint/permissions.sh @@ -10,38 +10,40 @@ if [ -f "/usr/sbin/nginx" ] ; then # /www if [ ! -r "/www" ] || [ ! -x "/www" ] ; then echo "[!] ERROR - wrong permissions on /www" - exit 2 - fi - # /modsec-confs - if [ ! -r "/modsec-confs" ] || [ ! -x "/modsec-confs" ] ; then - echo "[!] ERROR - wrong permissions on /modsec-confs" - exit 3 - fi - # /modsec-crs-confs - if [ ! -r "/modsec-crs-confs" ] || [ ! -x "/modsec-crs-confs" ] ; then - echo "[!] ERROR - wrong permissions on /modsec-crs-confs" - exit 4 + exit 1 fi # /server-confs if [ ! -r "/server-confs" ] || [ ! -x "/server-confs" ] ; then echo "[!] ERROR - wrong permissions on /server-confs" - exit 5 + exit 1 fi # /http-confs if [ ! -r "/http-confs" ] || [ ! -x "/http-confs" ] ; then echo "[!] ERROR - wrong permissions on /http-confs" - exit 6 + exit 1 fi fi +# /modsec-confs +if [ ! -r "/modsec-confs" ] || [ ! -x "/modsec-confs" ] ; then + echo "[!] ERROR - wrong permissions on /modsec-confs" + exit 1 +fi + +# /modsec-crs-confs +if [ ! -r "/modsec-crs-confs" ] || [ ! -x "/modsec-crs-confs" ] ; then + echo "[!] ERROR - wrong permissions on /modsec-crs-confs" + exit 1 +fi + # /acme-challenge if [ ! -w "/acme-challenge" ] || [ ! -r "/acme-challenge" ] || [ ! -x "/acme-challenge" ] ; then echo "[!] ERROR - wrong permissions on /acme-challenge" - exit 7 + exit 1 fi # /etc/nginx if [ ! -w "/etc/nginx" ] || [ ! -r "/etc/nginx" ] || [ ! -x "/etc/nginx" ] ; then echo "[!] ERROR - wrong permissions on /etc/nginx" - exit 8 + exit 1 fi diff --git a/examples/swarm/stack.yml b/examples/swarm/stack.yml index 1ab04c1..9e5733f 100644 --- a/examples/swarm/stack.yml +++ b/examples/swarm/stack.yml @@ -63,7 +63,7 @@ services: labels: - "bunkerized-nginx.AUTOCONF" - app1: + app1: image: php:fpm-alpine volumes: - /shared/www/app1.example.com:/www