Skip to content

Commit 89d17ad

Browse files
security: minimize permission of sandbox user
1 parent a42848d commit 89d17ad

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

.github/workflows/build-and-push.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
inputs:
88
dockerImageTag:
99
description: 'Docker Image Tag'
10-
default: 'v1.6.0-dev'
10+
default: 'v1.9.0-dev'
1111
required: true
1212
architecture:
1313
description: 'Architecture'

installer/Dockerfile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,14 @@ RUN chmod 755 /opt/maxkb/app/installer/run-maxkb.sh && \
6060
cp -r /opt/maxkb/model/base/hub /opt/maxkb/model/tokenizer && \
6161
cp -f /opt/maxkb/app/installer/run-maxkb.sh /usr/bin/run-maxkb.sh && \
6262
cp -f /opt/maxkb/app/installer/init.sql /docker-entrypoint-initdb.d && \
63+
curl -L --connect-timeout 120 -m 1800 https://resource.fit2cloud.com/maxkb/ffmpeg/get-ffmpeg-linux | sh && \
6364
mkdir -p /opt/maxkb/app/sandbox/python-packages && \
6465
find /opt/maxkb/app -mindepth 1 -not -name 'sandbox' -exec chmod 700 {} + && \
65-
chmod 755 /tmp && \
66-
useradd --no-create-home --home /opt/maxkb/app/sandbox --shell /bin/bash sandbox && \
67-
chown sandbox:sandbox /opt/maxkb/app/sandbox && \
68-
curl -L --connect-timeout 120 -m 1800 https://resource.fit2cloud.com/maxkb/ffmpeg/get-ffmpeg-linux | sh
69-
66+
chmod 755 /tmp && \
67+
useradd --no-create-home --home /opt/maxkb/app/sandbox sandbox -g root && \
68+
chown -R sandbox:root /opt/maxkb/app/sandbox && \
69+
chmod g-x /usr/local/bin/* /usr/bin/* /bin/* /usr/sbin/* /sbin/* /usr/lib/postgresql/15/bin/* && \
70+
chmod g+x /usr/local/bin/python* /bin/sh
7071

7172
EXPOSE 8080
7273

0 commit comments

Comments
 (0)