From 0ab9cc19a42340960db72fbf2b1199851a82c151 Mon Sep 17 00:00:00 2001 From: Matthew Burket Date: Tue, 2 Jul 2024 14:33:11 -0500 Subject: [PATCH] Add test_suite-ubt22 --- Dockerfiles/test_suite-ubuntu2204 | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Dockerfiles/test_suite-ubuntu2204 diff --git a/Dockerfiles/test_suite-ubuntu2204 b/Dockerfiles/test_suite-ubuntu2204 new file mode 100644 index 00000000000..f2380e7e6d2 --- /dev/null +++ b/Dockerfiles/test_suite-ubuntu2204 @@ -0,0 +1,24 @@ +# This Dockerfile is a minimal example for a Ubuntu 22.04 test suite target container. +FROM ubuntu:22.04 + +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 \ + && apt-get update && apt-get install -y openssh-clients openssh-server openscap-scanner \ + python3 \ + $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 +