2023-03-24 04:43:52 +01:00
|
|
|
FROM python:3-slim
|
2020-10-20 17:31:50 +02:00
|
|
|
|
|
|
|
WORKDIR /
|
|
|
|
|
2023-03-24 04:43:52 +01:00
|
|
|
# Remove suid & sgid bits from all files.
|
|
|
|
RUN find / -xdev -perm /6000 -exec chmod ug-s {} \; 2> /dev/null || true
|
|
|
|
|
|
|
|
# Copy the ssh-audit code.
|
2020-10-20 17:31:50 +02:00
|
|
|
COPY ssh-audit.py .
|
|
|
|
COPY src/ .
|
|
|
|
|
2023-03-24 04:43:52 +01:00
|
|
|
# Allow listening on 2222/tcp for client auditing.
|
2020-10-20 17:31:50 +02:00
|
|
|
EXPOSE 2222
|
2023-03-24 04:43:52 +01:00
|
|
|
|
|
|
|
# Drop root privileges.
|
|
|
|
USER nobody:nogroup
|
|
|
|
|
|
|
|
ENTRYPOINT ["python3", "/ssh-audit.py"]
|