-
Notifications
You must be signed in to change notification settings - Fork 706
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12551 from Mab879/rhel9_stig_v2r2
Update RHEL 9 STIG to V2R2
- Loading branch information
Showing
17 changed files
with
4,309 additions
and
4,713 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
36 changes: 36 additions & 0 deletions
36
linux_os/guide/services/ssh/file_sshd_50_redhat_exists/rule.yml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
documentation_complete: true | ||
|
||
title: 'The File /etc/ssh/sshd_config.d/50-redhat.conf Must Exist' | ||
|
||
description: |- | ||
The <tt>/etc/ssh/sshd_config.d/50-redhat.conf</tt> file must exist as it contains important | ||
settings to secure SSH. | ||
rationale: |- | ||
The file must exist to configure SSH correctly. | ||
identifiers: | ||
cce@rhel9: CCE-88599-6 | ||
|
||
references: | ||
disa: CCI-001453 | ||
nist: AC-17 (2) | ||
srg: SRG-OS-000250-GPOS-00093 | ||
|
||
severity: medium | ||
|
||
warnings: | ||
- general: | ||
There is no remediation available for this rule since this file | ||
needs to have the correct content for the given system. | ||
|
||
|
||
template: | ||
name: 'file_existence' | ||
vars: | ||
filepath: '/etc/ssh/sshd_config.d/50-redhat.conf' | ||
exists: true | ||
backends: | ||
ansible: off | ||
bash: off |
19 changes: 19 additions & 0 deletions
19
linux_os/guide/services/ssh/ssh_server/sshd_include_crypto_policy/ansible/shared.yml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# platform = multi_platform_all | ||
# complexity = low | ||
# strategy = configure | ||
# disruption = low | ||
# reboot = false | ||
|
||
- name: "{{{ rule_title }}} - Ensure That Drop In SSH Config Files are Included" | ||
ansible.builtin.lineinfile: | ||
path: "/etc/ssh/sshd_config" | ||
line: "Include /etc/ssh/sshd_config.d/*.conf" | ||
regexp: "^Include /etc/ssh/sshd_config.d/\\*.conf" | ||
state: present | ||
|
||
- name: "{{{ rule_title }}} - Ensure That System Crypto Policies are Included" | ||
ansible.builtin.lineinfile: | ||
path: "/etc/ssh/ssh_config.d/50-redhat.conf" | ||
regexp: "Include /etc/crypto-policies/back-ends/opensshserver.config" | ||
line: "Include /etc/crypto-policies/back-ends/opensshserver.config" | ||
state: present |
4 changes: 4 additions & 0 deletions
4
linux_os/guide/services/ssh/ssh_server/sshd_include_crypto_policy/bash/shared.sh
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# platform = multi_platform_all | ||
|
||
echo "Include /etc/ssh/sshd_config.d/*.conf" >> /etc/ssh/sshd_config | ||
echo "Include /etc/crypto-policies/back-ends/opensshserver.config" >> /etc/ssh/ssh_config.d/50-redhat.conf |
32 changes: 32 additions & 0 deletions
32
linux_os/guide/services/ssh/ssh_server/sshd_include_crypto_policy/oval/shared.xml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<def-group> | ||
<definition class="compliance" id="{{{ rule_id }}}" version="1"> | ||
{{{ oval_metadata("Ensure SSHD to include the system crypto policy") }}} | ||
<criteria> | ||
<criterion test_ref="test_{{{ rule_id }}}_include_sshd_drop_in"></criterion> | ||
<criterion test_ref="test_{{{ rule_id }}}_include_sshd_include_system_crypto"></criterion> | ||
</criteria> | ||
</definition> | ||
|
||
<ind:textfilecontent54_test id="test_{{{ rule_id }}}_include_sshd_drop_in" | ||
comment="Ensure that drop in config files are included" version="1" check="all"> | ||
<ind:object object_ref="obj_{{{ rule_id }}}_include_sshd_drop_in"/> | ||
</ind:textfilecontent54_test> | ||
|
||
<ind:textfilecontent54_object id="obj_{{{ rule_id }}}_include_sshd_drop_in" version="1"> | ||
<ind:filepath operation="pattern match">/etc/ssh/sshd_config</ind:filepath> | ||
<ind:pattern operation="pattern match">^Include /etc/ssh/sshd_config.d/\*.conf$</ind:pattern> | ||
<ind:instance operation="greater than or equal" datatype="int">1</ind:instance> | ||
</ind:textfilecontent54_object> | ||
|
||
|
||
<ind:textfilecontent54_test id="test_{{{ rule_id }}}_include_sshd_include_system_crypto" | ||
comment="Ensure that drop in config files are included" version="1" check="all"> | ||
<ind:object object_ref="obj_{{{ rule_id }}}_include_sshd_drop_in"/> | ||
</ind:textfilecontent54_test> | ||
|
||
<ind:textfilecontent54_object id="obj_{{{ rule_id }}}_include_sshd_include_system_crypto" version="1"> | ||
<ind:filepath operation="pattern match">/etc/ssh/sshd_config</ind:filepath> | ||
<ind:pattern operation="pattern match">^Include /etc/crypto-policies/back-ends/opensshserver\.config</ind:pattern> | ||
<ind:instance operation="greater than or equal" datatype="int">1</ind:instance> | ||
</ind:textfilecontent54_object> | ||
</def-group> |
20 changes: 20 additions & 0 deletions
20
linux_os/guide/services/ssh/ssh_server/sshd_include_crypto_policy/rule.yml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
documentation_complete: true | ||
|
||
title: 'SSHD Must Include System Crypto Policy Config File' | ||
|
||
description: |- | ||
SSHD should follow the system cryptographic policy. | ||
In order to accomplish this the SSHD configuration should include the system | ||
rationale: |- | ||
Without cryptographic integrity protections, information can be altered by unauthorized users without detection. | ||
severity: medium | ||
|
||
identifiers: | ||
cce@rhel9: CCE-90566-1 | ||
|
||
references: | ||
disa: CCI-001453 | ||
nist: AC-17 (2) | ||
srg: SRG-OS-000250-GPOS-00093 |
9 changes: 9 additions & 0 deletions
9
linux_os/guide/services/ssh/ssh_server/sshd_include_crypto_policy/tests/default_pass.pass.sh
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
|
||
if [ grep -q "Include /etc/crypto-policies/back-ends/opensshserver.config" /etc/ssh/ssh_config.d/*.conf /etc/ssh/sshd_config -ne 0 ]; then | ||
echo "Include /etc/crypto-policies/back-ends/opensshserver.config" >> /etc/ssh/ssh_config.d/50-redhat.conf | ||
fi | ||
|
||
if [ grep -q "Include /etc/ssh/sshd_config.d/*.conf" /etc/ssh/sshd_config -ne 0 ]; then | ||
echo "Include /etc/ssh/sshd_config.d/*.conf" >> /etc/ssh/ssh_config | ||
fi |
7 changes: 7 additions & 0 deletions
7
linux_os/guide/services/ssh/ssh_server/sshd_include_crypto_policy/tests/no_crypto.fail.sh
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
sed -i '/Include/d' /etc/ssh/sshd_config | ||
|
||
if [ grep -q "Include /etc/ssh/sshd_config.d/*.conf" /etc/ssh/sshd_config -ne 0 ]; then | ||
echo "Include /etc/ssh/sshd_config.d/*.conf" >> /etc/ssh/ssh_config.d/50-redhat.conf | ||
fi |
7 changes: 7 additions & 0 deletions
7
linux_os/guide/services/ssh/ssh_server/sshd_include_crypto_policy/tests/no_drop_in.fail.sh
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
sed -i '/Include/d' /etc/ssh/sshd_config | ||
|
||
if [ grep -q "Include /etc/ssh/sshd_config.d/*.conf" /etc/ssh/sshd_config -ne 0 ]; then | ||
echo "Include /etc/ssh/sshd_config.d/*.conf" >> /etc/ssh/ssh_config | ||
fi |
3 changes: 3 additions & 0 deletions
3
linux_os/guide/services/ssh/ssh_server/sshd_include_crypto_policy/tests/no_includes.fail.sh
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
|
||
sed -i '/Include/d' /etc/ssh/sshd_config |
This file contains 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
Oops, something went wrong.