Sle16 sshd lineinfile related fixes#14458
Open
teacup-on-rockingchair wants to merge 9 commits intoComplianceAsCode:masterfrom
Open
Sle16 sshd lineinfile related fixes#14458teacup-on-rockingchair wants to merge 9 commits intoComplianceAsCode:masterfrom
teacup-on-rockingchair wants to merge 9 commits intoComplianceAsCode:masterfrom
Conversation
…shd config is in /usr subdir Add macros for ansible, bash and oval to check and set sshd config parameters for case where config can be both in /usr and /etc
…nfig in /usr and subfolders
…nd subfolders for sshd_set_idle_timeout rule
…nd subfolders for sshd_set_login_grace_time rule
…nd subfolders for sshd_set_max_auth_tries rule
…nd subfolders for sshd_set_max_sessions rule
…nd subfolders for sshd_set_maxstartups rule
|
This datastream diff is auto generated by the check Click here to see the full diffbash remediation for rule 'xccdf_org.ssgproject.content_rule_sshd_set_keepalive' differs.
--- xccdf_org.ssgproject.content_rule_sshd_set_keepalive
+++ xccdf_org.ssgproject.content_rule_sshd_set_keepalive
@@ -2,7 +2,6 @@
if rpm --quiet -q kernel-core; then
var_sshd_set_keepalive=''
-
if [ -e "/etc/ssh/sshd_config" ] ; then
bash remediation for rule 'xccdf_org.ssgproject.content_rule_sshd_set_idle_timeout' differs.
--- xccdf_org.ssgproject.content_rule_sshd_set_idle_timeout
+++ xccdf_org.ssgproject.content_rule_sshd_set_idle_timeout
@@ -2,7 +2,6 @@
if rpm --quiet -q kernel-core; then
sshd_idle_timeout_value=''
-
if [ -e "/etc/ssh/sshd_config" ] ; then
bash remediation for rule 'xccdf_org.ssgproject.content_rule_sshd_disable_compression' differs.
--- xccdf_org.ssgproject.content_rule_sshd_disable_compression
+++ xccdf_org.ssgproject.content_rule_sshd_disable_compression
@@ -2,7 +2,6 @@
if rpm --quiet -q kernel-core; then
var_sshd_disable_compression=''
-
if [ -e "/etc/ssh/sshd_config" ] ; then
bash remediation for rule 'xccdf_org.ssgproject.content_rule_sshd_set_login_grace_time' differs.
--- xccdf_org.ssgproject.content_rule_sshd_set_login_grace_time
+++ xccdf_org.ssgproject.content_rule_sshd_set_login_grace_time
@@ -2,7 +2,6 @@
if rpm --quiet -q kernel-core; then
var_sshd_set_login_grace_time=''
-
if [ -e "/etc/ssh/sshd_config" ] ; then
bash remediation for rule 'xccdf_org.ssgproject.content_rule_sshd_set_max_auth_tries' differs.
--- xccdf_org.ssgproject.content_rule_sshd_set_max_auth_tries
+++ xccdf_org.ssgproject.content_rule_sshd_set_max_auth_tries
@@ -2,7 +2,6 @@
if rpm --quiet -q kernel-core; then
sshd_max_auth_tries_value=''
-
if [ -e "/etc/ssh/sshd_config" ] ; then
bash remediation for rule 'xccdf_org.ssgproject.content_rule_sshd_set_max_sessions' differs.
--- xccdf_org.ssgproject.content_rule_sshd_set_max_sessions
+++ xccdf_org.ssgproject.content_rule_sshd_set_max_sessions
@@ -2,7 +2,6 @@
if rpm --quiet -q kernel-core; then
var_sshd_max_sessions=''
-
if [ -e "/etc/ssh/sshd_config" ] ; then
bash remediation for rule 'xccdf_org.ssgproject.content_rule_sshd_set_maxstartups' differs.
--- xccdf_org.ssgproject.content_rule_sshd_set_maxstartups
+++ xccdf_org.ssgproject.content_rule_sshd_set_maxstartups
@@ -2,7 +2,6 @@
if rpm --quiet -q kernel-core; then
var_sshd_set_maxstartups=''
-
if [ -e "/etc/ssh/sshd_config" ] ; then
bash remediation for rule 'xccdf_org.ssgproject.content_rule_sshd_use_priv_separation' differs.
--- xccdf_org.ssgproject.content_rule_sshd_use_priv_separation
+++ xccdf_org.ssgproject.content_rule_sshd_use_priv_separation
@@ -2,7 +2,6 @@
if rpm --quiet -q kernel-core && { ( rpm --quiet -q openssh-server && { real="$(epoch=$(rpm -q --queryformat '%{EPOCH}' openssh-server); version=$(rpm -q --queryformat '%{VERSION}' openssh-server); [ "$epoch" = "(none)" ] && echo "0:$version" || echo "$epoch:$version")"; expected="0:7.5"; [[ "$real" != "$expected" ]] && printf "%s\n%s" "$real" "$expected" | sort -VC; } ); }; then
var_sshd_priv_separation=''
-
if [ -e "/etc/ssh/sshd_config" ] ; then
bash remediation for rule 'xccdf_org.ssgproject.content_rule_sshd_use_strong_kex' differs.
--- xccdf_org.ssgproject.content_rule_sshd_use_strong_kex
+++ xccdf_org.ssgproject.content_rule_sshd_use_strong_kex
@@ -2,8 +2,6 @@
if rpm --quiet -q kernel-core; then
sshd_strong_kex=''
-
-
if [ -e "/etc/ssh/sshd_config" ] ; then
|
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.
Description:
Rationale:
General rule for all SSH server configuration changes
/etc/ssh/sshd_configexists: check/etc/ssh/sshd_config, /etc/ssh/sshd_config.d/*.conf, /usr/etc/ssh/sshd_config.d/*.conf/etc/ssh/sshd_configdoes not exists: check/usr/etc/ssh/sshd_config, /etc/ssh/sshd_config.d/*.conf, /usr/etc/ssh/sshd_config.d/*.confRegarding remedations
/usr/etc/ssh/sshd_configto/etc/ssh/sshd_config(if/etc/ssh/sshd_configdoes not exist),configs are added to
/etc/ssh/sshd_config.d/*.conf(1st Include in sshd_config)