Skip to content
Merged
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
2 changes: 2 additions & 0 deletions setup/bootc_configure_kernel_ima_module/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ RUN mkdir -p /keylime-tests /etc/ima/
COPY 10-ima_kargs.toml /usr/lib/bootc/kargs.d/10-ima_kargs.toml
COPY ima-policy /etc/ima/ima-policy
COPY yum.repos.d/* /etc/yum.repos.d/
COPY .ssh /var/roothome/.ssh
Copy link

Choose a reason for hiding this comment

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

🚨 issue (security): Consider potential security implications of copying SSH keys into the container.

Copying the entire .ssh directory may expose private keys or sensitive files. Only copy required public keys or configuration files, and verify that private keys are excluded and permissions are secure.

COPY resolv.conf /etc/resolv.conf
Copy link

Choose a reason for hiding this comment

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

issue (bug_risk): Overwriting /etc/resolv.conf may interfere with container DNS resolution.

Copying a static resolv.conf may break DNS in environments with dynamic DNS assignment. Please verify this is required and that the file's contents are suitable for all deployment contexts.

ARG KEYLIME_BOOTC_INSTALL_PACKAGES="rsync beakerlib selinux-policy-devel swtpm swtpm-tools nmap keylime expect"
RUN dnf -y install ${KEYLIME_BOOTC_INSTALL_PACKAGES}
RUN sed -i '/tss/ d' /usr/lib/group; ls -ld /etc/keylime /var/lib/keylime; ls -l /etc/keylime /var/lib/keylime; /bin/true
Expand Down
4 changes: 3 additions & 1 deletion setup/bootc_configure_kernel_ima_module/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ rlJournalStart
rlRun "cat > 10-ima_kargs.toml <<EOF
kargs = [\"ima_appraise=${IMA_APPRAISE}, ima_canonical_fmt, ima_policy=${IMA_POLICY}, ima_template=${IMA_TEMPLATE}\"]
EOF"
# copy dnf repos
# copy various data to CWD so we can add them to the image
rlRun "cp -r /root/.ssh ."
rlRun "cp /etc/resolv.conf ."
rlRun "cp -r /etc/yum.repos.d yum.repos.d"
# download bootc image and build and install an update
[ "${KEYLIME_BOOTC_BASE_IMAGE}" == "localhost/bootc:latest" ] && rlRun "bootc image copy-to-storage"
Expand Down