Blame SOURCES/scap-security-guide-0.1.51-parametrize-ssh-PR5788.patch

475544
From 604f70aa2d0cce64aed5d699178394523969ba37 Mon Sep 17 00:00:00 2001
475544
From: Vojtech Polasek <vpolasek@redhat.com>
475544
Date: Wed, 27 May 2020 14:34:50 +0200
475544
Subject: [PATCH 01/11] add rule, variables, check, remediations
475544
475544
---
475544
 .../ssh_client_rekey_limit/ansible/shared.yml |  8 ++++
475544
 .../ssh_client_rekey_limit/bash/shared.sh     |  8 ++++
475544
 .../ssh_client_rekey_limit/oval/shared.xml    | 39 +++++++++++++++++++
475544
 .../crypto/ssh_client_rekey_limit/rule.yml    | 34 ++++++++++++++++
475544
 .../var_ssh_client_rekey_limit_size.var       | 15 +++++++
475544
 .../var_ssh_client_rekey_limit_time.var       | 14 +++++++
475544
 shared/references/cce-redhat-avail.txt        |  1 -
475544
 7 files changed, 118 insertions(+), 1 deletion(-)
475544
 create mode 100644 linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/ansible/shared.yml
475544
 create mode 100644 linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/bash/shared.sh
475544
 create mode 100644 linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/oval/shared.xml
475544
 create mode 100644 linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/rule.yml
475544
 create mode 100644 linux_os/guide/system/software/integrity/crypto/var_ssh_client_rekey_limit_size.var
475544
 create mode 100644 linux_os/guide/system/software/integrity/crypto/var_ssh_client_rekey_limit_time.var
475544
475544
diff --git a/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/ansible/shared.yml b/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/ansible/shared.yml
475544
new file mode 100644
475544
index 0000000000..6d2bcbbd44
475544
--- /dev/null
475544
+++ b/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/ansible/shared.yml
475544
@@ -0,0 +1,8 @@
475544
+# platform = multi_platform_all                                                                                                                                                                                                                                                                                        [0/453]
475544
+# reboot = false
475544
+# strategy = configure
475544
+# complexity = low
475544
+# disruption = low
475544
+{{{ ansible_instantiate_variables("var_ssh_client_rekey_limit_size", "var_ssh_client_rekey_limit_time") }}}
475544
+
475544
+{{{ ansible_lineinfile(msg='Ensure that rekey limit is set to {{ var_ssh_client_rekey_limit_size }} {{ var_ssh_client_rekey_limit_time }} in /etc/ssh/ssh_config.d/02-rekey-limit.conf', path='/etc/ssh/ssh_config.d/02-rekey-limit.conf', regex='^\s*RekeyLimit.*$', new_line='RekeyLimit {{ var_ssh_client_rekey_limit_size }} {{ var_ssh_client_rekey_limit_time }}', create='yes', state='present') }}}
475544
diff --git a/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/bash/shared.sh b/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/bash/shared.sh
475544
new file mode 100644
475544
index 0000000000..43d0971ffc
475544
--- /dev/null
475544
+++ b/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/bash/shared.sh
475544
@@ -0,0 +1,8 @@
475544
+# platform = multi_platform_all
475544
+
475544
+# Include source function library.
475544
+. /usr/share/scap-security-guide/remediation_functions
475544
+
475544
+{{{ bash_instantiate_variables("var_ssh_client_rekey_limit_size", "var_ssh_client_rekey_limit_time") }}}
475544
+
475544
+{{{ set_config_file(path="/etc/ssh/ssh_config.d/02-rekey-limit.conf", parameter="RekeyLimit", value='$var_ssh_client_rekey_limit_size $var_ssh_client_rekey_limit_time', create=true, insert_before="", insert_after="", insensitive=false, separator=" ", separator_regex="\s\+", prefix_regex="^\s*") }}}
475544
diff --git a/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/oval/shared.xml b/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/oval/shared.xml
475544
new file mode 100644
475544
index 0000000000..2412763e3f
475544
--- /dev/null
475544
+++ b/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/oval/shared.xml
475544
@@ -0,0 +1,39 @@
475544
+{{% set filepath = "/etc/ssh/ssh_config.d/02-rekey-limit.conf" -%}}
475544
+
475544
+
475544
+<def-group>
475544
+  <definition class="compliance" id="{{{ rule_id }}}" version="1">
475544
+    <metadata>
475544
+      <title>{{{ rule_title }}}</title>
475544
+      {{{- oval_affected(products) }}}
475544
+      <description>Ensure 'RekeyLimit' is configured with the correct value in '{{{ filepath }}}'</description>
475544
+    </metadata>
475544
+    <criteria comment="RekeyLimit is correctly configured for ssh client">
475544
+      {{{- oval_line_in_file_criterion(filepath, "RekeyLimit") }}}
475544
+    </criteria>
475544
+  </definition>
475544
+
475544
+  <ind:textfilecontent54_test check="all" check_existence="all_exist" comment="tests the value of RekeyLimit setting in the  file" id="test_ssh_client_rekey_limit" version="1">
475544
+     <ind:object object_ref="obj_ssh_client_rekey_limit"/>
475544
+  </ind:textfilecontent54_test>
475544
+
475544
+  <ind:textfilecontent54_object id="obj_ssh_client_rekey_limit" version="1">
475544
+     <ind:filepath>{{{ filepath }}}</ind:filepath>
475544
+     <ind:pattern var_ref="ssh_client_line_regex" operation="pattern match"></ind:pattern>
475544
+     <ind:instance datatype="int" operation="greater than or equal">1</ind:instance>
475544
+  </ind:textfilecontent54_object>
475544
+
475544
+  <local_variable id="ssh_client_line_regex" datatype="string" comment="The regex of the directive" version="1">
475544
+    <concat>
475544
+      <literal_component>^[\s]*RekeyLimit[\s]+</literal_component>
475544
+      <variable_component var_ref="var_ssh_client_rekey_limit_size"/>
475544
+      <literal_component>[\s]+</literal_component>
475544
+      <variable_component var_ref="var_ssh_client_rekey_limit_time"/>
475544
+      <literal_component>[\s]*$</literal_component>
475544
+    </concat>
475544
+  </local_variable>
475544
+
475544
+  <external_variable comment="Size component of the rekey limit" datatype="string" id="var_ssh_client_rekey_limit_size" version="1" />
475544
+  <external_variable comment="Time component of the rekey limit" datatype="string" id="var_ssh_client_rekey_limit_time" version="1" />
475544
+</def-group>
475544
+
475544
diff --git a/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/rule.yml b/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/rule.yml
475544
new file mode 100644
475544
index 0000000000..a1b85b0ee5
475544
--- /dev/null
475544
+++ b/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/rule.yml
475544
@@ -0,0 +1,34 @@
475544
+documentation_complete: true
475544
+
475544
+prodtype: rhel8
475544
+
475544
+title: 'Configure session renegotiation for SSH client'
475544
+
475544
+description: |-
475544
+    The <tt>RekeyLimit</tt> parameter specifies how often
475544
+    the session key is renegotiated, both in terms of
475544
+    amount of data that may be transmitted and the time
475544
+    elapsed. To decrease the default limits, put line
475544
+    <tt>RekeyLimit {{{ sub_var_value("var_ssh_client_rekey_limit_size") }}} {{{ sub_var_value("var_ssh_client_rekey_limit_time") }}}</tt> to file <tt>/etc/ssh/ssh_config.d/02-rekey-limit.conf</tt>.
475544
+
475544
+rationale: |-
475544
+    By decreasing the limit based on the amount of data and enabling
475544
+    time-based limit, effects of potential attacks against
475544
+    encryption keys are limited.
475544
+
475544
+severity: medium
475544
+
475544
+identifiers:
475544
+    cce@rhel8: 82880-6
475544
+
475544
+references:
475544
+    ospp: FCS_SSHS_EXT.1
475544
+
475544
+ocil_clause: 'it is commented out or is not set'
475544
+
475544
+ocil: |-
475544
+    To check if RekeyLimit is set correctly, run the
475544
+    following command:
475544
+    
$ sudo grep RekeyLimit /etc/ssh/ssh_config.d/02-rekey-limit.conf
475544
+    If configured properly, output should be
475544
+    
RekeyLimit {{{ sub_var_value("var_ssh_client_rekey_limit_size") }}} {{{ sub_var_value("var_ssh_client_rekey_limit_time") }}}
475544
diff --git a/linux_os/guide/system/software/integrity/crypto/var_ssh_client_rekey_limit_size.var b/linux_os/guide/system/software/integrity/crypto/var_ssh_client_rekey_limit_size.var
475544
new file mode 100644
475544
index 0000000000..bcf051fd97
475544
--- /dev/null
475544
+++ b/linux_os/guide/system/software/integrity/crypto/var_ssh_client_rekey_limit_size.var
475544
@@ -0,0 +1,15 @@
475544
+documentation_complete: true
475544
+
475544
+title: 'SSH client RekeyLimit - size'
475544
+
475544
+description: 'Specify the size component of the rekey limit.'
475544
+
475544
+type: string
475544
+
475544
+operator: equals
475544
+
475544
+options:
475544
+    ssh_client_default: "default"
475544
+    default: "512M"
475544
+    "512M": "512M"
475544
+    "1G": "1G"
475544
diff --git a/linux_os/guide/system/software/integrity/crypto/var_ssh_client_rekey_limit_time.var b/linux_os/guide/system/software/integrity/crypto/var_ssh_client_rekey_limit_time.var
475544
new file mode 100644
475544
index 0000000000..31c76f9ab5
475544
--- /dev/null
475544
+++ b/linux_os/guide/system/software/integrity/crypto/var_ssh_client_rekey_limit_time.var
475544
@@ -0,0 +1,14 @@
475544
+documentation_complete: true
475544
+
475544
+title: 'SSH client RekeyLimit - size'
475544
+
475544
+description: 'Specify the size component of the rekey limit.'
475544
+
475544
+type: string
475544
+
475544
+operator: equals
475544
+
475544
+options:
475544
+    ssh_client_default: "none"
475544
+    default: "1h"
475544
+    "1hour": "1h"
475544
diff --git a/shared/references/cce-redhat-avail.txt b/shared/references/cce-redhat-avail.txt
475544
index 45d03a2c1d..e060d2fb1c 100644
475544
--- a/shared/references/cce-redhat-avail.txt
475544
+++ b/shared/references/cce-redhat-avail.txt
475544
@@ -1,4 +1,3 @@
475544
-CCE-82880-6
475544
 CCE-82882-2
