From 71fdce08d7c38d81bddac04001870d14b05f1125 Mon Sep 17 00:00:00 2001 From: shaohuzhang1 <80892890+shaohuzhang1@users.noreply.github.com> Date: Wed, 21 May 2025 11:45:38 +0800 Subject: [PATCH] build: Sensitive directory permissions (#3120) --- installer/Dockerfile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/installer/Dockerfile b/installer/Dockerfile index 8102bc4d3..986f0d5ee 100644 --- a/installer/Dockerfile +++ b/installer/Dockerfile @@ -66,9 +66,10 @@ RUN chmod 755 /opt/maxkb/app/installer/run-maxkb.sh && \ curl -L --connect-timeout 120 -m 1800 https://resource.fit2cloud.com/maxkb/ffmpeg/get-ffmpeg-linux | sh && \ mkdir -p /opt/maxkb/app/sandbox/python-packages && \ find /opt/maxkb/app -mindepth 1 -not -name 'sandbox' -exec chmod 700 {} + && \ - chmod 755 /tmp && \ - useradd --no-create-home --home /opt/maxkb/app/sandbox sandbox -g root && \ - chown -R sandbox:root /opt/maxkb/app/sandbox && \ + chmod 755 /tmp && chmod 750 /etc &&\ + groupadd sandbox &&\ + useradd --no-create-home --home /opt/maxkb/app/sandbox sandbox -g sandbox && \ + chown -R sandbox:sandbox /opt/maxkb/app/sandbox && \ chmod g-x /usr/local/bin/* /usr/bin/* /bin/* /usr/sbin/* /sbin/* /usr/lib/postgresql/15/bin/* && \ chmod g+x /usr/local/bin/python*