From nobody Mon Apr 21 17:43:44 2025 X-Original-To: freebsd-pkgbase@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ZhCRN5yz2z5snN7 for ; Mon, 21 Apr 2025 17:44:16 +0000 (UTC) (envelope-from gordon@tetlows.org) Received: from outbound.mr.icloud.com (p-west2-cluster5-host5-snip6-7.eps.apple.com [IPv6:2a01:b747:3000:206::32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4ZhCRN0WJ2z3VwR for ; Mon, 21 Apr 2025 17:44:16 +0000 (UTC) (envelope-from gordon@tetlows.org) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=tetlows.org header.s=sig1 header.b=awC9FuAr; dmarc=pass (policy=quarantine) header.from=tetlows.org; spf=pass (mx1.freebsd.org: domain of gordon@tetlows.org designates 2a01:b747:3000:206::32 as permitted sender) smtp.mailfrom=gordon@tetlows.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tetlows.org; s=sig1; bh=atLR/R1N4cFv6Z/ERKlQ9OHUEy2VxwCm7ie+RpxYmSM=; h=From:Content-Type:Mime-Version:Subject:Message-Id:Date:To:x-icloud-hme; b=awC9FuArVhFCAj4Hng/yCWkWpImbhiU9iuaXr/LcZ/yV//aw238oWBMJwy1Ux0Gub 0u7bVFVTtcJ1ucVw/4G+RoNmkTRhyqbz95lvlvBn9CzkdE95Q30dD4dA6LxQQdzfBc 3z0pMKCVCJtwWo1L8E3VecyBIvHZ9Qc4m+Ogw7EVwO9Edr3I49MUfebQyGEqyn1Fr3 ei/6CowEza2IeuDI3l8ssSSFkEZzhVIxgveY34vx3tzR3h+TUrElMspUPfKLN1z29I 8mKHZXz3teGhOxb3gXOSm8M/SLOun9DOY18m19sfqJFy9t6Q0U7pzwIN9GLkM1Qctu g8K+U/2HN6rxA== Received: from smtpclient.apple (mr-asmtp-me-k8s.p00.prod.me.com [17.57.152.38]) by outbound.mr.icloud.com (Postfix) with ESMTPSA id BFDE7180128D for ; Mon, 21 Apr 2025 17:44:11 +0000 (UTC) From: Gordon Tetlow Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable List-Id: Packaging the FreeBSD base system List-Archive: https://lists.freebsd.org/archives/freebsd-pkgbase List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-pkgbase@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.400.131.1.6\)) Subject: Splitting critical libraries from interactive shell in runtime package Message-Id: <015C4C6B-1CEC-4398-A8B9-CE21E88C617C@tetlows.org> Date: Mon, 21 Apr 2025 10:43:44 -0700 To: freebsd-pkgbase@freebsd.org X-Mailer: Apple Mail (2.3826.400.131.1.6) X-Proofpoint-GUID: GxT1xGyvdUTpmOIDjMlNikOXpHV2dQ7G X-Proofpoint-ORIG-GUID: GxT1xGyvdUTpmOIDjMlNikOXpHV2dQ7G X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1095,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-04-21_08,2025-04-21_02,2024-11-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 clxscore=1030 spamscore=0 suspectscore=0 mlxscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 mlxlogscore=830 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2308100000 definitions=main-2504210139 X-Spamd-Result: default: False [-0.44 / 15.00]; NEURAL_HAM_SHORT(-1.00)[-1.000]; NEURAL_SPAM_MEDIUM(0.67)[0.673]; DMARC_POLICY_ALLOW(-0.50)[tetlows.org,quarantine]; MV_CASE(0.50)[]; R_DKIM_ALLOW(-0.20)[tetlows.org:s=sig1]; R_SPF_ALLOW(-0.20)[+ip6:2a01:b747:3000:200::/56:c]; ONCE_RECEIVED(0.20)[]; NEURAL_SPAM_LONG(0.19)[0.189]; MIME_GOOD(-0.10)[text/plain]; ARC_NA(0.00)[]; FREEFALL_USER(0.00)[gordon]; RCPT_COUNT_ONE(0.00)[1]; ASN(0.00)[asn:714, ipnet:2a01:b747:3000::/48, country:US]; RCVD_COUNT_ONE(0.00)[1]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; MLMMJ_DEST(0.00)[freebsd-pkgbase@freebsd.org]; PREVIOUSLY_DELIVERED(0.00)[freebsd-pkgbase@freebsd.org]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_NONE(0.00)[]; DKIM_TRACE(0.00)[tetlows.org:+] X-Rspamd-Queue-Id: 4ZhCRN0WJ2z3VwR X-Spamd-Bar: / A while ago, I was playing around with building stripped down jails = based on pkgbase and noticed that /bin/sh and a whole host of = interactive commands is in the FreeBSD-runtime package. This seemed = weird to me as my stripped down jail that is intended to run nginx = should only have the runtime libraries necessary. Including /bin/sh and = friends is unnecessary and would only enable an attacker to gain a = foothold more easily. I recall trying to get it more minimal, but = FreeBSD-runtime is a critical package that must be installed given = things like PAM and some extremely critical libraries (libz, libcap, = libutil, etc) are in this package. So, my proposal/question is, can we split out the critical libraries = from the shell and supporting commands in the runtime package so a = minimal jail could be properly built via pkgbase? What needs to happen = to make that work? Digging around, I found dfr@ asking about this in = https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D273783. There seemed = to be agreement from manu@ that making a shell-free environment is a = good goal we can support. Thanks, Gordon= From nobody Mon Apr 21 23:01:32 2025 X-Original-To: freebsd-pkgbase@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ZhLTX5QS6z5t9xq for ; Mon, 21 Apr 2025 23:01:36 +0000 (UTC) (envelope-from matthew@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ZhLTX2vZVz3NSj for ; Mon, 21 Apr 2025 23:01:36 +0000 (UTC) (envelope-from matthew@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1745276496; 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: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=4dfZr2N2gGdjjXkS9gzZ+la8ToupjB4TSf5flWhi5+8=; b=pj8LeLB0oF86ZO2LznyWwd8ycSuRjK1M4WiJncrUPm5wIh97VTlwBVcrQjMxxVZHSVlQ2/ MDyumt8AkwJLjhbXAI7rrFXPV1u8fZMl3Z2+9bkVOhkwqLDUAO0KJ+af4ny1srB0pJj6rt SeozGM2eXwBTmSJkiccpO0cdDFZ379XTs67mwuCKXLC+0ch/gnPYQSaZnRXRR2nXJ1hEA3 JonqiU4qqiuRGK1C64I/On0cOgrHCWvSzf2YmVCkKD+1pDztftZgxllq3AVNiLJq/8qjjx PJ6iixipEC6dMtR/aAQ6Lyrf1bxjKMGVxoFAtLSNvchJlCulJ9oHA2DNXkurKA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1745276496; a=rsa-sha256; cv=none; b=NGCM2RYXDQiq78LNAno+J9stkG8r+zIB/WG3GgAIOmgCns0btDGcuxRNDbeK2FFTMJLJXk nklnDQJ8n55v9yYC9QuueFjbKs+f2H+pn6d/cB6M872tulCcsHoqYXUzZVvY9wpSvYbGSa 3YZdM6vzXgyWddd1x+rZWCmbJoRWEORtqgUMv7QydxZA2DPz5GuYpNnRupwAUGEREaoQgw FZGGIQdmV7ePUPM4mYPAxC0DzUB7FKNtbbtheQLZlzMWAigO/LbTtTQdm+o6rYeBdpep0a y0kD480Tko5CiGK236cAWNGhdoW97BoSsXBnK3cDuPbbU6Q/99slcW5HBInqjQ== ARC-Authentication-Results: i=1; smtp.infracaninophile.co.uk; dmarc=fail (p=none dis=none) header.from=FreeBSD.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1745276496; 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: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=4dfZr2N2gGdjjXkS9gzZ+la8ToupjB4TSf5flWhi5+8=; b=oKcxRkvs5anga4cAekqJMqQucWWybsqH54kQda6wP6MXwqUad9BlKzgLumV0SXRhb8etjB lfJtxhdwS6EeVFI3/l9Et6yy8LPfR6a3JY1KpIYSe2rhIXKmPfSHfnI9cRC4HSaLKEI7pm Rvg1hew9J4gIErE4bp5WWbYUt6KzJ60U+m+sJ4lX331ztDjws6P1I/MVSyG8ZtPlxgH5+q ZHVUh1Sa9bUAau7i0N/Xj2XI9/CaZWVkCR+swgczhKIa3tK5+D6BKjPQ7kybW6xf/uMXcg oLCO/6JcJOPlA4vn8uBDB9U3gS71d61/WtH+JDMkaE0u2+yPf86bpWBpHs8+5A== Received: from smtp.infracaninophile.co.uk (smtp.infracaninophile.co.uk [IPv6:2001:8b0:151:1:c4ea:bd49:619b:6cb3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: matthew/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4ZhLTX1ZPCzpdd for ; Mon, 21 Apr 2025 23:01:36 +0000 (UTC) (envelope-from matthew@FreeBSD.org) Received: from [IPV6:2001:8b0:151:1:7519:f08a:1c62:6562] (unknown [IPv6:2001:8b0:151:1:7519:f08a:1c62:6562]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) (Authenticated sender: m.seaman@infracaninophile.co.uk) by smtp.infracaninophile.co.uk (Postfix) with ESMTPSA id 12D2E15341 for ; Tue, 22 Apr 2025 00:01:33 +0100 (BST) Authentication-Results: smtp.infracaninophile.co.uk; dmarc=fail (p=none dis=none) header.from=FreeBSD.org Message-ID: <9eb9d383-101a-49a9-b12e-ee598cc5c7e0@FreeBSD.org> Date: Tue, 22 Apr 2025 00:01:32 +0100 List-Id: Packaging the FreeBSD base system List-Archive: https://lists.freebsd.org/archives/freebsd-pkgbase List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-pkgbase@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Splitting critical libraries from interactive shell in runtime package Content-Language: en-GB To: freebsd-pkgbase@freebsd.org References: <015C4C6B-1CEC-4398-A8B9-CE21E88C617C@tetlows.org> From: Matthew Seaman Autocrypt: addr=matthew@FreeBSD.org; keydata= xsFNBFJIL80BEADi7/VbnnErDU6pjEhI/SzEZ/HbDRkJ5g7HroAtqIRm6nj8ZwOAgZ/2ZnWn 5F+fXTuLsG0FLNtkd17FoVcuCi5e/GPliXI5cmamV7E1Yz4T8UsJ7RQolimyxVexccKd16Tc AA7B9bFlJSKkBUSD0buj7VjT07xWhRzu6Vgi5r0UjLALYJz977uZA0F1aOGOXREDEAOhdcNc kSNjynqAwDA6dCT1Elpi4key1fYjv4jyDF+GU/YXul2Y/rguA8FCkHd9vyym5eAsLQ5mG00V V9fkEHIpH5KorNVnl/ufHXnkZqmHA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deNYYu1HIb4GbfeEODiK2xQ40dDPwpucSQmZ0FeHfnkO7hgIRlywbIyG8p4HHuKR01/W 07pOGGRA6F8GRoI+m38ARe+r/2W4HlrJnS/+POKm6lu67wdtcBNqeYF3rcgrvh08bqZtIaEt GoyZ54tRpoWq6aTXvI88T5oABwZKn95m5KAvUlQ15IOGF049uAN4APOExOtqVNcvQPypeRCo OTShW20C1ZM3ZaRc39alDu3bj1S24K/Ldav8Qe+kzWs744Tu+QytbWtpr+gvkrpPVXdFiFiD uCF3WQZrTdTr3Nm5ES2ePV2YW02M837VnmW8hm9id3iiBawyhdUyNtSPXXGTZSMD/TZ8urv2 R3xMkpoh2j5PIJ4cF2ZJEz/VOaWv6LN4/+MgC7icVyUldoOZeWFjLS2YBgy50ICICmCefF4e kMGcbPi9+OAd1lLYwkLd1AAhQu1JPU163KW8/Bkc/FqrzE0iJxX9N3I3Zyt3uswd1+7Lxisw WZdkvBJvTpHtp1CeiA794MDJEVQfI9o5icfRBNOoPJM8c56FTs19JmiH35KSh45LpcSbDr3t In-Reply-To: <015C4C6B-1CEC-4398-A8B9-CE21E88C617C@tetlows.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: base64 T24gMjEvMDQvMjAyNSAxODo0MywgR29yZG9uIFRldGxvdyB3cm90ZToNCj4gQSB3aGlsZSBh Z28sIEkgd2FzIHBsYXlpbmcgYXJvdW5kIHdpdGggYnVpbGRpbmcgc3RyaXBwZWQgZG93biBq YWlscw0KPiBiYXNlZCBvbiBwa2diYXNlIGFuZCBub3RpY2VkIHRoYXQgL2Jpbi9zaCBhbmQg YSB3aG9sZSBob3N0IG9mDQo+IGludGVyYWN0aXZlIGNvbW1hbmRzIGlzIGluIHRoZSBGcmVl QlNELXJ1bnRpbWUgcGFja2FnZS4gVGhpcyBzZWVtZWQNCj4gd2VpcmQgdG8gbWUgYXMgbXkg c3RyaXBwZWQgZG93biBqYWlsIHRoYXQgaXMgaW50ZW5kZWQgdG8gcnVuIG5naW54DQo+IHNo b3VsZCBvbmx5IGhhdmUgdGhlIHJ1bnRpbWUgbGlicmFyaWVzIG5lY2Vzc2FyeS4gSW5jbHVk aW5nIC9iaW4vc2gNCj4gYW5kIGZyaWVuZHMgaXMgdW5uZWNlc3NhcnkgYW5kIHdvdWxkIG9u bHkgZW5hYmxlIGFuIGF0dGFja2VyIHRvIGdhaW4NCj4gYSBmb290aG9sZCBtb3JlIGVhc2ls eS4gSSByZWNhbGwgdHJ5aW5nIHRvIGdldCBpdCBtb3JlIG1pbmltYWwsIGJ1dA0KPiBGcmVl QlNELXJ1bnRpbWUgaXMgYSBjcml0aWNhbCBwYWNrYWdlIHRoYXQgbXVzdCBiZSBpbnN0YWxs ZWQgZ2l2ZW4NCj4gdGhpbmdzIGxpa2UgUEFNIGFuZCBzb21lIGV4dHJlbWVseSBjcml0aWNh bCBsaWJyYXJpZXMgKGxpYnosIGxpYmNhcCwNCj4gbGlidXRpbCwgZXRjKSBhcmUgaW4gdGhp cyBwYWNrYWdlLg0KU291bmRzIGxpa2UgYW4gaW50ZXJlc3RpbmcgaWRlYSwgYnV0IHdoYXQn cyB0aGUgYWx0ZXJuYXRpdmUgdG8gc3RhcnQgDQpuZ2lueCB3aXRob3V0IC9iaW4vc2ggZm9y IHRoZSByYyBzY3JpcHRzPyAgSG93IGRvZXMgdGhhdCB3b3JrPw0KDQoJQ2hlZXJzLA0KDQoJ TWF0dGhldw0KDQoNCg0K From nobody Tue Apr 22 16:39:17 2025 X-Original-To: freebsd-pkgbase@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Zhny40Tqcz5ssPK for ; Tue, 22 Apr 2025 16:39:24 +0000 (UTC) (envelope-from wollman@khavrinen.csail.mit.edu) Received: from khavrinen.csail.mit.edu (khavrinen.csail.mit.edu [IPv6:2603:400a:0:7ec::801e:1c14]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature ECDSA (prime256v1) client-digest SHA256) (Client CN "khavrinen.csail.mit.edu", Issuer "E5" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Zhny341BLz45Ss for ; Tue, 22 Apr 2025 16:39:23 +0000 (UTC) (envelope-from wollman@khavrinen.csail.mit.edu) Authentication-Results: mx1.freebsd.org; none Received: from khavrinen.csail.mit.edu (localhost [127.0.0.1]) by khavrinen.csail.mit.edu (8.18.1/8.17.1) with ESMTPS id 53MGdHLh083035 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO CN= issuer=); Tue, 22 Apr 2025 12:39:17 -0400 (EDT) (envelope-from wollman@khavrinen.csail.mit.edu) Received: (from wollman@localhost) by khavrinen.csail.mit.edu (8.18.1/8.18.1/Submit) id 53MGdHSa083034; Tue, 22 Apr 2025 12:39:17 -0400 (EDT) (envelope-from wollman) List-Id: Packaging the FreeBSD base system List-Archive: https://lists.freebsd.org/archives/freebsd-pkgbase List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-pkgbase@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <26631.50741.155084.424170@khavrinen.csail.mit.edu> Date: Tue, 22 Apr 2025 12:39:17 -0400 From: Garrett Wollman To: Gordon Tetlow Cc: freebsd-pkgbase@freebsd.org Subject: Re: Splitting critical libraries from interactive shell in runtime package In-Reply-To: <015C4C6B-1CEC-4398-A8B9-CE21E88C617C@tetlows.org> References: <015C4C6B-1CEC-4398-A8B9-CE21E88C617C@tetlows.org> X-Mailer: VM 8.2.0b under 30.1 (amd64-portbld-freebsd13.4) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.4 (khavrinen.csail.mit.edu [0.0.0.0]); Tue, 22 Apr 2025 12:39:17 -0400 (EDT) X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:3, ipnet:2603:400a::/32, country:US] X-Rspamd-Queue-Id: 4Zhny341BLz45Ss X-Spamd-Bar: ---- < said: > A while ago, I was playing around with building stripped down jails > based on pkgbase and noticed that /bin/sh and a whole host of > interactive commands is in the FreeBSD-runtime package. This seemed > weird to me as my stripped down jail that is intended to run nginx > should only have the runtime libraries necessary. Including /bin/sh > and friends is unnecessary and would only enable an attacker to gain > a foothold more easily. Part of the functionality of the standard C library is implemented in the shell. You probably don't need any of these functions, and maybe given your security posture you would prefer if they didn't work. POSIX generally requires a shell. I think pkgbase is perhaps not conceived for this application: a shell is not normally thought of as an optional component. -GAWollman From nobody Thu Apr 24 04:35:41 2025 X-Original-To: freebsd-pkgbase@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Zjjp92tLNz5tTQn for ; Thu, 24 Apr 2025 04:35:45 +0000 (UTC) (envelope-from ivy@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Zjjp921rgz3XfR; Thu, 24 Apr 2025 04:35:45 +0000 (UTC) (envelope-from ivy@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1745469345; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=faR82Vf/+Qq2gpkHiNQ5u8djTxG6xCi0nxgyvD5sbK8=; b=A+dE/b1rurdjcMGrmA5E9xejpfUxeE2DqHERov2OSAfI7jlgzr4tMu9xxuuQjf2QiJZzvm Je8ygKcucL0sTmbOTWxhbPGp6EJvbDjCDDo4KAjA/gRNyJ1cjwo8G1HVasAb69sw1/2P11 GTbYGtib3miEytz1vblwKZfYStmtuQzbDFa2OF9mFp8mMCKDhe8dnXocCdjYqxmEGh3R58 AwXecDVLNezWjQHcwGluILR8EvZGRGTnuFFlSfmiw845kNWAo6mwze/sOKBZEkQqqvO/Vd aIoIkjDGo9hXjqMXPQr8evJcj8aBLQgV5zLDhBc831+W2mFVk/dIxxEzt2XJQQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1745469345; a=rsa-sha256; cv=none; b=LztvrfTcDC1Szpk0TdOJw4XU9XDzXH1XzlH8uLtrjP/zzS4B0Fu3oksaZJGa8s91a24OQl 3ojBxi8LR0VV6PtH/TeaWyxao8I3RPWViOh8y8j+5H+lWPylz5wxK/cMkfvBKjDi5jEMGn gL9K3WTslRR1oLvwzrz5tXEO2tLFHWad/bCM0K8MASD8Tv06/tIBYgN4OQZ6tFP7TNvgT0 nSRzw/S40cuWpRfjUO1vJAPhP4uYPCVfqK8VZR7fCDNAcRgKhBNt+5Ke+cwh+KgcD5zqTr sEYqi/UFx6eb6i8PQnC5MZxdqXYGQY9hBHVjQeu0anTRnMFmM9Dos4XS7YHIIQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1745469345; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=faR82Vf/+Qq2gpkHiNQ5u8djTxG6xCi0nxgyvD5sbK8=; b=aFqxfqXlPiksQdGbbzEJyRs/Ijco6ht28WSbhk8UOlyQdlvK6GdmumBYnWPoFH2MAlGw/M lSieEc/MFBBWGuOMyIpcPC9nyynlpLpf0rCEt2MM22oaR17Nr8no+bfivGG0z0qshiKRCt yLb5VJdlLLb2ScZLLusYdublZGcB2e3qSVgu6CBEZAJqcJhjjUCnKkQP1Tc6dAaLZ1IVG+ TKjiUeEPjdBSvFphoBHR1qUo/XmVwJcSLkjHUTL5wjSPEH8itLrxtSKteB1Zibh245MdQ/ D3bcGSO2kRKFciljTgAwhbGiBnJNzz7JSfTBeAnvHNbBhJ34k8FDuXAuEaf2sQ== Received: from ragweed.eden.le-fay.org (ragweed.eden.le-fay.org [IPv6:2001:8b0:aab5:c401:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: ivy/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4Zjjp86FWLz10vV; Thu, 24 Apr 2025 04:35:44 +0000 (UTC) (envelope-from ivy@FreeBSD.org) Date: Thu, 24 Apr 2025 05:35:41 +0100 From: Lexi Winter To: Gordon Tetlow Cc: freebsd-pkgbase@freebsd.org Subject: Re: Splitting critical libraries from interactive shell in runtime package Message-ID: References: <015C4C6B-1CEC-4398-A8B9-CE21E88C617C@tetlows.org> List-Id: Packaging the FreeBSD base system List-Archive: https://lists.freebsd.org/archives/freebsd-pkgbase List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-pkgbase@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Y+5PulfOtRdoPKFF" Content-Disposition: inline In-Reply-To: <015C4C6B-1CEC-4398-A8B9-CE21E88C617C@tetlows.org> --Y+5PulfOtRdoPKFF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Gordon Tetlow: > A while ago, I was playing around with building stripped down jails > based on pkgbase and noticed that /bin/sh and a whole host of > interactive commands is in the FreeBSD-runtime package.=20 > [...] > So, my proposal/question is, can we split out the critical libraries > from the shell and supporting commands in the runtime package so a > minimal jail could be properly built via pkgbase? i see no reason not to do this. FreeBSD-runtime is the default package that everything else gets lumped into if it hasn't been moved elsewhere, so there are definitely things in there that shouldn't be. however... i believe there is a general desire to not have a separate package for every single command, so you may need to put some thought into the most useful way to organise this. for example, perhaps it makes sense for FreeBSD-runtime to be a metapackage which depends on other required packages for a functional basic interactive system. you'd also need to make sure you don't break everyone's system when they upgrade and don't realise /bin/sh is in a different package that they neglected to install. > What needs to happen to make that work? the short version is you need to add PACKAGE=3Dxxx to the Makefiles for the things you want to move, and then add dependencies in release/packages/ for other packages which require /bin/sh, e.g. FreeBSD-rc. > Digging around, I found dfr@ asking about this in > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D273783. There seemed > to be agreement from manu@ that making a shell-free environment is a > good goal we can support. as i write this, Bugzilla seems to be offline, buf if there's an existing PR i trust that some people have already brought up some of the obvious issues that come to mind. --Y+5PulfOtRdoPKFF Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQSyjTg96lp3RifySyn1nT63mIK/YAUCaAm/nAAKCRD1nT63mIK/ YO5fAQCbPmcNYfALjU+97miUuRtBvqRSh3k0708vjgynxfFnzwD/ZcdXhiDYOoL4 CyablTaPIubFa//dBGI6lQyc2o7KYwU= =1hGn -----END PGP SIGNATURE----- --Y+5PulfOtRdoPKFF-- From nobody Thu Apr 24 06:35:01 2025 X-Original-To: freebsd-pkgbase@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ZjmS16Zdzz5tbj3 for ; Thu, 24 Apr 2025 06:35:13 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mx.blih.net (mx.blih.net [212.83.155.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4ZjmS12SSqz3kCg; Thu, 24 Apr 2025 06:35:13 +0000 (UTC) (envelope-from manu@bidouilliste.com) Authentication-Results: mx1.freebsd.org; none Received: from skull.home.blih.net (mwc0868.ftth.cust.milkywan.net [45.13.107.196]) by mx.blih.net (OpenSMTPD) with ESMTPSA id cd72661a (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Thu, 24 Apr 2025 06:35:05 +0000 (UTC) Date: Thu, 24 Apr 2025 08:35:01 +0200 From: Emmanuel Vadot To: Lexi Winter Cc: Gordon Tetlow , freebsd-pkgbase@freebsd.org Subject: Re: Splitting critical libraries from interactive shell in runtime package Message-Id: <20250424083501.71d047f2ecf04f29d4383062@bidouilliste.com> In-Reply-To: References: <015C4C6B-1CEC-4398-A8B9-CE21E88C617C@tetlows.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; amd64-portbld-freebsd15.0) List-Id: Packaging the FreeBSD base system List-Archive: https://lists.freebsd.org/archives/freebsd-pkgbase List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-pkgbase@FreeBSD.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:12876, ipnet:212.83.128.0/19, country:FR] X-Rspamd-Queue-Id: 4ZjmS12SSqz3kCg X-Spamd-Bar: ---- On Thu, 24 Apr 2025 05:35:41 +0100 Lexi Winter wrote: > Gordon Tetlow: > > A while ago, I was playing around with building stripped down jails > > based on pkgbase and noticed that /bin/sh and a whole host of > > interactive commands is in the FreeBSD-runtime package. > > [...] > > So, my proposal/question is, can we split out the critical libraries > > from the shell and supporting commands in the runtime package so a > > minimal jail could be properly built via pkgbase? > > i see no reason not to do this. FreeBSD-runtime is the default package > that everything else gets lumped into if it hasn't been moved elsewhere, > so there are definitely things in there that shouldn't be. Not anymore, FreeBSD-utilities is the default package for a long time now. > however... i believe there is a general desire to not have a separate > package for every single command, so you may need to put some thought > into the most useful way to organise this. for example, perhaps it > makes sense for FreeBSD-runtime to be a metapackage which depends on > other required packages for a functional basic interactive system. The rational for FreeBSD-runtime is that if you have it (and -clibs since it's a dep) you can boot to single user and have (almost ?) every tools needed to repair your system. > you'd also need to make sure you don't break everyone's system when they > upgrade and don't realise /bin/sh is in a different package that they > neglected to install. Yup, that's the main problem without pkg groups right now. > > What needs to happen to make that work? > > the short version is you need to add PACKAGE=xxx to the Makefiles for > the things you want to move, and then add dependencies in > release/packages/ for other packages which require /bin/sh, e.g. > FreeBSD-rc. > > > Digging around, I found dfr@ asking about this in > > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=273783. There seemed > > to be agreement from manu@ that making a shell-free environment is a > > good goal we can support. > > as i write this, Bugzilla seems to be offline, buf if there's an > existing PR i trust that some people have already brought up some of the > obvious issues that come to mind. -- Emmanuel Vadot