#Bubblewrap and linux-hardened kernel

119 messages · Page 1 of 1 (latest)

outer sun
#

I have been having problems on Arch with the hardened kernel and bubblewrap.

I created a post a while back and the solution was to install bubblewrap-suid, which I did. But when I install and attempt to run some applications that (I believe) require something called chrome-sandbox, I get an error like this:

[123456:1234/123456.123456:FATAL:setuid_sandbox_host.cc(157)] The SUID sandbox helper binary was found, but is not configured correctly. Rather than run without sandboxing I'm aborting now. You need to make sure that /something/chrome-sandbox is owned by root and has mode 4755.

"something" is usually /tmp/ or /opt/. I was able to successfully workaround this by doing as instructed for some apps, but other apps (where the file is in /tmp/), there is no file in the specified location to set the necessary permissions. In any case, this would be a workaround. How do I fix this problem?

blazing dragon
blazing dragon
#

Or programm that use Chromium code, such as electron

blazing dragon
# outer sun okay...

You can either run them with --no-sandbox (probably not a good idea),
or

sudo chown root chrome-sandbox
sudo chmod 4755 chrome-sandbox

or

sysctl kernel.unprivileged_userns_clone=1
outer sun
#

the second thing, I did, but someone said it's not recommended for security reasons

#

their advice was to install bubblewrap-suid, which I did, but I get the above errors (for some things)

blazing dragon
outer sun
#

I am using hardened kernel and bubblewrap, two things that increase security

#

but any solution reduces the security

#

so what do I do? is there a way to fix this without the workarounds, while maintaining security? or do I have to uninstall the kernel (properly of course)

blazing dragon
outer sun
#

so that option is out

#

--no-sandbox obviously makes that specific app run without a sandbox, which is better but not ideal

blazing dragon
outer sun
blazing dragon
#

The reason for using suid with bubblewrap is to avoid unprivileged_userns_clone.

#

Chromium code uses its own sandbox, which normally uses the unprivileged user namespace.

outer sun
#

so unprivileged_userns_clone is system-wide, tldr it disables the hardened kernel security protections

#

chmod u+s /usr/bin/bwrap makes bubblewrap run as suid?

#

but installing bubblewrap-suid does the same thing?

blazing dragon
outer sun
#

not sure what that means

#

i apologize, I know I am missing a lot of computer science here

blazing dragon
outer sun
#

okay

#

thank you

#

are there any other possibilities here

#

keeping the hardened kernel, and bubblewrap

#

In the future I want to develop a hardened arch installation

#

eventually I'm gonna want to get into the weeds, and this seems like a major flaw

blazing dragon
outer sun
#

ah, alright

#

Thanks anyway.

blazing dragon
#

The setuid privilege or bit allows a file to temporarily grant the executing user the privileges of the file's owner.

#

This alllows the executing user to access the privileges and resource of owner of executable.

#

It is safe as long as the program with setuid is robust

#

e.g. sudo has the setuid bit set to allow you to become root or someone else

outer sun
#

okay

#

thanks, I will revisit this another day because eventually I'm gonna run into this problem again and I'm gonna want to find a way. Whether it's tweaking the kernel, or installing a different sandboxing framework...I don't know.

#

@blazing dragonwait, what if you ran the program in a different sandbox, one that doesn't use suid?

#

firejail?

#

or maybe tweak apparmor?

#

I don't know enough about these tools to really know how to mitigate this problem.

blazing dragon
blazing dragon
outer sun
blazing dragon
outer sun
#

and if a program is not sandboxed then apparmor should be able to help

outer sun
#

meaning no sandbox protections

blazing dragon
blazing dragon
outer sun
#

I thought you said mitigate

blazing dragon
outer sun
blazing dragon
#
sudo chown root chrome-sandbox
sudo chmod 4755 chrome-sandbox
outer sun
#

no sandbox is 0, no protection

outer sun
#

recommended steps?

blazing dragon
#

Sorry for the confusion

outer sun
#

I'm still learning linux, despite using it for 4 years

blazing dragon
outer sun
#

so feel free to not answer any more of my questions if you don't want to

blazing dragon
#

If you don't understand these concepts yet, why not just use the regular kernel for now and understand them later in an environment more conducive to learning by trial and error, such as a virtual machine?

outer sun
blazing dragon
outer sun
#

I've tested the hardened kernel already, with arch, with apparmor, firejail too

#

I did this maybe a year ago

#

been using arch since nov 2022

#

done plenty of research but always more to learn

#

Eventually I want to learn arch in depth. I want to learn to harden it.

#

I'm gonna install Qubes soon (not my first time), keep arch on a VM to test with

#

it does seem that experimenting on bare metal, especially my main system, probably not a good idea

blazing dragon
#

Qubes
This is a rabbit hole

outer sun
# blazing dragon Please feel free to ask

I would ask what setuid means, and what you mean when you say "sandbox" (are you referring to bubblewrap itself, or the framework that bubblewrap uses), but I feel like I could google these things.

outer sun
outer sun
#

firstly, what does setuid stand for

#

Does uid refer to PID? for example, user runs on 1000

blazing dragon
# outer sun firstly, what does setuid stand for

The setuid privilege or bit allows a file to temporarily grant the executing user the privileges of the file's owner.
This alllows the executing user to access the privileges and resource of owner of executable.
It is safe as long as the program with setuid is robust
e.g. sudo has the setuid bit set to allow you to become root or someone else

#

It sands for temporarily grant the executing user the privileges of the file's owner

blazing dragon
#

short for set user identity

blazing dragon
#

The Linux and Unix access rights flags setuid and setgid (short for set user identity and set group identity) allow users to run an executable with the file system permissions of the executable's owner or group respectively and to change behaviour in directories. They are often used to allow users on a computer system to run programs with tempor...

outer sun
#

I can't devote enough time to read about setuid and relevant stuff

#

just needed to fix a problem, now that I know --no-sandbox is the solution I'll go with that

blazing dragon
outer sun
blazing dragon
outer sun
#

why do I get the feeling you're a bot that knows everything

blazing dragon
#

I don't think it's any different from reading wikis.

blazing dragon
outer sun
#

at the moment, I don't even know enough to ask any relevant questions about this topic

outer sun
blazing dragon
#

Moreover, Wiki is written by many (experienced) people. It would certainly be more reliable than me.

outer sun
#

God you sound so much like a bot

blazing dragon
#

There is also a talk page on the Arch wiki, so if you don't understand something, just ask the author. We will answer if time allows.

outer sun
dapper caveBOT
#

memchr received a thank you cookie!

outer sun
#

gonna head off now.

#

member of the openAI server...hm