<div dir="ltr"><div><div><div>Ok, I realize that this went through a while ago but has anyone actually lived with this setting enabled?<br><br></div>I&#39;ve got a LOT of unhappy users that start to VI a file, walk away for a while (with their local screen locked) and come back to find their sessions dumped all over the floor.<br>
<br>The default appears to be 5 minutes across the board which I find WAY too short since I might be looking at a man page in two windows for that amount of time or more.<br><br></div>I would like to propose that the defaults be changed to something more sensible like 2, 4, or 8 hours. (Heck, meetings can go on for more than 2 hours sometimes)<br>
<br></div>Thanks,<br><br>Trevor<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Feb 24, 2014 at 5:34 PM, Shawn Wells <span dir="ltr">&lt;<a href="mailto:shawn@redhat.com" target="_blank">shawn@redhat.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000"><div><div class="h5">
    <div>On 2/24/14, 12:06 PM, Jan Lieskovsky
      wrote:<br>
    </div>
    </div></div><blockquote type="cite"><div><div class="h5">
      <div style="font-family:-moz-fixed;font-size:12px" lang="x-unicode">
        <pre>This improvement was originally proposed by Tomas Heinrich for USGCB content.
But it is applicable to SSG content too, therefore this post.

Rationale:
----------

  When checking the system for underlying value of ClientAliveInterval sshd config
variable it&#39;s not sufficient to check just for upper bound (if the present value is
less than required maximum), but it is necessary to check also for lower bound. Because
from the sshd_config manual page:

     ClientAliveInterval
             Sets a timeout interval in seconds after which if no data has been received from the client, sshd(8) will send a message through the
             encrypted channel to request a response from the client.  The default is 0, indicating that these messages will not be sent to the
             client.  This option applies to protocol version 2 only.

Conclusion:
-----------

  The current form worked only for instances, not having ClientAliveInterval at all in the
config. But having had that value set to zero, would still pass (which is wrong, since as
mentioned above these messages would still not be sent). Thus this patch adds also check
if actual value is greater than zero.

  Besides that it add some blank lines for better readability. Also removes Fedora version
of sshd_set_idle_timeout.xml rule and links to shared one.

Testing background:
-------------------

  Has been tested on RHEL-7 &amp; Fedora-20 and seems to be working properly.

Please review.

Thank you &amp;&amp; Regards, Jan.
--
Jan iankko Lieskovsky / Red Hat Security Technologies Team
</pre>
      </div>
      <br>
      </div></div><fieldset><legend>0001-shared-sshd_set_idle_timeout-when-doing-the-check-be.patch</legend></fieldset>
      <br>
      <div style="font-family:-moz-fixed;font-size:12px" lang="x-western">
        <pre>From b8419800dd27abad20a5f631ea71944ceb43664f Mon Sep 17 00:00:00 2001
From: Jan Lieskovsky <a href="mailto:jlieskov@redhat.com" target="_blank">&lt;jlieskov@redhat.com&gt;</a>
Date: Mon, 24 Feb 2014 17:52:03 +0100
Subject: [PATCH] [shared] sshd_set_idle_timeout - when doing the check be sure
 to check also the lower bound of ClientAliveInterval value.

Signed-off-by: Jan Lieskovsky <a href="mailto:jlieskov@redhat.com" target="_blank">&lt;jlieskov@redhat.com&gt;</a>
---
 Fedora/input/checks/sshd_set_idle_timeout.xml | 34 +--------------------------
 shared/oval/sshd_set_idle_timeout.xml         | 19 ++++++++++++---
 2 files changed, 17 insertions(+), 36 deletions(-)
 mode change 100644 =&gt; 120000 Fedora/input/checks/sshd_set_idle_timeout.xml

