-
Notifications
You must be signed in to change notification settings - Fork 696
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add UBI8 Dockerfile and use in place of CS8 in Automatus testing
- Loading branch information
Showing
2 changed files
with
26 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# This Dockerfile is a minimal example for a Red Hat UBI 8 Automatus test suite target container. | ||
FROM registry.access.redhat.com/ubi8/ubi:latest | ||
|
||
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 \ | ||
&& yum install -y openssh-clients openssh-server openscap-scanner \ | ||
python39 \ | ||
$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 | ||
|