475544
 CCE-82883-0
475544
 CCE-82888-9
475544
475544
From a0d54462b9a1e65de3598d7fc262f61a8e3a06ea Mon Sep 17 00:00:00 2001
475544
From: Vojtech Polasek <vpolasek@redhat.com>
475544
Date: Wed, 27 May 2020 14:35:24 +0200
475544
Subject: [PATCH 02/11] add tests
475544
475544
---
475544
 .../crypto/ssh_client_rekey_limit/tests/bad_size.fail.sh      | 4 ++++
475544
 .../crypto/ssh_client_rekey_limit/tests/bad_time.fail.sh      | 4 ++++
475544
 .../crypto/ssh_client_rekey_limit/tests/no_line.fail.sh       | 3 +++
475544
 .../integrity/crypto/ssh_client_rekey_limit/tests/ok.pass.sh  | 4 ++++
475544
 4 files changed, 15 insertions(+)
475544
 create mode 100644 linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/tests/bad_size.fail.sh
475544
 create mode 100644 linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/tests/bad_time.fail.sh
475544
 create mode 100644 linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/tests/no_line.fail.sh
475544
 create mode 100644 linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/tests/ok.pass.sh
475544
475544
diff --git a/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/tests/bad_size.fail.sh b/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/tests/bad_size.fail.sh
475544
new file mode 100644
475544
index 0000000000..2ac0bbf350
475544
--- /dev/null
475544
+++ b/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/tests/bad_size.fail.sh
475544
@@ -0,0 +1,4 @@
475544
+# platform = multi_platform_all
475544
+
475544
+sed -e '/RekeyLimit/d' /etc/ssh/sshd_config
475544
+echo "RekeyLimit 812M 1h" >> /etc/ssh/sshd_config
475544
diff --git a/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/tests/bad_time.fail.sh b/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/tests/bad_time.fail.sh
475544
new file mode 100644
475544
index 0000000000..fec859fe05
475544
--- /dev/null
475544
+++ b/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/tests/bad_time.fail.sh
475544
@@ -0,0 +1,4 @@
475544
+# platform = multi_platform_all
475544
+
475544
+sed -e '/RekeyLimit/d' /etc/ssh/sshd_config
475544
+echo "RekeyLimit 512M 2h" >> /etc/ssh/sshd_config
475544
diff --git a/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/tests/no_line.fail.sh b/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/tests/no_line.fail.sh
475544
new file mode 100644
475544
index 0000000000..a6cd10163f
475544
--- /dev/null
475544
+++ b/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/tests/no_line.fail.sh
475544
@@ -0,0 +1,3 @@
475544
+# platform = multi_platform_all
475544
+
475544
+sed -e '/RekeyLimit/d' /etc/ssh/sshd_config
475544
diff --git a/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/tests/ok.pass.sh b/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/tests/ok.pass.sh
475544
new file mode 100644
475544
index 0000000000..a6a2ba7adf
475544
--- /dev/null
475544
+++ b/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/tests/ok.pass.sh
475544
@@ -0,0 +1,4 @@
475544
+# platform = multi_platform_all
475544
+
475544
+sed -e '/RekeyLimit/d' /etc/ssh/sshd_config
475544
+echo "RekeyLimit 512M 1h" >> /etc/ssh/sshd_config
475544
475544
From 6ce9e9d55eab07f1c2a3a8d0b28f104d0b5992da Mon Sep 17 00:00:00 2001
475544
From: Vojtech Polasek <vpolasek@redhat.com>
475544
Date: Wed, 27 May 2020 14:35:43 +0200
475544
Subject: [PATCH 03/11] add rule to rhel8 ospp, update stable profiles
475544
475544
---
475544
 rhel8/profiles/ospp.profile                     | 5 +++++
