-
Notifications
You must be signed in to change notification settings - Fork 19
Preserve ssh keys and resolv.conf #918
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR extends the test harness and container build to preserve the host’s SSH keys and DNS settings by copying them into the build context and including them in the image. Class diagram for updated container file structureclassDiagram
class ContainerImage {
+/var/roothome/.ssh
+/etc/resolv.conf
+/etc/ima/ima-policy
+/usr/lib/bootc/kargs.d/10-ima_kargs.toml
+/etc/yum.repos.d/
}
class Host {
+.ssh
+resolv.conf
}
Host <|-- ContainerImage : "files copied during build"
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey there - I've reviewed your changes and they look great!
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location> `setup/bootc_configure_kernel_ima_module/Containerfile:8` </location>
<code_context>
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 resolv.conf /etc/resolv.conf
ARG KEYLIME_BOOTC_INSTALL_PACKAGES="rsync beakerlib selinux-policy-devel swtpm swtpm-tools nmap keylime expect"
</code_context>
<issue_to_address>
**🚨 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.
</issue_to_address>
### Comment 2
<location> `setup/bootc_configure_kernel_ima_module/Containerfile:9` </location>
<code_context>
COPY ima-policy /etc/ima/ima-policy
COPY yum.repos.d/* /etc/yum.repos.d/
+COPY .ssh /var/roothome/.ssh
+COPY resolv.conf /etc/resolv.conf
ARG KEYLIME_BOOTC_INSTALL_PACKAGES="rsync beakerlib selinux-policy-devel swtpm swtpm-tools nmap keylime expect"
RUN dnf -y install ${KEYLIME_BOOTC_INSTALL_PACKAGES}
</code_context>
<issue_to_address>
**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.
</issue_to_address>
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
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 |
There was a problem hiding this comment.
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 ima-policy /etc/ima/ima-policy | ||
COPY yum.repos.d/* /etc/yum.repos.d/ | ||
COPY .ssh /var/roothome/.ssh | ||
COPY resolv.conf /etc/resolv.conf |
There was a problem hiding this comment.
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.
Summary by Sourcery
Preserve SSH credentials and DNS settings during image build and tests by copying SSH keys and resolv.conf into the build context and container image.
Enhancements: