Skip to content

Commit 8eef734

Browse files
committed
Add UBI8 Dockerfile and use in place of CS8 in Automatus testing
1 parent 6b8f5f2 commit 8eef734

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

.github/workflows/automatus-cs8.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Automatus CS8
1+
name: Automatus UBI8
22
on:
33
pull_request:
44
branches: [ master, 'stabilization*' ]
@@ -92,7 +92,7 @@ jobs:
9292
run: ssh-keygen -N '' -t rsa -f ~/.ssh/id_rsa
9393
- name: Build test suite container
9494
if: ${{ steps.ctf.outputs.CTF_OUTPUT_SIZE != '0' }}
95-
run: podman build --build-arg "CLIENT_PUBLIC_KEY=$(cat ~/.ssh/id_rsa.pub)" -t ssg_test_suite -f test_suite-cs8
95+
run: podman build --build-arg "CLIENT_PUBLIC_KEY=$(cat ~/.ssh/id_rsa.pub)" -t ssg_test_suite -f test_suite-ubi8
9696
working-directory: ./Dockerfiles
9797
- name: Get oscap-ssh
9898
if: ${{ steps.ctf.outputs.CTF_OUTPUT_SIZE != '0' }}

Dockerfiles/test_suite-ubi

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# This Dockerfile is a minimal example for a Red Hat UBI 8 Automatus test suite target container.
2+
FROM registry.access.redhat.com/ubi8/ubi:latest
3+
4+
ENV AUTH_KEYS=/root/.ssh/authorized_keys
5+
6+
ARG CLIENT_PUBLIC_KEY
7+
ARG ADDITIONAL_PACKAGES
8+
9+
# Install Python so Ansible remediations can work
10+
# Don't clean all, as the test scenario may require package install.
11+
RUN true \
12+
&& yum install -y openssh-clients openssh-server openscap-scanner \
13+
python39 \
14+
$ADDITIONAL_PACKAGES \
15+
&& true
16+
17+
RUN true \
18+
&& for key_type in rsa ecdsa; do ssh-keygen -N '' -t $key_type -f /etc/ssh/ssh_host_${key_type}_key; done \
19+
&& mkdir -p /root/.ssh \
20+
&& printf "%s\n" "$CLIENT_PUBLIC_KEY" >> "$AUTH_KEYS" \
21+
&& chmod og-rw /root/.ssh "$AUTH_KEYS" \
22+
&& sed -i '/session\s\+required\s\+pam_loginuid.so/d' /etc/pam.d/sshd \
23+
&& true
24+

0 commit comments

Comments
 (0)