475544
 tests/data/profile_stability/rhel8/ospp.profile | 3 +++
475544
 tests/data/profile_stability/rhel8/stig.profile | 3 +++
475544
 3 files changed, 11 insertions(+)
475544
475544
diff --git a/rhel8/profiles/ospp.profile b/rhel8/profiles/ospp.profile
475544
index 0dca8350f9..07d32b814d 100644
475544
--- a/rhel8/profiles/ospp.profile
475544
+++ b/rhel8/profiles/ospp.profile
475544
@@ -410,3 +410,8 @@ selections:
475544
 
475544
     # Prevent Kerberos use by system daemons
475544
     - kerberos_disable_no_keytab
475544
+
475544
+    # set ssh client rekey limit
475544
+    - ssh_client_rekey_limit
475544
+    - var_ssh_client_rekey_limit_size=1G
475544
+    - var_ssh_client_rekey_limit_time=1hour
475544
diff --git a/tests/data/profile_stability/rhel8/ospp.profile b/tests/data/profile_stability/rhel8/ospp.profile
475544
index 25f7922bf3..b0d7672c36 100644
475544
--- a/tests/data/profile_stability/rhel8/ospp.profile
475544
+++ b/tests/data/profile_stability/rhel8/ospp.profile
475544
@@ -240,4 +240,7 @@ selections:
475544
 - grub2_vsyscall_argument.severity=info
475544
 - sysctl_user_max_user_namespaces.role=unscored
475544
 - sysctl_user_max_user_namespaces.severity=info
475544
+- ssh_client_rekey_limit
475544
+- var_ssh_client_rekey_limit_size=1G
475544
+- var_ssh_client_rekey_limit_time=1hour
475544
 title: Protection Profile for General Purpose Operating Systems
475544
diff --git a/tests/data/profile_stability/rhel8/stig.profile b/tests/data/profile_stability/rhel8/stig.profile
475544
index 6c4270925f..330ecc7e1e 100644
475544
--- a/tests/data/profile_stability/rhel8/stig.profile
475544
+++ b/tests/data/profile_stability/rhel8/stig.profile
475544
@@ -269,4 +269,7 @@ selections:
475544
 - grub2_vsyscall_argument.severity=info
475544
 - sysctl_user_max_user_namespaces.role=unscored
475544
 - sysctl_user_max_user_namespaces.severity=info
475544
+- ssh_client_rekey_limit
475544
+- var_ssh_client_rekey_limit_size=1G
475544
+- var_ssh_client_rekey_limit_time=1hour
475544
 title: '[DRAFT] DISA STIG for Red Hat Enterprise Linux 8'
475544
475544
From 763a79e337eecb24c640d1ac189edf02d20e53ad Mon Sep 17 00:00:00 2001
475544
From: Vojtech Polasek <vpolasek@redhat.com>
475544
Date: Thu, 28 May 2020 14:25:41 +0200
475544
Subject: [PATCH 04/11] improve description of variables
475544
475544
---
475544
 .../crypto/var_ssh_client_rekey_limit_size.var       | 10 ++++++++--
475544
 .../crypto/var_ssh_client_rekey_limit_time.var       | 12 +++++++++---
475544
 2 files changed, 17 insertions(+), 5 deletions(-)
475544
475544
diff --git a/linux_os/guide/system/software/integrity/crypto/var_ssh_client_rekey_limit_size.var b/linux_os/guide/system/software/integrity/crypto/var_ssh_client_rekey_limit_size.var
475544
index bcf051fd97..4e20104cba 100644
475544
--- a/linux_os/guide/system/software/integrity/crypto/var_ssh_client_rekey_limit_size.var
475544
+++ b/linux_os/guide/system/software/integrity/crypto/var_ssh_client_rekey_limit_size.var
475544
@@ -2,14 +2,20 @@ documentation_complete: true
475544
 
475544
 title: 'SSH client RekeyLimit - size'
475544
 
475544
-description: 'Specify the size component of the rekey limit.'
475544
+description: |-
475544
+    Specify the size component of the rekey limit. This limit signifies amount
475544
+    of data. After this amount of data is transferred through the connection,
475544
+    the session key is renegotiated. The number is followed by K, M or G for
475544
+    kilobytes, megabytes or gigabytes. Note that the RekeyLimit can be also
475544
+    configured according to ellabsed time.
475544
+
475544
+interactive: true
475544
 
475544
 type: string
475544
 
475544
 operator: equals
475544
 
475544
 options:
475544
-    ssh_client_default: "default"
475544
     default: "512M"
475544
     "512M": "512M"
475544
     "1G": "1G"
475544
diff --git a/linux_os/guide/system/software/integrity/crypto/var_ssh_client_rekey_limit_time.var b/linux_os/guide/system/software/integrity/crypto/var_ssh_client_rekey_limit_time.var
475544
index 31c76f9ab5..6143a5448c 100644
475544
--- a/linux_os/guide/system/software/integrity/crypto/var_ssh_client_rekey_limit_time.var
475544
+++ b/linux_os/guide/system/software/integrity/crypto/var_ssh_client_rekey_limit_time.var
475544
@@ -1,14 +1,20 @@
475544
 documentation_complete: true
475544
 
475544
-title: 'SSH client RekeyLimit - size'
475544
+title: 'SSH client RekeyLimit - time'
475544
 
475544
-description: 'Specify the size component of the rekey limit.'
475544
+description: |-
475544
+    Specify the time component of the rekey limit. This limit signifies amount
475544
+    of data. The session key is renegotiated after the defined amount of time
475544
+    passes. The number is followed by units such as H or M for hours or minutes.
475544
+    Note that the RekeyLimit can be also configured according to amount of
475544
+    transfered data.
475544
+
475544
+interactive: true
475544
 
475544
 type: string
475544
 
475544
 operator: equals
475544
 
475544
 options:
475544
-    ssh_client_default: "none"
475544
     default: "1h"
475544
     "1hour": "1h"
475544
475544
From 0800fcaff037a1b012b75e59d6771f5e7763e1de Mon Sep 17 00:00:00 2001
475544
From: Vojtech Polasek <vpolasek@redhat.com>
475544
Date: Thu, 28 May 2020 14:26:12 +0200
475544
Subject: [PATCH 05/11] fix tests and ansible
475544
475544
---
475544
 .../crypto/ssh_client_rekey_limit/ansible/shared.yml         | 2 +-
475544
 .../crypto/ssh_client_rekey_limit/tests/bad_size.fail.sh     | 4 ++--
475544
 .../crypto/ssh_client_rekey_limit/tests/bad_time.fail.sh     | 4 ++--
475544
 .../crypto/ssh_client_rekey_limit/tests/no_line.fail.sh      | 2 +-
475544
 .../integrity/crypto/ssh_client_rekey_limit/tests/ok.pass.sh | 5 +++--
475544
 5 files changed, 9 insertions(+), 8 deletions(-)
475544
475544
diff --git a/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/ansible/shared.yml b/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/ansible/shared.yml
475544
index 6d2bcbbd44..bb6544a0a0 100644
475544
--- a/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/ansible/shared.yml
475544
+++ b/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/ansible/shared.yml
475544
@@ -1,4 +1,4 @@
475544
-# platform = multi_platform_all                                                                                                                                                                                                                                                                                        [0/453]
475544
+# platform = multi_platform_all
475544
 # reboot = false
475544
 # strategy = configure
475544
 # complexity = low
475544
diff --git a/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/tests/bad_size.fail.sh b/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/tests/bad_size.fail.sh
475544
index 2ac0bbf350..22c465b08f 100644
475544
--- a/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/tests/bad_size.fail.sh
475544
+++ b/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/tests/bad_size.fail.sh
475544
@@ -1,4 +1,4 @@
475544
 # platform = multi_platform_all
475544
 
475544
-sed -e '/RekeyLimit/d' /etc/ssh/sshd_config
475544
-echo "RekeyLimit 812M 1h" >> /etc/ssh/sshd_config
475544
+
475544
+echo "RekeyLimit 812M 1h" >> /etc/ssh/ssh_config.d/02-rekey-limit.conf
475544
diff --git a/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/tests/bad_time.fail.sh b/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/tests/bad_time.fail.sh
475544
index fec859fe05..0dc621b1da 100644
475544
--- a/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/tests/bad_time.fail.sh
475544
+++ b/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/tests/bad_time.fail.sh
475544
@@ -1,4 +1,4 @@
475544
 # platform = multi_platform_all
475544
 
475544
-sed -e '/RekeyLimit/d' /etc/ssh/sshd_config
475544
-echo "RekeyLimit 512M 2h" >> /etc/ssh/sshd_config
475544
+
475544
+echo "RekeyLimit 512M 2h" >> /etc/ssh/ssh_config.d/02-rekey-limit.conf
475544
diff --git a/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/tests/no_line.fail.sh b/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/tests/no_line.fail.sh
475544
index a6cd10163f..f6abf711da 100644
475544
--- a/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/tests/no_line.fail.sh
475544
+++ b/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/tests/no_line.fail.sh
475544
@@ -1,3 +1,3 @@
475544
 # platform = multi_platform_all
475544
 
475544
-sed -e '/RekeyLimit/d' /etc/ssh/sshd_config
475544
+echo "some line" > /etc/ssh/ssh_config.d/02-rekey-limit.conf
475544
diff --git a/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/tests/ok.pass.sh b/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/tests/ok.pass.sh
475544
index a6a2ba7adf..e64e4191bc 100644
475544
--- a/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/tests/ok.pass.sh
475544
+++ b/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/tests/ok.pass.sh
475544
@@ -1,4 +1,5 @@
475544
 # platform = multi_platform_all
475544
 
475544
-sed -e '/RekeyLimit/d' /etc/ssh/sshd_config
475544
-echo "RekeyLimit 512M 1h" >> /etc/ssh/sshd_config
475544
+
475544
+rm -f /etc/ssh/ssh_config.d/02-rekey-limit.conf
475544
+echo "RekeyLimit 1G 1h" >> /etc/ssh/ssh_config.d/02-rekey-limit.conf
475544
475544
From 9451e6d91c9975a3e9ecd4c627cbb0f9afce4c92 Mon Sep 17 00:00:00 2001
475544
From: Vojtech Polasek <vpolasek@redhat.com>
475544
Date: Mon, 1 Jun 2020 14:29:47 +0200
475544
Subject: [PATCH 06/11] fix test to use default value, remove rule from stig
475544
475544
---
475544
 .../integrity/crypto/ssh_client_rekey_limit/tests/ok.pass.sh    | 2 +-