diff --git a/Fedora/input/checks/sshd_set_idle_timeout.xml b/Fedora/input/checks/sshd_set_idle_timeout.xml
deleted file mode 100644
index df3336a..0000000
--- a/Fedora/input/checks/sshd_set_idle_timeout.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-&lt;def-group&gt;
-  &lt;definition class=&quot;compliance&quot; id=&quot;sshd_set_idle_timeout&quot; version=&quot;1&quot;&gt;
-    &lt;metadata&gt;
-      &lt;title&gt;Set OpenSSH Idle Timeout Interval&lt;/title&gt;
-      &lt;affected family=&quot;unix&quot;&gt;
-        &lt;platform&gt;Fedora 19&lt;/platform&gt;
-      &lt;/affected&gt;
-      &lt;description&gt;The SSH idle timeout interval should be set to an appropriate value.&lt;/description&gt;
-    &lt;/metadata&gt;
-    &lt;criteria comment=&quot;SSH is not being used or conditions are met&quot; operator=&quot;OR&quot;&gt;
-      &lt;extend_definition comment=&quot;sshd service is disabled&quot; definition_ref=&quot;service_sshd_disabled&quot; /&gt;
-      &lt;criterion comment=&quot;Check ClientAliveInterval in /etc/ssh/sshd_config&quot; test_ref=&quot;test_sshd_idle_timeout&quot; /&gt;
-    &lt;/criteria&gt;
-  &lt;/definition&gt;
-
-  &lt;ind:textfilecontent54_test check=&quot;all&quot; check_existence=&quot;all_exist&quot; comment=&quot;timeout is configured&quot; id=&quot;test_sshd_idle_timeout&quot; version=&quot;1&quot;&gt;
-    &lt;ind:object object_ref=&quot;object_sshd_idle_timeout&quot; /&gt;
-    &lt;ind:state state_ref=&quot;state_timeout_value&quot; /&gt;
-  &lt;/ind:textfilecontent54_test&gt;
-
-  &lt;ind:textfilecontent54_object id=&quot;object_sshd_idle_timeout&quot; version=&quot;1&quot;&gt;
-    &lt;ind:filepath&gt;/etc/ssh/sshd_config&lt;/ind:filepath&gt;
-    &lt;ind:pattern operation=&quot;pattern match&quot;&gt;^[\s]*(?i)ClientAliveInterval[\s]+(\d+)[\s]*$&lt;/ind:pattern&gt;
-    &lt;ind:instance datatype=&quot;int&quot;&gt;1&lt;/ind:instance&gt;
-  &lt;/ind:textfilecontent54_object&gt;
-
-  &lt;ind:textfilecontent54_state comment=&quot;ClientAliveInterval in seconds&quot; id=&quot;state_timeout_value&quot; version=&quot;1&quot;&gt;
-    &lt;ind:subexpression datatype=&quot;int&quot; operation=&quot;less than or equal&quot; var_check=&quot;all&quot; var_ref=&quot;sshd_idle_timeout_value&quot; /&gt;
-  &lt;/ind:textfilecontent54_state&gt;
-
-  &lt;external_variable comment=&quot;timeout value&quot; datatype=&quot;int&quot; id=&quot;sshd_idle_timeout_value&quot; version=&quot;1&quot; /&gt;
-
-&lt;/def-group&gt;
diff --git a/Fedora/input/checks/sshd_set_idle_timeout.xml b/Fedora/input/checks/sshd_set_idle_timeout.xml
new file mode 120000
index 0000000..2fd18f6
--- /dev/null
+++ b/Fedora/input/checks/sshd_set_idle_timeout.xml
@@ -0,0 +1 @@
+../../../shared/oval/sshd_set_idle_timeout.xml
\ No newline at end of file
diff --git a/shared/oval/sshd_set_idle_timeout.xml b/shared/oval/sshd_set_idle_timeout.xml
index ad63830..f891e65 100644
--- a/shared/oval/sshd_set_idle_timeout.xml
+++ b/shared/oval/sshd_set_idle_timeout.xml
@@ -5,10 +5,12 @@
       &lt;affected family=&quot;unix&quot;&gt;
         &lt;platform&gt;Red Hat Enterprise Linux 6&lt;/platform&gt;
         &lt;platform&gt;Red Hat Enterprise Linux 7&lt;/platform&gt;
+        &lt;platform&gt;Fedora 20&lt;/platform&gt;
       &lt;/affected&gt;
       &lt;description&gt;The SSH idle timeout interval should be set to an
       appropriate value.&lt;/description&gt;
       &lt;reference source=&quot;MED&quot; ref_id=&quot;20130813&quot; ref_url=&quot;test_attestation&quot; /&gt;
