init
This commit is contained in:
commit
1fd4b9f7c1
3 changed files with 427 additions and 0 deletions
29
Containerfile
Normal file
29
Containerfile
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
# Low-interaction SSH honeypot image (Podman/Docker compatible).
|
||||
FROM python:3.12-slim
|
||||
|
||||
# Don't write .pyc, flush stdout/stderr immediately so `podman logs` is live.
|
||||
ENV PYTHONDONTWRITEBYTECODE=1 \
|
||||
PYTHONUNBUFFERED=1 \
|
||||
HONEYPOT_HOST_KEY=/data/host_key \
|
||||
HONEYPOT_LOG_DIR=/data/logs \
|
||||
HONEYPOT_BIND=0.0.0.0 \
|
||||
HONEYPOT_PORT=2222
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY requirements.txt .
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
COPY ssh_honeypot.py .
|
||||
|
||||
# Run as an unprivileged user. /data is where the host key and logs persist;
|
||||
# mount a volume here so they survive container restarts.
|
||||
RUN useradd --uid 1000 --create-home --shell /usr/sbin/nologin honeypot \
|
||||
&& mkdir -p /data/logs \
|
||||
&& chown -R honeypot:honeypot /data
|
||||
USER honeypot
|
||||
|
||||
VOLUME ["/data"]
|
||||
EXPOSE 2222
|
||||
|
||||
ENTRYPOINT ["python", "ssh_honeypot.py"]
|
||||
Loading…
Add table
Add a link
Reference in a new issue