475544
 rhel8/profiles/stig.profile                                     | 1 +
475544
 tests/data/profile_stability/rhel8/stig.profile                 | 1 -
475544
 3 files changed, 2 insertions(+), 2 deletions(-)
475544
475544
diff --git a/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/tests/ok.pass.sh b/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/tests/ok.pass.sh
475544
index e64e4191bc..89d7069687 100644
475544
--- a/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/tests/ok.pass.sh
475544
+++ b/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/tests/ok.pass.sh
475544
@@ -2,4 +2,4 @@
475544
 
475544
 
475544
 rm -f /etc/ssh/ssh_config.d/02-rekey-limit.conf
475544
-echo "RekeyLimit 1G 1h" >> /etc/ssh/ssh_config.d/02-rekey-limit.conf
475544
+echo "RekeyLimit 512M 1h" >> /etc/ssh/ssh_config.d/02-rekey-limit.conf
475544
diff --git a/rhel8/profiles/stig.profile b/rhel8/profiles/stig.profile
475544
index 2bb81cf9dc..8f12852e26 100644
475544
--- a/rhel8/profiles/stig.profile
475544
+++ b/rhel8/profiles/stig.profile
475544
@@ -44,3 +44,4 @@ selections:
475544
     - package_rsyslog-gnutls_installed
475544
     - rsyslog_remote_tls
475544
     - rsyslog_remote_tls_cacert
475544
+    - "!ssh_client_rekey_limit"
475544
diff --git a/tests/data/profile_stability/rhel8/stig.profile b/tests/data/profile_stability/rhel8/stig.profile
475544
index 330ecc7e1e..9b164eb5c2 100644
475544
--- a/tests/data/profile_stability/rhel8/stig.profile
475544
+++ b/tests/data/profile_stability/rhel8/stig.profile
475544
@@ -269,7 +269,6 @@ selections:
475544
 - grub2_vsyscall_argument.severity=info
475544
 - sysctl_user_max_user_namespaces.role=unscored
475544
 - sysctl_user_max_user_namespaces.severity=info
475544
-- ssh_client_rekey_limit
475544
 - var_ssh_client_rekey_limit_size=1G
475544
 - var_ssh_client_rekey_limit_time=1hour
475544
 title: '[DRAFT] DISA STIG for Red Hat Enterprise Linux 8'
475544
475544
From bd47b1145f17c97de719c887db6146d5e7b59616 Mon Sep 17 00:00:00 2001
475544
From: Vojtech Polasek <vpolasek@redhat.com>
475544
Date: Wed, 3 Jun 2020 12:38:19 +0200
475544
Subject: [PATCH 07/11] rewrite oval to check for multiple locations
475544
475544
---
475544
 .../ssh_client_rekey_limit/oval/shared.xml    | 42 ++++++++++++-------
475544
 1 file changed, 26 insertions(+), 16 deletions(-)
475544
475544
diff --git a/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/oval/shared.xml b/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/oval/shared.xml
475544
index 2412763e3f..41fa0497ae 100644
475544
--- a/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/oval/shared.xml
475544
+++ b/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/oval/shared.xml
475544
@@ -1,28 +1,17 @@
475544
-{{% set filepath = "/etc/ssh/ssh_config.d/02-rekey-limit.conf" -%}}
475544
-
475544
 
475544
 <def-group>
475544
   <definition class="compliance" id="{{{ rule_id }}}" version="1">
475544
     <metadata>
475544
       <title>{{{ rule_title }}}</title>
475544
       {{{- oval_affected(products) }}}
