2023-03-24 04:43:52 +01:00
|
|
|
FROM python:3-slim
|
2020-10-20 17:31:50 +02:00
|
|
|
|
|
|
|
WORKDIR /
|
|
|
|
|
2023-09-04 00:07:30 +02:00
|
|
|
# Update the image to remediate any vulnerabilities.
|
2023-10-23 19:51:47 +02:00
|
|
|
RUN apt clean && apt update && apt -y dist-upgrade && apt clean && rm -rf /var/lib/apt/lists/*
|
2023-09-04 00:07:30 +02:00
|
|
|
|
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"]
|