From patchwork Thu Sep 13 03:50:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Peter_M=C3=BCller?= X-Patchwork-Id: 1929 Return-Path: Received: from mail01.ipfire.org (mail01.ipfire.org [IPv6:2001:470:7183:25::1]) by web02.i.ipfire.org (Postfix) with ESMTP id 9DDEE61A14 for ; Wed, 12 Sep 2018 19:50:52 +0200 (CEST) Received: from mail01.i.ipfire.org (localhost [IPv6:::1]) by mail01.ipfire.org (Postfix) with ESMTP id BF50A1096145; Wed, 12 Sep 2018 18:50:51 +0100 (BST) Received: from mx-nbg.link38.eu (mx-nbg.link38.eu [37.120.167.53]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx-nbg.link38.eu", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 066B0109612F for ; Wed, 12 Sep 2018 18:50:49 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=link38.eu; s=201803; t=1536774647; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references; bh=Mwslm0sM8ljVd01PmOM27+uxvduLOuAJ9Dz2tMW1ug8=; b=GuFuQTG4V4fNlZyDYxRH9ykPn1lc/E3ewdZfT9VaHTyfUgtLD4LuvJhwPiQFqNhKk231Jj rRVSNSC3f5PHkOr9C1K2QDJa0kWHSNF7q0yjRexSSXUpGd2tbyrnfXzhaWpX7cQ2ump5nX wY3P6GocWLbnBXUvK0Plnxzcyop5C5329FtIOALRegpX+8GNkQzhichBvGkrcAI8n7enqs GeEaSKQAzZ2e/Oo36Nk/CGzE44BlbU1m8aM15fjdDlqWOEK5wP+u31gj2lRE21iD14nM6/ mhy1KMy58iY9BlOw8cP5nFganf+4UWVa81uUDgZMlz3Yy2LW3ATnisEMObmPhQ== From: =?utf-8?q?Peter_M=C3=BCller?= To: development@lists.ipfire.org Subject: [PATCH 1/3] SSH client configuration: Use Protocol version 2 only Date: Wed, 12 Sep 2018 19:50:43 +0200 Message-Id: <20180912175045.7636-1-peter.mueller@link38.eu> MIME-Version: 1.0 Authentication-Results: mail01.ipfire.org; dkim=pass header.d=link38.eu; dmarc=pass (policy=none) header.from=link38.eu; spf=pass smtp.mailfrom=peter.mueller@link38.eu X-Spamd-Result: default: False [-11.54 / 11.00]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[link38.eu]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:37.120.167.53]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; DKIM_TRACE(0.00)[link38.eu:+]; RCVD_IN_DNSWL_MED(-2.00)[53.167.120.37.list.dnswl.org : 127.0.6.2]; MID_CONTAINS_FROM(1.00)[]; MX_GOOD(-0.01)[cached: mx-nbg.link38.eu]; DMARC_POLICY_ALLOW(-0.25)[link38.eu,none]; NEURAL_HAM(-3.00)[-0.999,0]; RCVD_COUNT_ZERO(0.00)[0]; FROM_EQ_ENVFROM(0.00)[]; IP_SCORE(-3.78)[ip: (-9.91), ipnet: 37.120.160.0/19(-4.96), asn: 197540(-3.96), country: DE(-0.09)]; ASN(0.00)[asn:197540, ipnet:37.120.160.0/19, country:DE]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-3.00)[100.00%] X-Spam-Status: No, score=-11.54 X-Rspamd-Server: mail01.i.ipfire.org X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: development-bounces@lists.ipfire.org Sender: "Development" SSH Protocol version 1 is insecure and must not be used anymore. Restrict SSH client configuration to ensure only version 2 is used. Signed-off-by: Peter Müller --- config/ssh/ssh_config | 3 +++ 1 file changed, 3 insertions(+) diff --git a/config/ssh/ssh_config b/config/ssh/ssh_config index 2abfae6d1..b36909f85 100644 --- a/config/ssh/ssh_config +++ b/config/ssh/ssh_config @@ -5,6 +5,9 @@ Host * # disable Roaming as it is known to be vulnerable UseRoaming no + # only use version 2 of SSH protocol + Protocol 2 + # only use secure crypto algorithm KexAlgorithms curve25519-sha256@libssh.org,diffie-hellman-group-exchange-sha256 Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr From patchwork Thu Sep 13 03:50:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Peter_M=C3=BCller?= X-Patchwork-Id: 1930 Return-Path: Received: from mail01.ipfire.org (mail01.i.ipfire.org [172.28.1.200]) by web02.i.ipfire.org (Postfix) with ESMTP id 9681761A14 for ; Wed, 12 Sep 2018 19:51:01 +0200 (CEST) Received: from mail01.i.ipfire.org (localhost [IPv6:::1]) by mail01.ipfire.org (Postfix) with ESMTP id 5268011340A6; Wed, 12 Sep 2018 18:51:01 +0100 (BST) Received: from mx-nbg.link38.eu (mx-nbg.link38.eu [IPv6:2a03:4000:6:432c:1f9e:48:ac3:199]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx-nbg.link38.eu", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 75AF01096141 for ; Wed, 12 Sep 2018 18:50:49 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=link38.eu; s=201803; t=1536774647; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Thsx+N+ZLVUoILQ9ZC0YBhlf9giwsLtl4FoXAk699dY=; b=BaJSvXHo7cELLsC5S4wDP2zFO2zwbUg5/ifHsiZ8ggltl59iW6BFcFOvf9yEM3nNxelFjM nmtf9Lz2Tofee3DGzG2nnlDY7bKC8ymMPUge/Jbt7kicDrQ4REoCPio3IAmKlfQS1nb4uL UJdaOPQeni6mczoEL4T/kT1+kgRYRg0V6FAXYFMD8TK5uI2fcggvmLC3c6AFBwCojt5fu8 YKgmFH28o1/7BSLz0XRe4cH/uS4VWwjmNqgr8O7CxNPG0sBWRaSZEqUPXBt483JtF51go9 zftvdN6ntaARfz6oREIM+mKlX8ZbkqMgkgXU9qIrmNvS61afOAo1t4ovV3liyQ== From: =?utf-8?q?Peter_M=C3=BCller?= To: development@lists.ipfire.org Subject: [PATCH 2/3] SSH client configuration: Hash known_hosts entries Date: Wed, 12 Sep 2018 19:50:44 +0200 Message-Id: <20180912175045.7636-2-peter.mueller@link38.eu> In-Reply-To: <20180912175045.7636-1-peter.mueller@link38.eu> References: <20180912175045.7636-1-peter.mueller@link38.eu> MIME-Version: 1.0 Authentication-Results: mail01.ipfire.org; dkim=pass header.d=link38.eu; dmarc=pass (policy=none) header.from=link38.eu; spf=pass smtp.mailfrom=peter.mueller@link38.eu X-Spamd-Result: default: False [-11.54 / 11.00]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[link38.eu]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a03:4000:6:432c:1f9e:48:ac3:199]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; DKIM_TRACE(0.00)[link38.eu:+]; DMARC_POLICY_ALLOW(-0.25)[link38.eu,none]; MID_CONTAINS_FROM(1.00)[]; RCVD_IN_DNSWL_MED(-2.00)[9.9.1.0.3.c.a.0.8.4.0.0.e.9.f.1.c.2.3.4.6.0.0.0.0.0.0.4.3.0.a.2.list.dnswl.org : 127.0.6.2]; NEURAL_HAM(-3.00)[-0.999,0]; MX_GOOD(-0.01)[cached: mx-nbg.link38.eu]; RCVD_COUNT_ZERO(0.00)[0]; FROM_EQ_ENVFROM(0.00)[]; IP_SCORE(-3.78)[ip: (-9.91), ipnet: 2a03:4000::/32(-4.95), asn: 197540(-3.96), country: DE(-0.09)]; ASN(0.00)[asn:197540, ipnet:2a03:4000::/32, country:DE]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-3.00)[100.00%] X-Spam-Status: No, score=-11.54 X-Rspamd-Server: mail01.i.ipfire.org X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: development-bounces@lists.ipfire.org Sender: "Development" By default, entries in ~/.ssh/known_hosts disclosure on which servers a user as access to, allowing detailled attack against these servers. Depending on the affected infrastructure, this might be a privacy problem, too. Force SSH to hash new entries in known_hosts (existing ones will not be converted) to avoid permission disclosure. Signed-off-by: Peter Müller --- config/ssh/ssh_config | 3 +++ 1 file changed, 3 insertions(+) diff --git a/config/ssh/ssh_config b/config/ssh/ssh_config index b36909f85..9f7121c76 100644 --- a/config/ssh/ssh_config +++ b/config/ssh/ssh_config @@ -33,4 +33,7 @@ Host * # ensure only allowed authentication methods are used PreferredAuthentications publickey,keyboard-interactive,password + # hash entries in ~/.ssh/known_hosts file to avoid permission disclosure + HashKnownHosts yes + # EOF From patchwork Thu Sep 13 03:50:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Peter_M=C3=BCller?= X-Patchwork-Id: 1931 Return-Path: Received: from mail01.ipfire.org (mail01.ipfire.org [IPv6:2001:470:7183:25::1]) by web02.i.ipfire.org (Postfix) with ESMTP id C7D9A61A14 for ; Wed, 12 Sep 2018 19:51:03 +0200 (CEST) Received: from mail01.i.ipfire.org (localhost [IPv6:::1]) by mail01.ipfire.org (Postfix) with ESMTP id 867DD11340B1; Wed, 12 Sep 2018 18:51:03 +0100 (BST) Received: from mx-nbg.link38.eu (mx-nbg.link38.eu [IPv6:2a03:4000:6:432c:1f9e:48:ac3:199]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx-nbg.link38.eu", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id D8A26109612F for ; Wed, 12 Sep 2018 18:50:49 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=link38.eu; s=201803; t=1536774647; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=I/TgaM1zCjXoS/1Y3SDmpYzJ082fKDAxqNme2xZ39ms=; b=dal7n0hD/uapYqGArYjjDbkmE2nTs7sd1ViXsS45r5ScFWjeX66s8usyoyx4lPvZTOO1uO 3G3KpIO0GoJXLzuM3EL8ri2bCoD+77AEDPbar/FRLzSwlXAsMBM4EkcS7xs3p6XblJgL2k FWo6WkmkLD2qmWYN8QkTf3I9SP5JddI8P8mAeTD5Cdp1gIumxtzD8mprrZX6F3sJg1ERVB 8ABk2nd8e5I2lV2s+mH7jIiGFZ0wOAfpEKKEaqNXk1e7OGSB5qnBIqv/lfsKp/kC4T6F41 InkIsf5m/coltPO/qk4XQodslGrpZdL5uBBtUBh3YU77k25ytj/ipMaYpDpwOg== From: =?utf-8?q?Peter_M=C3=BCller?= To: development@lists.ipfire.org Subject: [PATCH 3/3] SSH client configuration: Prefer server host keys in different order Date: Wed, 12 Sep 2018 19:50:45 +0200 Message-Id: <20180912175045.7636-3-peter.mueller@link38.eu> In-Reply-To: <20180912175045.7636-1-peter.mueller@link38.eu> References: <20180912175045.7636-1-peter.mueller@link38.eu> MIME-Version: 1.0 Authentication-Results: mail01.ipfire.org; dkim=pass header.d=link38.eu; dmarc=pass (policy=none) header.from=link38.eu; spf=pass smtp.mailfrom=peter.mueller@link38.eu X-Spamd-Result: default: False [-11.54 / 11.00]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[link38.eu]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a03:4000:6:432c:1f9e:48:ac3:199]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; DKIM_TRACE(0.00)[link38.eu:+]; RCVD_IN_DNSWL_MED(-2.00)[9.9.1.0.3.c.a.0.8.4.0.0.e.9.f.1.c.2.3.4.6.0.0.0.0.0.0.4.3.0.a.2.list.dnswl.org : 127.0.6.2]; MID_CONTAINS_FROM(1.00)[]; MX_GOOD(-0.01)[cached: mx-nbg.link38.eu]; DMARC_POLICY_ALLOW(-0.25)[link38.eu,none]; NEURAL_HAM(-3.00)[-0.999,0]; RCVD_COUNT_ZERO(0.00)[0]; FROM_EQ_ENVFROM(0.00)[]; IP_SCORE(-3.78)[ip: (-9.91), ipnet: 2a03:4000::/32(-4.95), asn: 197540(-3.96), country: DE(-0.09)]; ASN(0.00)[asn:197540, ipnet:2a03:4000::/32, country:DE]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-3.00)[100.00%] X-Spam-Status: No, score=-11.54 X-Rspamd-Server: mail01.i.ipfire.org X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: development-bounces@lists.ipfire.org Sender: "Development" SSH clients can set a preference for server host keys. To achive best security and performance, ED25519 is preferred over ECDSA (also secure, but a bit bigger and some of them use ECC curves from non-trustworthy sources) which is preferred over RSA. Since ED25519 keys are smaller and need less CPU time on both client and server, this also achives a better performance. Signed-off-by: Peter Müller --- config/ssh/ssh_config | 3 +++ 1 file changed, 3 insertions(+) diff --git a/config/ssh/ssh_config b/config/ssh/ssh_config index 9f7121c76..462f2f1a0 100644 --- a/config/ssh/ssh_config +++ b/config/ssh/ssh_config @@ -36,4 +36,7 @@ Host * # hash entries in ~/.ssh/known_hosts file to avoid permission disclosure HashKnownHosts yes + # prefer server host keys in different order (ED25519, ECDSA, RSA) + HostKeyAlgorithms ssh-ed25519-cert-v01@openssh.com,ssh-ed25519,ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,rsa-sha2-512,rsa-sha2-256,ssh-rsa-cert-v01@openssh.com,ssh-rsa + # EOF