From owner-freebsd-stable@freebsd.org Mon Aug 20 16:22:21 2018 Return-Path: Delivered-To: freebsd-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75B94107461C for ; Mon, 20 Aug 2018 16:22:21 +0000 (UTC) (envelope-from stb@lassitu.de) Received: from gilb.zs64.net (gilb.zs64.net [IPv6:2a00:14b0:4200:32e0::1ea]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "gilb.zs64.net", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 188247532F for ; Mon, 20 Aug 2018 16:22:21 +0000 (UTC) (envelope-from stb@lassitu.de) Received: by gilb.zs64.net (Postfix, from stb@lassitu.de) id 18B651F013A; Mon, 20 Aug 2018 16:22:13 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: Bind to port <1024 in jail From: Stefan Bethke In-Reply-To: Date: Mon, 20 Aug 2018 18:22:11 +0200 Cc: FreeBSD Stable Content-Transfer-Encoding: quoted-printable Message-Id: <2FA29D2E-7C15-4C9D-A59B-98E9EA916891@lassitu.de> References: <75536186-7D58-498C-BFC6-9284EB7CB444@lassitu.de> To: "Bjoern A. Zeeb" X-Mailer: Apple Mail (2.3445.9.1) X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Aug 2018 16:22:21 -0000 > Am 20.08.2018 um 16:59 schrieb Bjoern A. Zeeb = : >=20 > On 20 Aug 2018, at 14:47, Stefan Bethke wrote: >=20 >> I have a Go program (acme-dns) that wants to bind 53, 80, and 443, = and I=E2=80=99d rather have it run as a non-privileged user. The = program doesn=E2=80=99t provide a facility to drop privs after binding = the ports. I=E2=80=99m planning to run it in a jail. >>=20 >> After some googling, it appears that a couple of years ago I should = have been able to do: >> sysctl net.inet.ip.portrange.reservedhigh=3D0 >> and allow all processes to bind to =E2=80=9Elow=E2=80=9C ports. This = does not work in my jails on a 11-stable host. >>=20 >> $ sudo sysctl net.inet.ip.portrange.reservedhigh=3D0 >> net.inet.ip.portrange.reservedhigh: 1023 >> sysctl: net.inet.ip.portrange.reservedhigh=3D0: Operation not = permitted >>=20 >> Securelevel should not interfere: >> $ sysctl kern.securelevel >> kern.securelevel: -1 >>=20 >> Is there a way to allow regular processes to bind to low ports? >=20 > you have to set it on the base system; alternatively with vnet you = might be able to change it per-jail. Do you feel it=E2=80=99s OK to enable VIMAGE in -stable? When I tried = last in 2016, I had stability issues, I think related to pf. Stefan --=20 Stefan Bethke Fon +49 151 14070811