From patchwork Sat Sep 25 07:07:58 2021 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: 4730 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4HGg3B3nc9z3xWd for ; Sat, 25 Sep 2021 07:08:06 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4HGg3875lDz6lP; Sat, 25 Sep 2021 07:08:04 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4HGg384rkdz2yXv; Sat, 25 Sep 2021 07:08:04 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4HGg373lVyz2yCW for ; Sat, 25 Sep 2021 07:08:03 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4HGg362Sz2zks for ; Sat, 25 Sep 2021 07:08:02 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1632553682; h=from:from: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; bh=NZCzsER6UCCnQefuc7LTLutWARxxZzQ7sPp7cMbt/rI=; b=iKCOlW23axOYnx2hh5TWj/OYHJIfOMn8YbW/J+4aImrAabtxH43uo2sctFxzFSnF7qlZTg aATu1YBBWi6c6BAA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1632553682; h=from:from: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; bh=NZCzsER6UCCnQefuc7LTLutWARxxZzQ7sPp7cMbt/rI=; b=Yl4aD0Qj2B9ytK5nwj2XE0qMEKUhb9QsyyqLaS6PcCYux9hC5aHjYmiw1xDgzMdcbuqb7f MVti+Q76/8o/KyOPIfrFsrJH3+9XjA/2S6p35GrnwfRkU5zsbmxgMhAYFaZkn8gkDkziRO 6QXS0O1VKoBdPtYpDnDhBdIXezIdlkGAez3FPaK6T3rvcD0lPfXrEdEmGo3vyF7xzXkszs 6XTp12x37WXoBtQVVrdopf+bFvb6iQAofCKAvJmLhSknx9Wz5CDwbfjF1BGX1vpnMiVudq CyIYwmns8iBkmZa5ui58qw9IwzjoDQJf7B/Ss3/CGSm7vveoTzed1+lx1pRF3Q== To: "IPFire: Development" From: =?utf-8?q?Peter_M=C3=BCller?= Subject: [PATCH 1/4] Tor: Enable syscall sandbox Message-ID: Date: Sat, 25 Sep 2021 09:07:58 +0200 MIME-Version: 1.0 Content-Language: en-US X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 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" This makes post-exploitation activities harder, in case the local Tor instance has been compromised. It is worth noticing that Tor won't respond to a "GETINFO address" command on the control port if sandboxed, but our CGI does not make use of it, and neither is any legitimate service on IPFire doing so. Tested on a small middle relay running on an IPFire machine. Signed-off-by: Peter Müller --- html/cgi-bin/tor.cgi | 1 + 1 file changed, 1 insertion(+) diff --git a/html/cgi-bin/tor.cgi b/html/cgi-bin/tor.cgi index 3349336ae..ce579aec1 100644 --- a/html/cgi-bin/tor.cgi +++ b/html/cgi-bin/tor.cgi @@ -730,6 +730,7 @@ sub BuildConfiguration() { open(FILE, ">$torrc"); # Global settings. + print FILE "Sandbox 1\n"; print FILE "ControlPort $TOR_CONTROL_PORT\n"; if ($settings{'TOR_ENABLED'} eq 'on') {