Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dockerfile for v5 changes, and other misc fixes / enhancements #2948

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
21 changes: 14 additions & 7 deletions Dockerfile
Expand Up @@ -12,7 +12,7 @@ ADD . .
RUN if [ -z "$(ls plugins/stockpile)" ]; then echo "stockpile plugin not downloaded - please ensure you recursively cloned the caldera git repository and try again."; exit 1; fi

RUN apt-get update && \
apt-get -y install python3 python3-pip python3-venv git curl golang-go
apt-get -y install python3 python3-pip python3-venv git curl golang-go upx


#WIN_BUILD is used to enable windows build in sandcat plugin
Expand Down Expand Up @@ -70,9 +70,17 @@ WORKDIR /usr/src/app/plugins/emu

# If emu is enabled, complete necessary installation steps
RUN if [ $(grep -c "\- emu" ../../conf/local.yml) ]; then \
apt-get -y install zlib1g unzip; \
pip3 install -r requirements.txt; \
./download_payloads.sh; \
apt-get -y install zlib1g unzip; \
pip3 install --no-cache-dir -r requirements.txt; \
./download_payloads.sh; \
fi

WORKDIR /usr/src/app/plugins/human

# If human is enabled, complete necessary installation steps
RUN if [ $(grep -c "\- human" ../../conf/local.yml) ]; then \
apt-get -y install xvfb python3-tk python3-dev; \
pip3 install --no-cache-dir -r requirements.txt; \
fi

WORKDIR /usr/src/app
Expand All @@ -83,8 +91,7 @@ RUN apt-get update && \
# Directly use npm to install dependencies and build the application
(cd plugins/magma && npm install) && \
(cd plugins/magma && npm run build) && \
# Remove Node.js, npm, and other unnecessary packages
apt-get remove -y nodejs npm && \
# Remove other unnecessary packages and general cleanup
apt-get autoremove -y && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
Expand Down Expand Up @@ -113,4 +120,4 @@ EXPOSE 8022
# Default FTP port for FTP C2 channel
EXPOSE 2222

ENTRYPOINT ["python3", "server.py"]
ENTRYPOINT ["/usr/src/app/entrypoint.sh"]
10 changes: 10 additions & 0 deletions entrypoint.sh
@@ -0,0 +1,10 @@
#!/bin/bash
# Start Xvfb on display 99
Xvfb :99 -screen 0 1024x768x16 &

# Export DISPLAY variable
export DISPLAY=:99

touch /root/.Xauthority

exec python3 server.py --build
4 changes: 2 additions & 2 deletions requirements.txt
Expand Up @@ -5,7 +5,7 @@ aiohttp-security==0.4.0
aiohttp-apispec==3.0.0b2
jinja2==3.1.3
pyyaml==6.0.1
cryptography==42.0.2
cryptography==42.0.5
websockets==11.0.3
Sphinx==7.1.2
sphinx_rtd_theme==1.3.0
Expand All @@ -20,6 +20,6 @@ rich==13.7.0
svglib==1.5.1 # debrief
Markdown==3.4.4 # training
dnspython==2.4.2
asyncssh==2.14.1
asyncssh==2.14.2
aioftp~=0.20.0
packaging==23.2