Skip to content

Commit

Permalink
Add test_suite-ubt22
Browse files Browse the repository at this point in the history
  • Loading branch information
Mab879 committed Jul 2, 2024
1 parent 26a1157 commit 0ab9cc1
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions Dockerfiles/test_suite-ubuntu2204
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 0ab9cc1

Please sign in to comment.