Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions Dockerfiles/test_suite-al2023
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to get this working for a bit but gave up and went with a VM. Al2023 image is minimal and doesn't have all packages needed.

Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# This Dockerfile is a minimal example for a RHEL-based SSG test suite target container.
FROM amazonlinux:2023

ENV AUTH_KEYS=/root/.ssh/authorized_keys

ARG CLIENT_PUBLIC_KEY
ARG ADDITIONAL_PACKAGES

# Install Python so Ansible remediations can work
# Don't clean all, as the test scenario may require package install.
RUN true \
&& dnf install -y openssh-clients openssh-server openscap-scanner tar \
python \
$ADDITIONAL_PACKAGES \
&& true

RUN true \
&& for key_type in rsa ecdsa; do ssh-keygen -N '' -t $key_type -f /etc/ssh/ssh_host_${key_type}_key; done \
&& mkdir -p /root/.ssh \
&& printf "%s\n" "$CLIENT_PUBLIC_KEY" >> "$AUTH_KEYS" \
&& chmod og-rw /root/.ssh "$AUTH_KEYS" \
&& sed -i '/session\s\+required\s\+pam_loginuid.so/d' /etc/pam.d/sshd \
&& true

RUN echo 'PermitRootLogin yes' >> /etc/ssh/sshd_config
Loading
Loading