Skip to content

Commit b715286

Browse files
feat: add MAXKB_SANDBOX_PYTHON_BANNED_HOSTS env to ban host for sandbox in tools code.
1 parent 9971df1 commit b715286

File tree

3 files changed

+2
-2
lines changed

3 files changed

+2
-2
lines changed

apps/common/utils/tool_code.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ def _exec_sandbox(self, _code, _id):
197197
file.write(_code)
198198
os.system(f"chown {self.user}:root {exec_python_file}")
199199
kwargs = {'cwd': BASE_DIR}
200-
kwargs['env'] = {'LD_PRELOAD': '/opt/maxkb-app/apps/sanbox_ban_host.so'}
200+
kwargs['env'] = {'LD_PRELOAD': '/opt/maxkb-app/apps/sandbox.so'}
201201
subprocess_result = subprocess.run(
202202
['su', '-s', python_directory, '-c', "exec(open('" + exec_python_file + "').read())", self.user],
203203
text=True,

installer/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ RUN apt-get update && \
1313
apt-get clean all && \
1414
rm -rf /var/lib/apt/lists/*
1515
WORKDIR /opt/maxkb-app
16-
RUN gcc -shared -fPIC -o /opt/maxkb-app/apps/sanbox_ban_host.so /opt/maxkb-app/installer/sanbox_ban_host.c -ldl && \
16+
RUN gcc -shared -fPIC -o /opt/maxkb-app/apps/sandbox.so /opt/maxkb-app/installer/sandbox.c -ldl && \
1717
rm -rf /opt/maxkb-app/ui && \
1818
pip install uv --break-system-packages && \
1919
python -m uv pip install -r pyproject.toml && \
File renamed without changes.

0 commit comments

Comments
 (0)