+      &lt;!-- Fedora 20: &lt;reference source=&quot;JL&quot; ref_id=&quot;20140224&quot; ref_url=&quot;test_attestation&quot; /&gt; --&gt;
     &lt;/metadata&gt;
     &lt;criteria comment=&quot;SSH is not being used or conditions are met&quot;
     operator=&quot;OR&quot;&gt;
@@ -18,21 +20,32 @@
       test_ref=&quot;test_sshd_idle_timeout&quot; /&gt;
     &lt;/criteria&gt;
   &lt;/definition&gt;
+
   &lt;ind:textfilecontent54_test check=&quot;all&quot; check_existence=&quot;all_exist&quot;
   comment=&quot;timeout is configured&quot; id=&quot;test_sshd_idle_timeout&quot; version=&quot;1&quot;&gt;
     &lt;ind:object object_ref=&quot;object_sshd_idle_timeout&quot; /&gt;
-    &lt;ind:state state_ref=&quot;state_timeout_value&quot; /&gt;
+    &lt;ind:state state_ref=&quot;state_timeout_value_upper_bound&quot; /&gt;
+    &lt;ind:state state_ref=&quot;state_timeout_value_lower_bound&quot; /&gt;
   &lt;/ind:textfilecontent54_test&gt;
+
   &lt;ind:textfilecontent54_object id=&quot;object_sshd_idle_timeout&quot; version=&quot;1&quot;&gt;
     &lt;ind:filepath&gt;/etc/ssh/sshd_config&lt;/ind:filepath&gt;
     &lt;ind:pattern operation=&quot;pattern match&quot;&gt;^[\s]*(?i)ClientAliveInterval[\s]+(\d+)[\s]*$&lt;/ind:pattern&gt;
     &lt;ind:instance datatype=&quot;int&quot;&gt;1&lt;/ind:instance&gt;
   &lt;/ind:textfilecontent54_object&gt;
-  &lt;ind:textfilecontent54_state comment=&quot;ClientAliveInterval in seconds&quot;
-  id=&quot;state_timeout_value&quot; version=&quot;1&quot;&gt;
+
+  &lt;ind:textfilecontent54_state comment=&quot;upper bound of ClientAliveInterval in seconds&quot;
+  id=&quot;state_timeout_value_upper_bound&quot; version=&quot;1&quot;&gt;
     &lt;ind:subexpression datatype=&quot;int&quot; operation=&quot;less than or equal&quot; var_check=&quot;all&quot;
     var_ref=&quot;sshd_idle_timeout_value&quot; /&gt;
   &lt;/ind:textfilecontent54_state&gt;
+
+  &lt;ind:textfilecontent54_state comment=&quot;lower bound of ClientAliveInterval in seconds&quot;
+  id=&quot;state_timeout_value_lower_bound&quot; version=&quot;1&quot;&gt;
+    &lt;ind:subexpression datatype=&quot;int&quot; operation=&quot;greater than&quot;&gt;0&lt;/ind:subexpression&gt;
+  &lt;/ind:textfilecontent54_state&gt;
+
   &lt;external_variable comment=&quot;timeout value&quot; datatype=&quot;int&quot;
   id=&quot;sshd_idle_timeout_value&quot; version=&quot;1&quot; /&gt;
+
 &lt;/def-group&gt;</pre>
      </div>
    </blockquote>
    <br>
    <br>
    <br>
    Good finding. Ack.<br>
  </div>

<br>_______________________________________________<br>
scap-security-guide mailing list<br>
<a href="mailto:scap-security-guide@lists.fedorahosted.org">scap-security-guide@lists.fedorahosted.org</a><br>
<a href="https://lists.fedorahosted.org/mailman/listinfo/scap-security-guide" target="_blank">https://lists.fedorahosted.org/mailman/listinfo/scap-security-guide</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Trevor Vaughan<br>Vice President, Onyx Point, Inc<br>(410) 541-6699<br><a href="mailto:tvaughan@onyxpoint.com">tvaughan@onyxpoint.com</a><br><br>-- This account not approved for unencrypted proprietary information --
</div>