475544
-      <description>Ensure 'RekeyLimit' is configured with the correct value in '{{{ filepath }}}'</description>
475544
+      <description>Ensure 'RekeyLimit' is configured with the correct value in /etc/ssh/ssh_config and /etc/ssh/ssh_config.d/*.conf</description>
475544
     </metadata>
475544
-    <criteria comment="RekeyLimit is correctly configured for ssh client">
475544
-      {{{- oval_line_in_file_criterion(filepath, "RekeyLimit") }}}
475544
+    <criteria comment="RekeyLimit is correctly configured for ssh client" operator="AND">
475544
+      <criterion comment="check that RekeyLimit is not configured in /etc/ssh/ssh_config" test_ref="test_ssh_client_rekey_limit_main_config" negate="true" />
475544
+      <criterion comment="check correct RekeyLimit configuration in /etc/ssh/ssh_config.d/*.conf" test_ref="test_ssh_client_rekey_limit_include_configs" />
475544
     </criteria>
475544
   </definition>
475544
 
475544
-  <ind:textfilecontent54_test check="all" check_existence="all_exist" comment="tests the value of RekeyLimit setting in the  file" id="test_ssh_client_rekey_limit" version="1">
475544
-     <ind:object object_ref="obj_ssh_client_rekey_limit"/>
475544
-  </ind:textfilecontent54_test>
475544
-
475544
-  <ind:textfilecontent54_object id="obj_ssh_client_rekey_limit" version="1">
475544
-     <ind:filepath>{{{ filepath }}}</ind:filepath>
475544
-     <ind:pattern var_ref="ssh_client_line_regex" operation="pattern match"></ind:pattern>
475544
-     <ind:instance datatype="int" operation="greater than or equal">1</ind:instance>
475544
-  </ind:textfilecontent54_object>
475544
-
475544
   <local_variable id="ssh_client_line_regex" datatype="string" comment="The regex of the directive" version="1">
475544
     <concat>
475544
       <literal_component>^[\s]*RekeyLimit[\s]+</literal_component>
475544
@@ -35,5 +24,26 @@
475544
 
475544
   <external_variable comment="Size component of the rekey limit" datatype="string" id="var_ssh_client_rekey_limit_size" version="1" />
475544
   <external_variable comment="Time component of the rekey limit" datatype="string" id="var_ssh_client_rekey_limit_time" version="1" />
475544
-</def-group>
475544
 
475544
+
475544
+  <ind:textfilecontent54_test check="all" check_existence="all_exist" comment="tests the value of RekeyLimit setting in /etc/ssh/ssh_config file" id="test_ssh_client_rekey_limit_main_config" version="1">
475544
+     <ind:object object_ref="obj_ssh_client_rekey_limit_main_config"/>
475544
+  </ind:textfilecontent54_test>
475544
+
475544
+  <ind:textfilecontent54_object id="obj_ssh_client_rekey_limit_main_config" version="1">
475544
+     <ind:filepath>/etc/ssh/ssh_config</ind:filepath>
475544
+     <ind:pattern operation="pattern match">^[\s]*RekeyLimit.*$</ind:pattern>
475544
+     <ind:instance datatype="int" operation="greater than or equal">1</ind:instance>
475544
+  </ind:textfilecontent54_object>
475544
+
475544
+  <ind:textfilecontent54_test check="all" check_existence="all_exist" comment="tests the value of RekeyLimit setting in /etc/ssh/ssh_config.d/*.conf" id="test_ssh_client_rekey_limit_include_configs" version="1">
475544
+     <ind:object object_ref="obj_ssh_client_rekey_limit_include_configs"/>
475544
+  </ind:textfilecontent54_test>
475544
+
475544
+  <ind:textfilecontent54_object id="obj_ssh_client_rekey_limit_include_configs" version="1">
475544
+     <ind:filepath operation="pattern match">^/etc/ssh/ssh_config\.d/.*\.conf$</ind:filepath>
475544
+     <ind:pattern var_ref="ssh_client_line_regex" operation="pattern match"></ind:pattern>
475544
+     <ind:instance datatype="int" operation="greater than or equal">1</ind:instance>
475544
+  </ind:textfilecontent54_object>
475544
+
475544
+</def-group>
475544
475544
From c090301ab1cf43a83994b654ccb2ab0b967d05b4 Mon Sep 17 00:00:00 2001
475544
From: Vojtech Polasek <vpolasek@redhat.com>
475544
Date: Thu, 4 Jun 2020 08:24:54 +0200
475544
Subject: [PATCH 08/11] reqrite remediations
475544
475544
---
475544
 .../ssh_client_rekey_limit/ansible/shared.yml    | 16 ++++++++++++++++
475544
 .../crypto/ssh_client_rekey_limit/bash/shared.sh | 13 +++++++++++++
475544
 2 files changed, 29 insertions(+)
475544
475544
diff --git a/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/ansible/shared.yml b/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/ansible/shared.yml
475544
index bb6544a0a0..36de503806 100644
475544
--- a/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/ansible/shared.yml
475544
+++ b/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/ansible/shared.yml
475544
@@ -5,4 +5,20 @@
475544
 # disruption = low
475544
 {{{ ansible_instantiate_variables("var_ssh_client_rekey_limit_size", "var_ssh_client_rekey_limit_time") }}}
475544
 
475544
+{{{ ansible_lineinfile(msg='Ensure RekeyLimit is not configured in /etc/ssh/ssh_config', path='/etc/ssh/ssh_config', regex='^\s*RekeyLimit.*$', create='no', state='absent') }}}
475544
+
475544
+- name: Collect all include config files for ssh client which configure RekeyLimit
475544
+  find:
475544
+    paths: "/etc/ssh/ssh_config.d/"
475544
+    contains: '^[\s]*RekeyLimit.*$'
475544
+    patterns: "*.config"
475544
+  register: ssh_config_include_files
475544
+
475544
+- name: Remove all occurences of RekeyLimit configuration from include config files of ssh client
475544
+  lineinfile:
475544
+    path: "{{ item }}"
475544
+    regexp: '^[\s]*RekeyLimit.*$'
475544
+    state: "absent"
475544
+  loop: "{{ ssh_config_include_files.files }}"
475544
+
475544
 {{{ ansible_lineinfile(msg='Ensure that rekey limit is set to {{ var_ssh_client_rekey_limit_size }} {{ var_ssh_client_rekey_limit_time }} in /etc/ssh/ssh_config.d/02-rekey-limit.conf', path='/etc/ssh/ssh_config.d/02-rekey-limit.conf', regex='^\s*RekeyLimit.*$', new_line='RekeyLimit {{ var_ssh_client_rekey_limit_size }} {{ var_ssh_client_rekey_limit_time }}', create='yes', state='present') }}}
475544
diff --git a/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/bash/shared.sh b/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/bash/shared.sh
475544
index 43d0971ffc..99f6f63c92 100644
475544
--- a/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/bash/shared.sh
475544
+++ b/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/bash/shared.sh
475544
@@ -5,4 +5,17 @@
475544
 
475544
 {{{ bash_instantiate_variables("var_ssh_client_rekey_limit_size", "var_ssh_client_rekey_limit_time") }}}
475544
 
475544
+main_config="/etc/ssh/ssh_config"
475544
+include_directory="/etc/ssh/ssh_config.d"
475544
+
475544
+if grep -q '^[\s]*RekeyLimit.*$' "$main_config"; then
475544
+  sed -i '/^[\s]*RekeyLimit.*/d' "$main_config"
475544
+fi
475544
+
475544
+for file in "$include_directory"/*.conf; do
475544
+  if grep -q '^[\s]*RekeyLimit.*$' "$file"; then
475544
+    sed -i '/^[\s]*RekeyLimit.*/d' "$file"
475544
+  fi
475544
+done
475544
+
475544
 {{{ set_config_file(path="/etc/ssh/ssh_config.d/02-rekey-limit.conf", parameter="RekeyLimit", value='$var_ssh_client_rekey_limit_size $var_ssh_client_rekey_limit_time', create=true, insert_before="", insert_after="", insensitive=false, separator=" ", separator_regex="\s\+", prefix_regex="^\s*") }}}
475544
475544
From 22b8cb067cfc9d6d48065233973d1dba223ef5a4 Mon Sep 17 00:00:00 2001
475544
From: Vojtech Polasek <vpolasek@redhat.com>
475544
Date: Thu, 4 Jun 2020 08:25:14 +0200
475544
Subject: [PATCH 09/11] add more tests
475544
475544
---
475544
 .../tests/bad_main_config_good_include_config.fail.sh         | 4 ++++
475544
 .../ssh_client_rekey_limit/tests/line_in_main_config.fail.sh  | 4 ++++
475544
 .../tests/ok_different_config_file.pass.sh                    | 3 +++
475544
 3 files changed, 11 insertions(+)
475544
 create mode 100644 linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/tests/bad_main_config_good_include_config.fail.sh
475544
 create mode 100644 linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/tests/line_in_main_config.fail.sh
475544
 create mode 100644 linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/tests/ok_different_config_file.pass.sh
475544
475544
diff --git a/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/tests/bad_main_config_good_include_config.fail.sh b/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/tests/bad_main_config_good_include_config.fail.sh
475544
new file mode 100644
475544
index 0000000000..90314712af
475544
--- /dev/null
475544
+++ b/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/tests/bad_main_config_good_include_config.fail.sh
475544
@@ -0,0 +1,4 @@
475544
+#!/bin/basdh
475544
+
475544
+echo "RekeyLimit 2G 1h" >> /etc/ssh/ssh_config
475544
+echo "RekeyLimit 512M 1h" >> /etc/ssh/ssh_config.d/02-rekey-limit.conf
475544
diff --git a/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/tests/line_in_main_config.fail.sh b/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/tests/line_in_main_config.fail.sh
475544
new file mode 100644
475544
index 0000000000..9ba20b0290
475544
--- /dev/null
475544
+++ b/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/tests/line_in_main_config.fail.sh
475544
@@ -0,0 +1,4 @@
475544
+#!/bin/bash
475544
+
475544
+rm -rf /etc/ssh/ssh_config.d/*
475544
+echo "RekeyLimit 512M 1h" >> /etc/ssh/ssh_config
475544
diff --git a/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/tests/ok_different_config_file.pass.sh b/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/tests/ok_different_config_file.pass.sh
475544
new file mode 100644
475544
index 0000000000..f725f6936f
475544
--- /dev/null
475544
+++ b/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/tests/ok_different_config_file.pass.sh
475544
@@ -0,0 +1,3 @@
475544
+#!/bin/bash
475544
+
475544
+echo "RekeyLimit 512M 1h" >> /etc/ssh/ssh_config.d/05-some-file.conf
475544
475544
From 78904a0cc4461cc26786289095fd76e8ce15843e Mon Sep 17 00:00:00 2001
475544
From: Vojtech Polasek <vpolasek@redhat.com>
475544
Date: Thu, 4 Jun 2020 08:25:29 +0200
475544
Subject: [PATCH 10/11] extend description and ocil
475544
475544
---
475544
 .../crypto/ssh_client_rekey_limit/rule.yml    | 19 ++++++++++++++-----
475544
 1 file changed, 14 insertions(+), 5 deletions(-)
475544
475544
diff --git a/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/rule.yml b/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/rule.yml
475544
index a1b85b0ee5..76f5f84090 100644
475544
--- a/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/rule.yml
475544
+++ b/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/rule.yml
475544
@@ -10,6 +10,12 @@ description: |-
475544
     amount of data that may be transmitted and the time
475544
     elapsed. To decrease the default limits, put line
475544
     <tt>RekeyLimit {{{ sub_var_value("var_ssh_client_rekey_limit_size") }}} {{{ sub_var_value("var_ssh_client_rekey_limit_time") }}}</tt> to file <tt>/etc/ssh/ssh_config.d/02-rekey-limit.conf</tt>.
475544
+    Make sure that there is no other <tt>RekeyLimit</tt> configuration preceding
475544
+    the <tt>include</tt> directive in the main config file
475544
+    <tt>/etc/ssh/ssh_config</tt>. Check also other files in
475544
+    <tt>/etc/ssh/ssh_config.d</tt> directory. Files are processed according to
475544
+    their names. Make sure that there is no file processed before
475544
+    <tt>02-rekey-limit.conf</tt> containing definition of <tt>RekeyLimit</tt>.
475544
 
475544
 rationale: |-
475544
     By decreasing the limit based on the amount of data and enabling
475544
@@ -27,8 +33,11 @@ references:
475544
 ocil_clause: 'it is commented out or is not set'
475544
 
475544
 ocil: |-
475544
-    To check if RekeyLimit is set correctly, run the
475544
-    following command:
475544
-    
$ sudo grep RekeyLimit /etc/ssh/ssh_config.d/02-rekey-limit.conf
475544
-    If configured properly, output should be
475544
-    
RekeyLimit {{{ sub_var_value("var_ssh_client_rekey_limit_size") }}} {{{ sub_var_value("var_ssh_client_rekey_limit_time") }}}
475544
+    To check if RekeyLimit is set correctly, run the following command: 
$
475544
+    sudo grep RekeyLimit /etc/ssh/ssh_config.d/*.conf If configured
475544
+    properly, output should be 
/etc/ssh/ssh_config.d/02-rekey-limit.conf:
475544
+    RekeyLimit {{{ sub_var_value("var_ssh_client_rekey_limit_size") }}} {{{
475544
+    sub_var_value("var_ssh_client_rekey_limit_time") }}} Check also the
475544
+    main configuration file with the following command: 
sudo grep
475544
+    RekeyLimit /etc/ssh/ssh_config The command should not return any
475544
+    output.
475544
475544
From 854d5c9d1e1a44e97fe59aeaace687adcff620d5 Mon Sep 17 00:00:00 2001
475544
From: Vojtech Polasek <vpolasek@redhat.com>
475544
Date: Mon, 8 Jun 2020 11:44:44 +0200
475544
Subject: [PATCH 11/11] fix typos and wording
475544
475544
---
475544
 .../integrity/crypto/ssh_client_rekey_limit/rule.yml     | 5 +++--
475544
 .../tests/bad_main_config_good_include_config.fail.sh    | 2 +-
475544
 .../crypto/ssh_client_rekey_limit/tests/bad_size.fail.sh | 1 +
475544
 .../crypto/ssh_client_rekey_limit/tests/bad_time.fail.sh | 1 +
475544
 .../crypto/ssh_client_rekey_limit/tests/no_line.fail.sh  | 1 +
475544
 .../crypto/ssh_client_rekey_limit/tests/ok.pass.sh       | 1 +
475544
 .../integrity/crypto/var_ssh_client_rekey_limit_size.var | 2 +-
475544
 .../integrity/crypto/var_ssh_client_rekey_limit_time.var | 9 ++++-----
475544
 8 files changed, 13 insertions(+), 9 deletions(-)
475544
475544
diff --git a/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/rule.yml b/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/rule.yml
475544
index 76f5f84090..b054d9d221 100644
475544
--- a/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/rule.yml
475544
+++ b/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/rule.yml
475544
@@ -14,8 +14,9 @@ description: |-
475544
     the <tt>include</tt> directive in the main config file
475544
     <tt>/etc/ssh/ssh_config</tt>. Check also other files in
475544
     <tt>/etc/ssh/ssh_config.d</tt> directory. Files are processed according to
475544
-    their names. Make sure that there is no file processed before
475544
-    <tt>02-rekey-limit.conf</tt> containing definition of <tt>RekeyLimit</tt>.
475544
+    lexicographical order of file names. Make sure that there is no file
475544
+    processed before <tt>02-rekey-limit.conf</tt> containing definition of
475544
+    <tt>RekeyLimit</tt>.
475544
 
475544
 rationale: |-
475544
     By decreasing the limit based on the amount of data and enabling
475544
diff --git a/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/tests/bad_main_config_good_include_config.fail.sh b/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/tests/bad_main_config_good_include_config.fail.sh
475544
index 90314712af..58befb0107 100644
475544
--- a/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/tests/bad_main_config_good_include_config.fail.sh
475544
+++ b/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/tests/bad_main_config_good_include_config.fail.sh
475544
@@ -1,4 +1,4 @@
475544
-#!/bin/basdh
475544
+#!/bin/bash
475544
 
475544
 echo "RekeyLimit 2G 1h" >> /etc/ssh/ssh_config
475544
 echo "RekeyLimit 512M 1h" >> /etc/ssh/ssh_config.d/02-rekey-limit.conf
475544
diff --git a/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/tests/bad_size.fail.sh b/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/tests/bad_size.fail.sh
475544
index 22c465b08f..1803c26629 100644
475544
--- a/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/tests/bad_size.fail.sh
475544
+++ b/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/tests/bad_size.fail.sh
475544
@@ -1,3 +1,4 @@
475544
+#!/bin/bash
475544
 # platform = multi_platform_all
475544
 
475544
 
475544
diff --git a/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/tests/bad_time.fail.sh b/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/tests/bad_time.fail.sh
475544
index 0dc621b1da..2c9e839255 100644
475544
--- a/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/tests/bad_time.fail.sh
475544
+++ b/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/tests/bad_time.fail.sh
475544
@@ -1,3 +1,4 @@
475544
+#!/bin/bash
475544
 # platform = multi_platform_all
475544
 
475544
 
475544
diff --git a/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/tests/no_line.fail.sh b/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/tests/no_line.fail.sh
475544
index f6abf711da..7de108eafd 100644
475544
--- a/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/tests/no_line.fail.sh
475544
+++ b/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/tests/no_line.fail.sh
475544
@@ -1,3 +1,4 @@
475544
+#!/bin/bash
475544
 # platform = multi_platform_all
475544
 
475544
 echo "some line" > /etc/ssh/ssh_config.d/02-rekey-limit.conf
475544
diff --git a/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/tests/ok.pass.sh b/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/tests/ok.pass.sh
475544
index 89d7069687..4c047ed179 100644
475544
--- a/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/tests/ok.pass.sh
475544
+++ b/linux_os/guide/system/software/integrity/crypto/ssh_client_rekey_limit/tests/ok.pass.sh
475544
@@ -1,3 +1,4 @@
475544
+#!/bin/bash
475544
 # platform = multi_platform_all
475544
 
475544
 
475544
diff --git a/linux_os/guide/system/software/integrity/crypto/var_ssh_client_rekey_limit_size.var b/linux_os/guide/system/software/integrity/crypto/var_ssh_client_rekey_limit_size.var
475544
index 4e20104cba..c8dd8ef10e 100644
475544
--- a/linux_os/guide/system/software/integrity/crypto/var_ssh_client_rekey_limit_size.var
475544
+++ b/linux_os/guide/system/software/integrity/crypto/var_ssh_client_rekey_limit_size.var
475544
@@ -7,7 +7,7 @@ description: |-
475544
     of data. After this amount of data is transferred through the connection,
475544
     the session key is renegotiated. The number is followed by K, M or G for
475544
     kilobytes, megabytes or gigabytes. Note that the RekeyLimit can be also
475544
-    configured according to ellabsed time.
475544
+    configured according to elapsed time.
475544
 
475544
 interactive: true
475544
 
475544
diff --git a/linux_os/guide/system/software/integrity/crypto/var_ssh_client_rekey_limit_time.var b/linux_os/guide/system/software/integrity/crypto/var_ssh_client_rekey_limit_time.var
475544
index 6143a5448c..6223e8e38f 100644
475544
--- a/linux_os/guide/system/software/integrity/crypto/var_ssh_client_rekey_limit_time.var
475544
+++ b/linux_os/guide/system/software/integrity/crypto/var_ssh_client_rekey_limit_time.var
475544
@@ -3,11 +3,10 @@ documentation_complete: true
475544
 title: 'SSH client RekeyLimit - time'
475544
 
475544
 description: |-
475544
-    Specify the time component of the rekey limit. This limit signifies amount
475544
-    of data. The session key is renegotiated after the defined amount of time
475544
-    passes. The number is followed by units such as H or M for hours or minutes.
475544
-    Note that the RekeyLimit can be also configured according to amount of
475544
-    transfered data.
475544
+    Specify the time component of the rekey limit. The session key is
475544
+    renegotiated after the defined amount of time passes. The number is followed
475544
+    by units such as H or M for hours or minutes. Note that the RekeyLimit can
475544
+    be also configured according to amount of transfered data.
475544
 
475544
 interactive: true
475544