refactor: update file permission commands in Dockerfiles to exclude modsecurity files

This commit is contained in:
Théophile Diot 2024-11-22 12:27:11 +01:00
parent d9068c22de
commit c3354cf27d
No known key found for this signature in database
GPG key ID: FA995104A0BA376A
9 changed files with 17 additions and 22 deletions

View file

@ -61,7 +61,8 @@ RUN cp helpers/bwcli /usr/bin/ && \
for dir in $(echo "pro/plugins configs/http configs/stream configs/server-http configs/server-stream configs/default-server-http configs/default-server-stream configs/modsec configs/modsec-crs configs/crs-plugins-before configs/crs-plugins-after") ; do mkdir "/data/${dir}" ; done && \
chown -R root:autoconf INTEGRATION /data /var/cache/bunkerweb /var/lib/bunkerweb /etc/bunkerweb /var/tmp/bunkerweb /var/run/bunkerweb /var/log/bunkerweb /usr/bin/bwcli && \
chmod -R 770 /data /var/cache/bunkerweb /var/lib/bunkerweb /etc/bunkerweb /var/tmp/bunkerweb /var/run/bunkerweb /var/log/bunkerweb && \
find core/*/bwcli/* -type f -exec chmod 750 {} \; && \
find core/ -type f -name "*.sh" ! -path "core/modsecurity/files/*" -print0 | xargs -0 chmod 750 && \
find core/ -type f -name "*.py" ! -path "core/modsecurity/files/*" -print0 | xargs -0 chmod 750 && \
chmod 750 cli/main.py autoconf/main.py helpers/*.sh deps/python/bin/* /usr/bin/bwcli && \
chmod 660 INTEGRATION

View file

@ -89,9 +89,8 @@ RUN install -m 755 helpers/bwcli /usr/bin/bwcli && \
touch /var/log/bunkerweb/error.log /var/log/bunkerweb/access.log /var/log/bunkerweb/modsec_audit.log && \
chmod 770 /var/cache/bunkerweb/ /var/tmp/bunkerweb/ /var/run/bunkerweb/ && \
chmod 750 gen/*.py scheduler/*.py cli/*.py ui/*.sh helpers/*.sh /var/www/ && \
find ui -name "*.py" -type f -print0 | xargs -0 chmod 750 && \
find core/*/jobs/* -type f -print0 | xargs -0 chmod 750 && \
find core/*/bwcli/* -type f -print0 | xargs -0 chmod 750 && \
find core/ -type f -name "*.sh" ! -path "core/modsecurity/files/*" -print0 | xargs -0 chmod 750 && \
find core/ ui/ -type f -name "*.py" ! -path "core/modsecurity/files/*" -print0 | xargs -0 chmod 750 && \
chmod 755 .
# Compress dependencies

View file

@ -85,9 +85,8 @@ RUN install -m 755 helpers/bwcli /usr/bin/bwcli && \
touch /var/log/bunkerweb/error.log /var/log/bunkerweb/access.log /var/log/bunkerweb/modsec_audit.log && \
chmod 770 /var/cache/bunkerweb/ /var/tmp/bunkerweb/ /var/run/bunkerweb/ && \
chmod 750 gen/*.py scheduler/*.py cli/*.py ui/*.sh helpers/*.sh /var/www/ && \
find ui -name "*.py" -type f -print0 | xargs -0 chmod 750 && \
find core/*/jobs/* -type f -print0 | xargs -0 chmod 750 && \
find core/*/bwcli/* -type f -print0 | xargs -0 chmod 750 && \
find core/ -type f -name "*.sh" ! -path "core/modsecurity/files/*" -print0 | xargs -0 chmod 750 && \
find core/ ui/ -type f -name "*.py" ! -path "core/modsecurity/files/*" -print0 | xargs -0 chmod 750 && \
chmod 755 .
# Compress dependencies

View file

@ -97,9 +97,8 @@ RUN install -m 755 helpers/bwcli /usr/bin/bwcli && \
touch /var/log/bunkerweb/error.log /var/log/bunkerweb/access.log /var/log/bunkerweb/modsec_audit.log && \
chmod 770 /var/cache/bunkerweb/ /var/tmp/bunkerweb/ /var/run/bunkerweb/ && \
chmod 750 gen/*.py scheduler/*.py cli/*.py ui/*.sh helpers/*.sh /var/www/ && \
find ui -name "*.py" -type f -print0 | xargs -0 chmod 750 && \
find core/*/jobs/* -type f -print0 | xargs -0 chmod 750 && \
find core/*/bwcli/* -type f -print0 | xargs -0 chmod 750 && \
find core/ -type f -name "*.sh" ! -path "core/modsecurity/files/*" -print0 | xargs -0 chmod 750 && \
find core/ ui/ -type f -name "*.py" ! -path "core/modsecurity/files/*" -print0 | xargs -0 chmod 750 && \
chmod 755 .
# Compress dependencies

View file

@ -100,9 +100,8 @@ RUN install -m 755 helpers/bwcli /usr/bin/bwcli && \
touch /var/log/bunkerweb/error.log /var/log/bunkerweb/access.log /var/log/bunkerweb/modsec_audit.log && \
chmod 770 /var/cache/bunkerweb/ /var/tmp/bunkerweb/ /var/run/bunkerweb/ && \
chmod 750 gen/*.py scheduler/*.py cli/*.py ui/*.sh helpers/*.sh /var/www/ && \
find ui -name "*.py" -type f -print0 | xargs -0 chmod 750 && \
find core/*/jobs/* -type f -print0 | xargs -0 chmod 750 && \
find core/*/bwcli/* -type f -print0 | xargs -0 chmod 750 && \
find core/ -type f -name "*.sh" ! -path "core/modsecurity/files/*" -print0 | xargs -0 chmod 750 && \
find core/ ui/ -type f -name "*.py" ! -path "core/modsecurity/files/*" -print0 | xargs -0 chmod 750 && \
chmod 755 .
# Compress dependencies

View file

@ -89,9 +89,8 @@ RUN install -m 755 helpers/bwcli /usr/bin/bwcli && \
touch /var/log/bunkerweb/error.log /var/log/bunkerweb/access.log /var/log/bunkerweb/modsec_audit.log && \
chmod 770 /var/cache/bunkerweb/ /var/tmp/bunkerweb/ /var/run/bunkerweb/ && \
chmod 750 gen/*.py scheduler/*.py cli/*.py ui/*.sh helpers/*.sh /var/www/ && \
find ui -name "*.py" -type f -print0 | xargs -0 chmod 750 && \
find core/*/jobs/* -type f -print0 | xargs -0 chmod 750 && \
find core/*/bwcli/* -type f -print0 | xargs -0 chmod 750 && \
find core/ -type f -name "*.sh" ! -path "core/modsecurity/files/*" -print0 | xargs -0 chmod 750 && \
find core/ ui/ -type f -name "*.py" ! -path "core/modsecurity/files/*" -print0 | xargs -0 chmod 750 && \
chmod 755 .
# Compress dependencies

View file

@ -89,9 +89,8 @@ RUN install -m 755 helpers/bwcli /usr/bin/bwcli && \
touch /var/log/bunkerweb/error.log /var/log/bunkerweb/access.log /var/log/bunkerweb/modsec_audit.log && \
chmod 770 /var/cache/bunkerweb/ /var/tmp/bunkerweb/ /var/run/bunkerweb/ && \
chmod 750 gen/*.py scheduler/*.py cli/*.py ui/*.sh helpers/*.sh /var/www/ && \
find ui -name "*.py" -type f -print0 | xargs -0 chmod 750 && \
find core/*/jobs/* -type f -print0 | xargs -0 chmod 750 && \
find core/*/bwcli/* -type f -print0 | xargs -0 chmod 750 && \
find core/ -type f -name "*.sh" ! -path "core/modsecurity/files/*" -print0 | xargs -0 chmod 750 && \
find core/ ui/ -type f -name "*.py" ! -path "core/modsecurity/files/*" -print0 | xargs -0 chmod 750 && \
chmod 755 .
# Compress dependencies

View file

@ -66,8 +66,8 @@ RUN cp helpers/bwcli /usr/bin/ && \
for dir in $(echo "pro/plugins configs/http configs/stream configs/server-http configs/server-stream configs/default-server-http configs/default-server-stream configs/modsec configs/modsec-crs configs/crs-plugins-before configs/crs-plugins-after") ; do mkdir "/data/${dir}" ; done && \
chown -R root:scheduler INTEGRATION /data /etc/nginx /var/cache/bunkerweb /var/lib/bunkerweb /etc/bunkerweb /var/tmp/bunkerweb /var/run/bunkerweb /var/log/bunkerweb /usr/bin/bwcli && \
chmod -R 770 /data /etc/nginx /var/cache/bunkerweb /var/lib/bunkerweb /etc/bunkerweb /var/tmp/bunkerweb /var/run/bunkerweb /var/log/bunkerweb && \
find core/*/jobs/* -type f -exec chmod 750 {} \; && \
find core/*/bwcli/* -type f -exec chmod 750 {} \; && \
find core/ -type f -name "*.sh" ! -path "core/modsecurity/files/*" -print0 | xargs -0 chmod 750 && \
find core/ -type f -name "*.py" ! -path "core/modsecurity/files/*" -print0 | xargs -0 chmod 750 && \
chmod 750 cli/main.py gen/*.py scheduler/main.py scheduler/entrypoint.sh helpers/*.sh deps/python/bin/* /usr/bin/bwcli && \
chmod 660 INTEGRATION

View file

@ -64,7 +64,7 @@ RUN echo "Docker" > INTEGRATION && \
chown -R root:ui INTEGRATION /data /var/cache/bunkerweb /var/lib/bunkerweb /etc/bunkerweb /var/tmp/bunkerweb /var/run/bunkerweb /var/log/bunkerweb && \
chmod -R 770 /data /var/cache/bunkerweb /var/lib/bunkerweb /etc/bunkerweb /var/tmp/bunkerweb /var/run/bunkerweb /var/log/bunkerweb && \
chmod 750 gen/*.py ui/*.sh helpers/*.sh deps/python/bin/* && \
find ui -name "*.py" -type f -exec chmod 750 {} \; && \
find ui/ -type f -name "*.py" -print0 | xargs -0 chmod 750 && \
chmod 660 INTEGRATION && \
ln -s /proc/1/fd/1 /var/log/bunkerweb/ui-access.log && \
ln -s /proc/1/fd/2 /var/log/bunkerweb/ui.log