Stabilization: Require 0600 for group-owned SSH private keys in the OVAL check - #15057
Merged
Mab879 merged 1 commit intoAug 26, 2026
Conversation
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
requested review from
Mab879,
jan-cerny,
matusmarhefka and
vojtapolasek
as code owners
August 26, 2026 12:05
Contributor
|
This datastream diff is auto generated by the check Click here to see the full diffNew 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
approved these changes
Aug 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #15056