Skip to content
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

SSH host keys don't exist at bootable container build time #12755

Merged
merged 1 commit into from
Dec 20, 2024

Conversation

matusmarhefka
Copy link
Member

Add warnings to rules configuring SSH host keys permissions and ownership that remediation is not possible at bootable container build time because SSH host keys are generated post-deployment (only once bootable container is booted).

Add warnings to rules configuring SSH host keys permissions and ownership that
remediation is not possible at bootable container build time because SSH host
keys are generated post-deployment (only once bootable container is booted).
@matusmarhefka matusmarhefka added the Image Mode Bootable containers and Image Mode RHEL label Dec 19, 2024
@matusmarhefka matusmarhefka added this to the 0.1.76 milestone Dec 19, 2024
Copy link

Start a new ephemeral environment with changes proposed in this pull request:

rhel8 (from CTF) Environment (using Fedora as testing environment)
Open in Gitpod

Fedora Testing Environment
Open in Gitpod

Oracle Linux 8 Environment
Open in Gitpod

Copy link

This datastream diff is auto generated by the check Compare DS/Generate Diff

Click here to see the full diff
New content has different text for rule 'xccdf_org.ssgproject.content_rule_file_groupownership_sshd_private_key'.
--- xccdf_org.ssgproject.content_rule_file_groupownership_sshd_private_key
+++ xccdf_org.ssgproject.content_rule_file_groupownership_sshd_private_key
@@ -5,6 +5,10 @@
 [description]:
 SSH server private keys, files that match the /etc/ssh/*_key glob, must be
 group-owned by ssh_keys group.
+
+[warning]:
+Remediation is not possible at bootable container build time because SSH host
+keys are generated post-deployment.
 
 [reference]:
 R50

New content has different text for rule 'xccdf_org.ssgproject.content_rule_file_groupownership_sshd_pub_key'.
--- xccdf_org.ssgproject.content_rule_file_groupownership_sshd_pub_key
+++ xccdf_org.ssgproject.content_rule_file_groupownership_sshd_pub_key
@@ -5,6 +5,10 @@
 [description]:
 SSH server public keys, files that match the /etc/ssh/*.pub glob, must be
 group-owned by root group.
+
+[warning]:
+Remediation is not possible at bootable container build time because SSH host
+keys are generated post-deployment.
 
 [reference]:
 R50

New content has different text for rule 'xccdf_org.ssgproject.content_rule_file_ownership_sshd_private_key'.
--- xccdf_org.ssgproject.content_rule_file_ownership_sshd_private_key
+++ xccdf_org.ssgproject.content_rule_file_ownership_sshd_private_key
@@ -5,6 +5,10 @@
 [description]:
 SSH server private keys, files that match the /etc/ssh/*_key glob, must be owned
 by root user.
+
+[warning]:
+Remediation is not possible at bootable container build time because SSH host
+keys are generated post-deployment.
 
 [reference]:
 R50

New content has different text for rule 'xccdf_org.ssgproject.content_rule_file_ownership_sshd_pub_key'.
--- xccdf_org.ssgproject.content_rule_file_ownership_sshd_pub_key
+++ xccdf_org.ssgproject.content_rule_file_ownership_sshd_pub_key
@@ -5,6 +5,10 @@
 [description]:
 SSH server public keys, files that match the /etc/ssh/*.pub glob, must be owned
 by root user.
+
+[warning]:
+Remediation is not possible at bootable container build time because SSH host
+keys are generated post-deployment.
 
 [reference]:
 R50

New content has different text for rule 'xccdf_org.ssgproject.content_rule_file_permissions_sshd_private_key'.
--- xccdf_org.ssgproject.content_rule_file_permissions_sshd_private_key
+++ xccdf_org.ssgproject.content_rule_file_permissions_sshd_private_key
@@ -7,6 +7,10 @@
 If those files are owned by the root user and the root group, they have to have the 0600 permission or stricter.
 If they are owned by the root user, but by a dedicated group ssh_keys, they can have the 0640 permission or stricter.
 
+[warning]:
+Remediation is not possible at bootable container build time because SSH host
+keys are generated post-deployment.
+
 [reference]:
 12
 

New content has different text for rule 'xccdf_org.ssgproject.content_rule_file_permissions_sshd_pub_key'.
--- xccdf_org.ssgproject.content_rule_file_permissions_sshd_pub_key
+++ xccdf_org.ssgproject.content_rule_file_permissions_sshd_pub_key
@@ -4,6 +4,10 @@
 
 [description]:
 To properly set the permissions of /etc/ssh/*.pub, run the command: $ sudo chmod 0644 /etc/ssh/*.pub
+
+[warning]:
+Remediation is not possible at bootable container build time because SSH host
+keys are generated post-deployment.
 
 [reference]:
 12

@jan-cerny jan-cerny self-assigned this Dec 19, 2024
Copy link

codeclimate bot commented Dec 19, 2024

Code Climate has analyzed commit 0709b7c and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (50% is the threshold).

This pull request will bring the total coverage in the repository to 61.6% (0.0% change).

View more on Code Climate.

@jan-cerny jan-cerny merged commit 1dfc279 into ComplianceAsCode:master Dec 20, 2024
105 checks passed
@matusmarhefka matusmarhefka deleted the ssh_host_keys branch December 20, 2024 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Image Mode Bootable containers and Image Mode RHEL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants