forked from ComplianceAsCode/content
-
Notifications
You must be signed in to change notification settings - Fork 0
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 ComplianceAsCode#13028 from evgenyz/fix-sshd_inclu…
…de_crypto_policy Rule: sshd_include_crypto_policy, drop remediations, improve OVAL
- Loading branch information
Showing
10 changed files
with
40 additions
and
53 deletions.
There are no files selected for viewing
12 changes: 0 additions & 12 deletions
12
linux_os/guide/services/ssh/ssh_server/sshd_include_crypto_policy/ansible/shared.yml
This file was deleted.
Oops, something went wrong.
5 changes: 0 additions & 5 deletions
5
linux_os/guide/services/ssh/ssh_server/sshd_include_crypto_policy/bash/shared.sh
This file was deleted.
Oops, something went wrong.
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
10 changes: 10 additions & 0 deletions
10
linux_os/guide/services/ssh/ssh_server/sshd_include_crypto_policy/tests/confing.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,10 @@ | ||
#!/bin/bash | ||
# remediation = none | ||
# platform = multi_platform_all | ||
|
||
sed -i '/Include \/etc\/crypto-policies\/back-ends\/opensshserver.config/d' /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*.conf | ||
echo "Include /etc/crypto-policies/back-ends/opensshserver.config" >> /etc/ssh/sshd_config | ||
|
||
if ! grep -q "Include /etc/ssh/sshd_config.d/*.conf" /etc/ssh/sshd_config; then | ||
echo "Include /etc/ssh/sshd_config.d/*.conf" >> /etc/ssh/sshd_config | ||
fi |
9 changes: 0 additions & 9 deletions
9
linux_os/guide/services/ssh/ssh_server/sshd_include_crypto_policy/tests/default_pass.pass.sh
This file was deleted.
Oops, something went wrong.
10 changes: 10 additions & 0 deletions
10
linux_os/guide/services/ssh/ssh_server/sshd_include_crypto_policy/tests/drop_in.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,10 @@ | ||
#!/bin/bash | ||
# remediation = none | ||
# platform = multi_platform_all | ||
|
||
sed -i '/Include \/etc\/crypto-policies\/back-ends\/opensshserver.config/d' /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*.conf | ||
echo "Include /etc/crypto-policies/back-ends/opensshserver.config" >> /etc/ssh/sshd_config.d/50-redhat.conf | ||
|
||
if ! grep -q "Include /etc/ssh/sshd_config.d/*.conf" /etc/ssh/sshd_config; then | ||
echo "Include /etc/ssh/sshd_config.d/*.conf" >> /etc/ssh/sshd_config | ||
fi |
11 changes: 4 additions & 7 deletions
11
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 |
---|---|---|
@@ -1,12 +1,9 @@ | ||
#!/bin/bash | ||
# remediation = none | ||
# platform = multi_platform_all | ||
|
||
# this is done because the remediation will reset the /etc/ssh/sshd_config file | ||
# which is modified by Automatus so that root can log in. | ||
# This prevents Automatus from logging in for final scan. | ||
echo "PermitRootLogin yes" > /etc/ssh/sshd_config.d/99-automatus.conf | ||
|
||
sed -i '/Include/d' /etc/ssh/sshd_config | ||
sed -i '/Include \/etc\/crypto-policies\/back-ends\/opensshserver.config/d' /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*.conf | ||
|
||
if ! grep -q "Include /etc/ssh/sshd_config.d/*.conf" /etc/ssh/sshd_config; then | ||
echo "Include /etc/ssh/sshd_config.d/*.conf" >> /etc/ssh/ssh_config.d/50-redhat.conf | ||
echo "Include /etc/ssh/sshd_config.d/*.conf" >> /etc/ssh/sshd_config | ||
fi |
11 changes: 4 additions & 7 deletions
11
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 |
---|---|---|
@@ -1,12 +1,9 @@ | ||
#!/bin/bash | ||
|
||
# this is done because the remediation will reset the /etc/ssh/sshd_config file | ||
# which is modified by Automatus so that root can log in. | ||
# This prevents Automatus from logging in for final scan. | ||
echo "PermitRootLogin yes" > /etc/ssh/sshd_config.d/99-automatus.conf | ||
# remediation = none | ||
# platform = multi_platform_all | ||
|
||
sed -i '/Include/d' /etc/ssh/sshd_config | ||
|
||
if ! grep -q "Include /etc/ssh/sshd_config.d/*.conf" /etc/ssh/sshd_config; then | ||
echo "Include /etc/ssh/sshd_config.d/*.conf" >> /etc/ssh/ssh_config | ||
if ! grep -q "Include /etc/crypto-policies/back-ends/opensshserver.config" /etc/ssh/sshd_config.d/*.conf /etc/ssh/sshd_config; then | ||
echo "Include /etc/crypto-policies/back-ends/opensshserver.config" >> /etc/ssh/sshd_config.d/50-redhat.conf | ||
fi |
9 changes: 3 additions & 6 deletions
9
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 |
---|---|---|
@@ -1,8 +1,5 @@ | ||
#!/bin/bash | ||
# remediation = none | ||
# platform = multi_platform_all | ||
|
||
# this is done because the remediation will reset the /etc/ssh/sshd_config file | ||
# which is modified by Automatus so that root can log in. | ||
# This prevents Automatus from logging in for final scan. | ||
echo "PermitRootLogin yes" > /etc/ssh/sshd_config.d/99-automatus.conf | ||
|
||
sed -i '/Include/d' /etc/ssh/sshd_config | ||
sed -i '/Include/d' /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*.conf |