All right, hello everyone, my departmental welcome to my talk, sit an introduction to secure
applications and box info Linux. Before I start giving you the fish, I'll teach you
how to fish, so we have a CTF game, you can go with SSH or HTTPS, you have a browser or a
server, just go back, try to read the file it is CTF, sit box is the only layer between
you and that file, if you get to read it there's a price and we have a git, we get
several extensive documentation in the form of manual pages and mailing list and so on
so, I'll just wait a bit for everyone to take a photo, all right, okay, so let's start a bit
of history because I am and what XRB is and how sit box happened. I've been a free software
developer for the good part of the last 20 years and I started with Gentle Linux through
the Gentle Sunrise project and as some of you may know, Gentle Linux is a source place
rolling noise distribution, so every user gets to compile their own software on their
on machine, such as scenarios and boxes and is pretty much required to detect package
build new subs. Here you should be careful, we are saying package build new subs not malicious
build, it's really easy to get out of the Gentle Sunbox. So Gentle Sunbox, back in the day,
I'll be pretty loud based on box and it has no network restrictions. I'll be pretty
loud if you don't know is a dynamic hooking mechanism and it can be bypassed by static builds
or directly running the Cisco yourself. And then XRB looks up on around 2008 and it was
started by a group of extended developers with the idea to do Gentle Right. I will not go
deep into XRB here but there are two working recommended watches on YouTube by Brian who
started to hold things up. And for that purpose is the importance of XRB is
XRB unlike Gentle has package testing on by default, so before you install each package
you get to run their tests on your machine as well. And then I joined XRB around 2008 to write
about the Sunbox. And Sidbox 1 was the first for stable release back then. It was written
and C and was based on P3. And we had networks on box and before even network namespaces
were now so it was pretty cool. We could restrict builds to loop back interface and we had
XRB to limit execution of pinearies. And then Sidbox 1 is stable now and has been and
is still being used as the default sandbox of XRB. And over the time I've started doing experiments
and Linux has also made new achievements in terms of sandboxing such a sec compound lock and so on.
And Sidbox 2 was never really released. It was based on my experiments to actually make
Sidbox a security boundary. Security boundary is in both Sidbox 1 and Gentle Sandbox actually
continue the system calls after the access checking the sandbox process and as such there were
very well known to be weak for time of check to time of user packs. And then Sidbox 3 happened
around two, three years ago I think and it was a complete, I wrote it from scratch in Rust
because it was for me. Right in NC was was getting really hard and Rust was going to be
a nice choice. So what is Sidbox 3? And I will say Sidvan I say Sidbox 3 we decided to
make the sit slotting the binaries is easier. It's an application kernel to sandbox applications
on Linux. I say the application kernel because Sidbox does not continue the system calls in
the sandbox process rather runs the system calls on their own after the access check and as such
is not vulnerable to time of check to time of use. It's written completely and Rust the only
non- Rust dependency is lipstick on which is why they are available everywhere. You can install
it with cargo make sure to pass the lock to otherwise you may get dependency issues. It's nice
since GPL3 it's forever free. It requires that a lot of really old-ish Linux version 5.19 and with
configs a computer which is pretty much enabled on every Linux distribution these days.
The have relatively good portability across architectures we test around seven architectures in
OCI and it's relatively minimal work to make Sidbox work on any market architecture given
nips account has support for it because in Sidbox there is a lot of little architecture
dependant code. So what is our philosophy? Sid has the idea to make
Sidbox in as easy and as accessible and stack searching is with crap. You may think that
is not that easy. Sid is also not that easy but once you get to know that you will understand.
So we will be one of the unix philosophy to do one thing and do it well. We do sandbox in
not and else because when you do system call intersection many fancy features are possible but
no we try to keep it to a minimal and our idea is to give you a simple interface for all the
complex sandbox and mechanisms such as sec, comp, land, lock, user namespaces and so on.
These are all brittle and difficult to use but we abstract them out with a simple API and give
this to you. Sid is secured by default with minimal over hat. Secured by default as in you don't
need to read books to start using Sid all options in Sid has the most secure alternatives
elected and if you want to want to disallow things then you need to know and then no extra
probability is required. This is very important for us. We have no code in Sid that uses
said to you ID, B, P, F or Linux, Canon modules or any sort of any sort of extra period of
images. You can just drop to binary as it's regular user and just run it. As a logical result of
this it can also be used as a logential for this one in the city of silver world already you are running
Sid as a logential right now. So let's start with our basic features. We do path sandboxing like
a partner does not like a ceiling of stars as such we don't label or do I not based.
We do path sandboxing so we have read sandboxing and path masking, path masking means any
action is performed on death now instead of to file itself and we have write sandboxing and
appendomly paths. Again this is a nice example Linux does have appendomly paths as a file system
like you can change with CHA to TR. However this is privileged unlike in Sid which is not privileged.
Again on the city of silver the bashy story file is appendomly so good luck covering your tracks.
And we have stats and boxing and path hiding so you can actually change the visibility of
IEL that so it's completely invisible from the process. Here are the files and boxing to contain
AIML workloads this is the fancy bit right. But it's not as fancy as in GYzer we do not actually
keep track of all NVIDIA octials but we have learning mode so that gets easier. I'll show you in a bit.
We have networks and boxing and we have this and we have support for Unix IPv4 IPv6 net link and
channel crypt API circuits and there is some features we have application level firewall and with
IP blocklists. And our category sandboxing categories are similar to those who know about
latch we have refined sandbox categories. I have listed them here like you can say allow
read allow write or so on like you can use all these categories for sandboxing. On top of this
we have execution control and this part depends on P3s. You can completely disable this part if
you want but it comes with my school days that you may be interested in. As I said it requires
P3s and we have set the gap for those who know GL security or who use Harden PST even know.
So GBGAT is an idea to block execution of pandaries if they are crashing the P3s. And this is
a nice example where we have two different features of CID working together. We have a wide range of
trigger signals from GL security so you can actually add sandboxing rules to trigger SIGBGAT.
And such here is a simple rule I list of key read plus it is CIDO. If you try with this rule
if you try reading it CIDO 5 times and the binary you try to read will be within I list of PIGGGAT.
And then you have 4 sandboxing or verify the execution to be more exact like we have.
You can verify binaries and library integrity at X2 and I'm not time. This is like very
exact of net BST or Harden PST's integrity force. Harden we have a longer list of supported
algorithms and again the default is the most secure one you can guess. We have trusted
protection again this is similar to GL security and Harden BST. This with SIGBGAT actually
prevents a lot of attack vectors such as someone, imagine someone confusing you to execute
someone under TMP or such. This prevents that. And we have nice to have like we have a lot of
features I cannot go through all of them here. I'll start going a bit faster. We have sandboxed
lock and dynamic configuration. You can do step-by-step configuration in CIDO as you do with
pledge you can run multiple pledge cones by taking away the privileges from the process and
you can do the same with CIDO. You can configure CIDO from CIDO. This is the idea. And we set
AT secure auxiliary vector by default like a parmode does. I think in CIDO next you can do this
too. The idea is to prevent all the library penalty preload and all those from work. And
another prime feature of CIDO is we reinforce positionally independent executables and therefore
ASLR and also an executable stack. And you can disable based on business like you can disable
32 binaries or static link binaries or dynamic binaries or even scripts. And so on these are
these are all you can also set dynamically as I said. We have a deviant-like fake route with
a route fake option. This one is a small one. First you must be trace force you must.
You can actually force a UMask to be passed to CH mode and all that. So given you have set
trace force you must 7177. The sandbox process is not actually going to make anything executable.
Trace denied dot-dot is for path traversals and so on. You must be used in a web server
right to attack them. And as a yes this is our first light last light and as a bonus we have
landlock. You can use it with landlock. We provide a nice API for it as well and this way you can
actually make a tool layout sandbox. Proxy sandbox is another one where we put the sandbox process
into a network name space, bind a port to the loop back, send a port to the outside and then
some pump process does the forwarding. So this way you can completely prevent DNS leaks and so on
that are commonly problematic in toy usage and such. And we have memory and pits and blocks in
again these are unprivileged. You should and must use control groups when you can but using control
groups typically require an entity to set up the control groups and on the unprivileged entity
using it. So then you don't have them you have these. Safe set IDs for safe user and group
civics and so this is typically used in demons that change user to an unprivileged user. This
way you can also make sick change user with it. So this is the idea and we have ghost mode
is a bit of a fancy mode. For those who know second level one we'll understand ghost mode is
where it actually closes the second 45 file descriptor and such there it attaches it from the sandbox
process and all hooked Cisco's from that point on start to return inosis. This means you can
open your files, open your connections, enter this mode and then it's all the resources you have
you cannot open anything new anymore. So you can have a very confined server this way.
On top of this we have namespaces and containerization and cdlci which I'm going to give another
talk today. Everyone is invited in containers to have them about this. And finally we have
learning mode with Pandora and that I'm going to display right now hopefully it will work. So let's see
can everyone read what's written here? It's a big thought command line. I will explain to you
don't don't this get. So Pandora profile is what you do actually like you can do Pandora profile
unless and it will give you a file. This is how easy it is but we will actually and it will give you
a profile right. I will show you a bit more about this but let's do file for x first.
However, Pandora cannot figure out everything about the sandbox process so you have to pass some
options to sit. And here we pass three options. One of them is a lot of unsafe memory. This is
because it's sit by default enables the x restrictions memory deny right execute. And the
file folks won't work with that because of just in time compilers and so on. A lot of unsafe
lip see is to prevent to actually enable to prevent setting a t-secure oxidative vector,
darbile aldeeperilote is usable inside the sandbox process. And Firefox has the aldeeperilote sandbox.
This is how they make them use it. And allow unsafe file name is sit by default prevent
prevents shell special characters in your files. However, nozzle file folks actually creates
profile names with curly braces so you have to be able to do this as well. And finally,
this filter rate is done to be about this is for filtering out process name changes which we also
prevent because this is typically what your malware does as the first step. So I'm going to go
as a private window to reach us that work now. Let's see, we have Firefox running here just normally.
And let's try to play a game, just real quick, just to show you 3D also works. And I'll try to get
checkmate to 3D quick. Okay, it won't work. I was hoping you five and then could be useful.
But whatever. All right, so 3D is working right. So, so let's actually shut this down now and come
to the fancy part. But I will take a bit to generate the profile. It takes a bit because it
checks some of the binaries and so on and how it's finished. Now let's take a look, quick look at the
at the profile. So these are the options we have passed manually. This is the profile directory.
Pet component limit is by default 3. You can make it longer than have bigger profiles and so on.
That's up to you. The cache directory, Devinal and so on. And here we see x-axis pulse, audio
access and so on, access to the system bus socket and then we have Firefox. And then we have the
network accesses. And here where it gets a bit funcier, right. And the Pandora does the
needful to reverse the NS, so you get a comment. And here we have all the connections that
it did. And even we are in private to use a private mode and only going to leaches somehow.
It's still access to Google. I don't know why. But the more you just see the more you understand
everyone is tracking you, even if they say they don't. Anyhow, I'll scroll a bit down to be fast.
These are all the libraries and so on. I should show you the IOK. Here is the IOK request
that are actually done by Firefox. These are mostly DRM requests and these are also 3D acceleration
and so on. Finally, we have executable verification where you have detections of all the binaries
and libraries included that Firefox type execute and these are all listed here. All right.
I will not do any changes to this file and I will just try to execute Firefox with this now.
And this is now running in in first mode and citizen using this profile. Now I'll try to go to
leaches and as you can see it just works. But if I try to go to some other website, it's not going
to work. So you can have a profile that just goes to one site like or you can also do some kind of
kid mode or whatever and you just make it complete playing a game still works.
Hopefully, yeah. OK, let's try it and check me to the again.
No, I'm not lucky today. Anyway, this is all I have to show. And yes, thank you everyone for listening.
I can take questions.
OK, that's a big question. It looks one more GPL2.
I should repeat the question. Why is it GPL3? Because all right.
It's not as long as GPL2, we upgraded it to GPL3 and GPL as far as I know is the only
only license test on court, like real life use it. So that's the only license that I trust.
But I'm not to have angelic licenses to be honest, but test one, that's free and that's test on court.
We have one question from the metrics channel. What a very thing system is best to build this
on and what are your requirements? OK. Yes, it's still only works on Linux because it depends on
second, but architecture, why you can't run it on any architecture 32 bit 64 bit is fine. Apart from that,
sit by default only use neat second. And this is by default enabled in almost every canvas.
You don't need to enable anything. If you need to enable landlocked, then you need to enable
config landlocked and add landlocked to config LSM. That's only need to get it set up there.
Yes, please. Do you have any docs where I could start reading and start to get interested?
Yes, go to Monday, take some Linux.org. You can also get them installed. I should have the
piece of the question here. Why can I learn more about sit was the question? I'm sorry,
this is my first talk. We have extensive manual pages and they're also converted to HTML. So
just go to Monday, like said, Linux.org. Start with sit that seven and sit that two manual pages.
You learn a lot and just come over. I'll see you and ask if you want. Yes, please.
Do I have performance numbers? I do have performance numbers. It's on in the GIT-3 benchmark.
Director, you can check them out, but the typically sit comes with 10 to 15 percent of our head.
We have also one follow-up question on the metrics about the requirements that like the
mask moon was trying to run at them that they didn't work for.
If you can follow-up on the metrics. All right, all right. I'll do that. I'll do that. Oh, sure, sure.
Any other questions in the audience here?
Yes, please.
The profile is established. Yes. Yes, of course.
Exactly. You can just delete the Google there and just run sit like that and it will. It's
only able to access Google anymore. It says something out of generated. I want to show you learning
what makes this very easy, but you can do whatever you want with the profile. It's just a text-based profile.
Yes, please.
There is no panel component. Yes. Does it work?
Quantity and user space is the question. Yes, it is just a simple
unique tool. You don't need to say to ID. You don't need to be here. If you don't need that,
and everything works as an unprivileged user, so you don't need anything for this.
Any other questions? Yes, please?
Yes, yes. Yes, of course. Let me repeat the question. I'm wrong.
About the dynamic configuration, the question is how to do that, actually. It's really easy,
and you can do it with the shelters. The idea is to make static requests under the virtual pad devsit.
So you do devsit, allow it, it is easy, for example, and you start this pad. And starting means
test-minacy, for example, in your shell or anything you can use. You can use shells. We also have
lip-sit, you can use for this for the API. But it's pretty easy, and this is what we use in
acceptable. We use computer utilities for this. Yes, what you see any advantage in running
sit in a containerized environment for software that is happening in the cloud.
Okay, if you're underpitting the question, if you see this, is a good idea to run in containerized environments.
This is more of a question for the next talk that I'm going to display that. And the answer is yes,
you can just use sitit, it's just a general purpose sandbox. You can use it with containers or not.
So yeah, the short answer is yes, the long answer is your welcome to the next talk.
Thank you.