Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 29 Mar 2022 14:14:28 -0400
From:      Shawn Webb <shawn.webb@hardenedbsd.org>
To:        Mathieu <sigsys@gmail.com>
Cc:        freebsd-hackers@FreeBSD.org
Subject:   Re: curtain: WIP sandboxing mechanism with pledge()/unveil() support
Message-ID:  <20220329181428.n3db2x57nnn64yfx@mutt-hbsd>
In-Reply-To: <25b5c60f-b9cc-78af-86d7-1cc714232364@gmail.com>
References:  <25b5c60f-b9cc-78af-86d7-1cc714232364@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--nle2gt4bfiwu4icn
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Mon, Mar 28, 2022 at 05:37:44AM -0400, Mathieu wrote:
> Hello list.=A0 Since a while I've been working on and off on a
> pledge()/unveil() implementation for FreeBSD.=A0 I also wanted it to be a=
ble
> to sandbox arbitrary programs that might not expect it with no (or very
> minor) modifications.=A0 So I just kept adding to it until it could do th=
at
> well enough.=A0 I'm still working on it, and there are some known issues =
and
> some things I'm not sure are done correctly, but overall it's in a very
> functional state now. It can run unmodified most utilities and desktop ap=
ps
> (though dbus/dconf/etc are trouble), server daemons, buildworld and whole
> shell/desktop sessions sandboxed.
>=20
> https://github.com/Math2/freebsd-pledge
> https://github.com/Math2/freebsd-pledge/blob/main/CURTAIN-README.md
>=20
> It can be broken up in 4 parts: 1) A MAC module that implements most of t=
he
> functionality.=A0 2) The userland library, sandboxing utility, configs and
> tests.=A0 3) Various kernel changes needed to support it (including new M=
AC
> handlers and extended syscall filtering).=A0 4) Small changes/fixes to the
> base userland (things like adding reporting to ps and modifying some
> utilities to use $TMPDIR so that they can be properly sandboxed).=A0 So 1=
) and
> 2) could be in a port.=A0 And I tried to minimize 3) and 4) as much as
> possible.
>=20
> I noted some problems/limitations in the CURTAIN-ISSUES file.=A0 At this =
point
> I'm mostly wondering about the general design being acceptable for merging
> eventually.=A0 Because most of this could be part of a port, but not all =
of
> it.=A0 And the way that it deals with filesystem access restrictions in
> particular is kludgy.=A0 So any feedback/testing welcome.
>=20
> It still lacks documentation (in part because I'm not sure of what could
> still change) so I'm going to give an overview of it here and show some
> examples and that's going to be the documentation for now.=A0 And I'll
> describe the kernel changes that it needed.=A0 So that's going to be a bi=
t of
> a long email.

Hey Mathieu,

Thanks a lot for working on this! I'm incredibly excited to see this
work progress and mature.

I'd love to start reviewing your work. One thing that would make it
easier to review would be if you used a feature branch rather than
relying on the main branch. That way, a simple `git diff` command
could be used to generate a diff between your code and stock freebsd.

If you'd like an example of that, take a look at HardenedBSD's
repo[0]. We have two relevant branches:

freebsd/current/main <- FreeBSD's sources
hardened/current/main <- HardenedBSD's patches applied on top of
    FreeBSD's sources

Users can then simply run `git diff origin/freebsd/current/main` to
see all the changes we've made (assuming the user is currently working
on the hardened/current/master branch.)

[0]: https://git.hardenedbsd.org/HardenedBSD/hardenedbsd

Thanks,

--=20
Shawn Webb
Cofounder / Security Engineer
HardenedBSD

https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/raw/master/Shawn_Webb/03A=
4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc

--nle2gt4bfiwu4icn
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEA6TL67gupaZ9nzhT/y5nonf44foFAmJDTIIACgkQ/y5nonf4
4foWABAAhOzaiAR80J3PwjwIJEdbD3i74BXyi4TkqrhSlcuOFz+i7eoYbjYYrXyZ
K4bKvziS+zeAB2Hml80+sa2f/Zw2pJHIenDkmQPPB1pSeGVAyxB4CoYXbkcQtctN
hch2cbyBZswCv9U4Wc4KvxMys87R57I6oyX+DSPeZVfAJUjWbvbvXjakdEhyoGUj
EN0MqtEVcuMStliDTlfZuPOTyQMP+VOTWNyl+6vDenxce/OGmw65Kyd7g8v8sfbZ
hkP0s1Npye+ApDCdwG9SCQRkrZwoYdVNlA48flf5Q7zDRfVSnV2mEfbhjmHo5qya
dVVihLkLVewETSSap/WtRlg2tp7e04lzsfH8NgD8ICZE16gOFlhbnykNNeOkhmqZ
SyN8t5JOzR77KlPbp3qqymOxdWBYyt15Nq4tt1aerRVVFUOIIJpvNQL8NAMI1uzi
u3KB92Ks30Odewc11ax0IXn90yxLmDQ99M9TMW02mDJUpuWKH0tHisxd+nk/wC+J
1OOcr4+X2E72//V0M6QQk43XbOHH5sSnIyM5saLL0gCfREHI3KgH/sxj0sr5lscv
jk/FNiErYRKPg4F+Wk5FS20R8HDyMQmhsMkWCAVe8MvWTUsdCjSIy/wykJhd01S0
+Ss5831DOHTJU2j98livG2FCOxO2TPDAy74hY6mPMxlFxMY73Tk=
=kGuv
-----END PGP SIGNATURE-----

--nle2gt4bfiwu4icn--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20220329181428.n3db2x57nnn64yfx>