From owner-freebsd-net@freebsd.org Sat Nov 30 02:52:19 2019 Return-Path: Delivered-To: freebsd-net@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E92AF1C63DD for ; Sat, 30 Nov 2019 02:52:19 +0000 (UTC) (envelope-from woodsb02@gmail.com) Received: from mail-ua1-x932.google.com (mail-ua1-x932.google.com [IPv6:2607:f8b0:4864:20::932]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47Pwry3g6Xz4bjV; Sat, 30 Nov 2019 02:52:18 +0000 (UTC) (envelope-from woodsb02@gmail.com) Received: by mail-ua1-x932.google.com with SMTP id 31so9801431uas.9; Fri, 29 Nov 2019 18:52:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=U1CF+NzGVgUH7wUHjduStnxCFMiMHE3RYGMHNoCz4/g=; b=FXW8MLqyXkwMlob+YV+E2pbIz7C2T70AT8iW/3iRi8t9qXPSIYz7U0Ja9Sx1qu0GZK M7aQLqbsYmj9F7HFIBYP8lMenugIK4OpulB3I4ErJHx6sNM1E6ZV69tLlw47lkkuMgfj v/H0L9X2fsG5xzCFucv9X1GR1RvV8axjV/up1ELACFut9aZ4D8PILyRZA1rGUVhZ9x9C za1/YbCPvUj4Sz/xNQp0MAETxNLwldX0lWwNJ+2FkOWnMwvHe/JVcbjSH6EHbv8ZqavA 7+EtIKB5J+LB9iHAtpWh7A0FEcNHOb81PzcsA2br1wN84bzl5jWalazhBl13gsvcHdaZ 9Fdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=U1CF+NzGVgUH7wUHjduStnxCFMiMHE3RYGMHNoCz4/g=; b=UaccWYlUj/CXISqP9xtJv03ufNilnP6dlZ81zKzTunw3Xme434hGJmFzT9vWQq+IL/ O7nsweRrFnJG5fHESOXyd/L3fP+Coti1jiDdawXaBOTK58hhxJ6hH9sja25W3X8FWWw4 8q9d4TVqEehwGYuDWvC2s3EOk2Nx9gk+B42vjUE0Y6KVWPGKIuVvmduYy3jvBy9K2L7U qIVGqj8hRE3q6/jLqqvfCHj4shLC/2UY7A5Wx+YT8sJ6CUiZZDRw29slnQCdXgn6r+vk /VzVh+Y3e2WVZiBuGzF5+8NVUNI7YH2TUn+mBXPD7c3iwRfRZvuWPpqd8sAKfQl+RS1E b+fg== X-Gm-Message-State: APjAAAWypJV7+CMZ47G+MyuAR/JcuH5WtTu72Ka0harMZrsrN2BVhrOu j/3oH5lb9NxfzDDNPwktgtoYvmaqifIuBeVdLqc= X-Google-Smtp-Source: APXvYqx8otVJLfKf5LFsmC7Bf9qjzzsDlySjqXeAU+Bsn04cLzQcApZgSwxnPTb6qzdWHSBgMY/NoV+s8mRMAaUapgw= X-Received: by 2002:ab0:49e9:: with SMTP id f38mr11563953uad.71.1575082336671; Fri, 29 Nov 2019 18:52:16 -0800 (PST) MIME-Version: 1.0 References: <20191014.043209.919156653743886519.hrs@allbsd.org> <20191015.215732.1618848784026596315.hrs@allbsd.org> <26ba64b2-7c94-f4cf-980d-bcab8aa83bf7@marples.name> In-Reply-To: <26ba64b2-7c94-f4cf-980d-bcab8aa83bf7@marples.name> From: Ben Woods Date: Sat, 30 Nov 2019 10:52:05 +0800 Message-ID: Subject: Re: DHCPv6 client in base To: Roy Marples Cc: Hiroki Sato , Brooks Davis , driesm.michiels@gmail.com, freebsd-net , Hiroki Sato , Julian Elischer X-Rspamd-Queue-Id: 47Pwry3g6Xz4bjV X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=FXW8MLqy; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of woodsb02@gmail.com designates 2607:f8b0:4864:20::932 as permitted sender) smtp.mailfrom=woodsb02@gmail.com X-Spamd-Result: default: False [-1.50 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[2.3.9.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; RCPT_COUNT_SEVEN(0.00)[7]; IP_SCORE(0.00)[ip: (-9.62), ipnet: 2607:f8b0::/32(-2.25), asn: 15169(-1.94), country: US(-0.05)]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; SUSPICIOUS_RECIPS(1.50)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Nov 2019 02:52:20 -0000 On Fri, 29 Nov 2019 at 09:40, Roy Marples wrote: > On 28/11/2019 22:50, Ben Woods wrote: > > It is not yet enabled by default until he gets more feedback from other= s > > that it is working ok. I intend to update the FreeBSD port to enable > > this feature (perhaps with a =E2=80=9C-devel=E2=80=9D port) to allow it= to be tested > > more easily on FreeBSD. > > Please add it as a new port - don't want to affect any current dhcpcd > users with privsep issues. > > I've already fixed a few issues based some initial feedback, but there > is an outstanding issue where dhcpcd will occasionally hang when exiting. > > Roy > Hi Roy, I have just added the new port net/dhcpcd-devel which uses the latest commit (273915d), and enables privilege separation. So far it seems to be working ok for me! Couple of comments / questions: 1. I have setup the low privileged user to be the existing FreeBSD user "_dhcp" [1]. Using a global CFLAG for this seems a bit clunky - it might be nicer if this could either be a configure option or a runtime option. 2. I have configured both /var/db/dhcpcd/ and /var/run/dhcpcd/ to have owner:group as _dhcp:_dhcp (the low privilege processes will have both read and write access to these folders). Is that correct? I note that the commit message referenced below [2] states read access is required to /var/db/dhcpcd/, but the text added to README.md states write access is required. 3. Can you please confirm the output below [3] looks right / matches your privilege separation design? [1] https://svnweb.freebsd.org/ports/head/net/dhcpcd-devel/Makefile?revision=3D= 518697&view=3Dmarkup#l26 [2] https://roy.marples.name/cgit/dhcpcd.git/commit/?id=3D0e5bfa4eb22f7b6412d23= b9548bf157f9fea88c2 [3] privilege separation output: # ps auxwwd | grep dhcpcd _dhcp 7652 0.0 0.0 12232 3012 - S 10:25 0:00.00 |-- dhcpcd: [master] [ip4] [ip6] (dhcpcd) root 7878 0.0 0.0 11724 2852 - S 10:25 0:00.00 | |-- dhcpcd: [privileged actioneer] (dhcpcd) _dhcp 10455 0.0 0.0 11724 2852 - S 10:25 0:00.00 | | `-- dhcpcd: [BPF ARP] wlan0 (dhcpcd) _dhcp 7903 0.0 0.0 11696 2844 - S 10:25 0:00.00 | `-- dhcpcd: [network proxy] (dhcpcd) # ls -lah /var/db/dhcpcd/ drwxr-xr-x 2 _dhcp _dhcp 3B Nov 30 10:28 . drwxr-xr-x 19 root wheel 34B Nov 30 10:28 .. -rw-r--r-- 1 _dhcp _dhcp 300B Nov 30 10:28 wlan0-mySSIDname.lease # ls -lah /var/run/dhcpcd/ drwxr-xr-x 3 _dhcp _dhcp 6B Nov 30 10:28 . drwxr-xr-x 20 root wheel 48B Nov 30 10:28 .. drwxr-xr-x 3 root _dhcp 3B Nov 30 10:28 hook-state -rw-r--r-- 1 _dhcp _dhcp 6B Nov 30 10:28 pid srw-rw---- 1 _dhcp _dhcp 0B Nov 30 10:28 sock srw-rw-rw- 1 _dhcp _dhcp 0B Nov 30 10:28 unpriv.sock # ls -lah /var/run/dhcpcd/hook-state/ drwxr-xr-x 3 root _dhcp 3B Nov 30 10:28 . drwxr-xr-x 3 _dhcp _dhcp 6B Nov 30 10:28 .. drwxr-xr-x 2 root _dhcp 2B Nov 30 10:28 ntp.conf # ls -lah /var/run/dhcpcd/hook-state/ntp.conf/ drwxr-xr-x 2 root _dhcp 2B Nov 30 10:28 . drwxr-xr-x 3 root _dhcp 3B Nov 30 10:28 .. Regards, Ben