From patchwork Tue Sep 11 00:29:08 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: 1921 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 C4F6161DE2 for ; Mon, 10 Sep 2018 16:29:17 +0200 (CEST) Received: from mail01.i.ipfire.org (localhost [IPv6:::1]) by mail01.ipfire.org (Postfix) with ESMTP id 7DA9C10A148D; Mon, 10 Sep 2018 15:29:17 +0100 (BST) Received: from mx-nbg.link38.eu (mx-nbg.link38.eu [37.120.167.53]) (using TLSv1.2 with cipher ECDHE-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 2CC41109EBA3 for ; Mon, 10 Sep 2018 15:29:12 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=link38.eu; s=201803; t=1536589750; 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=EGUg5XUw9aHVUCtWHV+EswsxifCAje64ro+kfbL/E3E=; b=2VwNJtYagthfCPcshwATdA/2sEBqRtGTIdygLlHIEAfd2vuqMmb4SMT4aj+kxhNqh6Y/AA ZACZtlMMNNMCNes8D0X2bsjldj+XtuihZtxjbJEnb1INhciTmBAHXeCAOKqTuPRbyDMmqV Tbga7SZNzEAq4CHC6GxrNi6CrOG+OCVT2aCHDKWXOBPCVdVJiy1RixEgviLx5546l6j0Ow hKCF8P4JjSTsWb6QtQTx1t3lfrDJsrvVYzR9QnTGhbEfcAKOGeQAsh854HrWdU1C+g+F2M Y2YDw0uLbg3hPdxp8W7SE+WrTEs8H9nI0spe1XHYEAVgalFTk/aWVxbzg5UgcQ== From: =?utf-8?q?Peter_M=C3=BCller?= To: development@lists.ipfire.org Subject: [PATCH v2 1/2] add hardened SSH client configuration Date: Mon, 10 Sep 2018 16:29:08 +0200 Message-Id: <20180910142909.5725-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" Introduce a custom OpenSSH client configuration file for IPFire. Some people use it as a jumping host, so applying hardening options system-wide improves security. Cryptography setup is the same as for OpenSSH server configuration. The second version of this patch re-adds some non-AEAD cipher suites which are needed for connecting to older RHEL systems. Partially fixes #11751 Signed-off-by: Peter Müller --- config/ssh/ssh_config | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 config/ssh/ssh_config diff --git a/config/ssh/ssh_config b/config/ssh/ssh_config new file mode 100644 index 000000000..2abfae6d1 --- /dev/null +++ b/config/ssh/ssh_config @@ -0,0 +1,33 @@ +# OpenSSH client configuration +# +# set some basic hardening options for all connections +Host * + # disable Roaming as it is known to be vulnerable + UseRoaming no + + # 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 + MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,umac-128@openssh.com + + # always visualise server host keys (has no technical + # effect, but helps to identify key based MITM attacks) + VisualHostKey yes + + # use SSHFP (might work on some up-to-date networks) to look up host keys + VerifyHostKeyDNS yes + + # send keep-alive messages to connected server to avoid broken connections + ServerAliveInterval 10 + ServerAliveCountMax 6 + + # disable X11 forwarding (security risk) + ForwardX11 no + + # always check server IP address + CheckHostIP yes + + # ensure only allowed authentication methods are used + PreferredAuthentications publickey,keyboard-interactive,password + +# EOF