Skip to content

Stabilization: Require 0600 for group-owned SSH private keys in the OVAL check - #15057

Merged
Mab879 merged 1 commit into
ComplianceAsCode:stabilizationfrom
ggbecker:fix-ssh-keys-dedicated-group-0600-stabilization
Aug 26, 2026
Merged

Stabilization: Require 0600 for group-owned SSH private keys in the OVAL check#15057
Mab879 merged 1 commit into
ComplianceAsCode:stabilizationfrom
ggbecker:fix-ssh-keys-dedicated-group-0600-stabilization

Conversation

@ggbecker

Copy link
Copy Markdown
Member

Backport of #15056

PR ComplianceAsCode#15015 restricted the 0640 group-readable exception to rhcos4 only,
but that exception is implemented twice in the OVAL check: once for the
root:root file state and once for the root:<dedicated_ssh_keyowner>
state. Only the root:root state was gated to rhcos4; the dedicated-group
state still left group-read "not considered", so keys owned
root:ssh_keys with mode 0640 (the RHEL default) still passed the check
even though the bash and ansible remediations already enforce 0600.

Gate the dedicated-group group-read bit to rhcos4 as well, so all
non-immutable products require 0600 regardless of group ownership,
matching the DISA STIG (SV-230287) and the existing remediations.

Also update the rule description, the puppet remediation (which
hardcoded 0640 for every product), and the test scenarios: the
group-owned pass scenario now uses 0600 and a new
dedicated_group_lenient.fail.sh asserts that a root:<group> key at 0640
is a finding on non-immutable systems.
@ggbecker ggbecker added this to the 0.1.82 milestone Aug 26, 2026
@ggbecker ggbecker added RHEL Red Hat Enterprise Linux product related. STIG STIG Benchmark related. labels Aug 26, 2026
@github-actions

Copy link
Copy Markdown
Contributor

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_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,7 +7,7 @@
 [description]:
 SSH server private keys - files that match the /etc/ssh/*_key glob, have to have restricted permissions.
 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.
+If they are owned by the root user, but by a dedicated group ssh_keys, they still have to have the 0600 permission or stricter.
 
 [warning]:
 Remediation is not possible at bootable container build time because SSH host

puppet remediation for rule 'xccdf_org.ssgproject.content_rule_file_permissions_sshd_private_key' differs.
--- xccdf_org.ssgproject.content_rule_file_permissions_sshd_private_key
+++ xccdf_org.ssgproject.content_rule_file_permissions_sshd_private_key
@@ -1,8 +1,11 @@
+
+
+
 include ssh_private_key_perms
 
 class ssh_private_key_perms {
   exec { 'sshd_priv_key':
-    command => "chmod 0640 /etc/ssh/*_key",
+    command => "chmod 0600 /etc/ssh/*_key",
     path    => '/bin:/usr/bin'
   }
 }

@Mab879 Mab879 self-assigned this Aug 26, 2026
@Mab879
Mab879 merged commit 0572297 into ComplianceAsCode:stabilization Aug 26, 2026
58 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

RHEL Red Hat Enterprise Linux product related. STIG STIG Benchmark related.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants