mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #3258] vscode: cannot isolate sandboxes (RUNUSER socket) #2046
Labels
No labels
LTS merge
LTS merge
bug
bug
converted-to-discussion
doc-todo
documentation
duplicate
enhancement
file-transfer
firecfg
firejail-in-firejail
firetools
graphics
help wanted
information_old
installation
invalid
modif
moved
needinfo
networking
notabug
notourbug
old-version
overlayfs
packaging
profile-request
pull-request
question
question_old
removal
runtime-permissions
sandbox-ipc
security
stale
wiki
wiki
wontfix
wordpress
workaround
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/firejail#2046
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @pcrockett on GitHub (Mar 1, 2020).
Original GitHub issue: https://github.com/netblue30/firejail/issues/3258
I'm trying to create some general-purpose sandboxes. I have a work and a personal profile, and I launch them like this:
The problem is that programs in my two sandboxes still seem to be able to interact.
VSCodium always seems to want to open new windows in the first environment it's started in, whether inside a sandbox or not. I'm not sure how VSCodium is working behind the scenes to be able to break out of its sandbox. How do I figure that out and fix it?
Here's my personal profile. My work profile is identical, except in a few places instead of "personal" it says "work".
@Vincent43 commented on GitHub (Mar 1, 2020):
Try uncommenting it. You may also try
whitelistthings in${RUNUSER}.@pcrockett commented on GitHub (Mar 1, 2020):
Unfortunately that seems to have no effect. Looks like VSCodium isn't using DBus for inter-process communication.
At least now I know what DBus is, and why I'd want to disable it!
What would whitelisting things in
${RUNUSER}achieve? I figured I'd need to blacklist stuff to get VSCodium to behave. And what specifically in${RUNUSER}would I want to whitelist?@rusty-snake commented on GitHub (Mar 1, 2020):
Try
Only whitelisted files are visible.
@pcrockett commented on GitHub (Mar 1, 2020):
Ok, I gave that a try. Interesting results:
${RUNUSER}/pulseor${RUNUSER}/bus; firejail gave me a "Error: invalid whitelist path" message/run/user/1000directory and found somevscode-blah-blah-random-stuff.sockfiles. I guess that's where the problem lies. Perhaps I need to do an overlay file system for${RUNUSER}or something?@rusty-snake commented on GitHub (Mar 1, 2020):
Thats what
whitelist ${RUNUSER}/foodoes.@pcrockett commented on GitHub (Mar 1, 2020):
Oh I get it! That makes so much more sense then.
With that command, I get this error message:
Not a terribly helpful error message I must say. The file does exist.
@pcrockett commented on GitHub (Mar 1, 2020):
From the profile man page about the whitelist setting:
So it looks like anything under /run can't be whitelisted. It does look like
tmpfswill do the trick, but sadly that requires running as root. 🙁@Vincent43 commented on GitHub (Mar 1, 2020):
yeah, this is where it leaks.
/runcan't be whitelisted but/run/user/1000/can and this is what you want to do (unless you run some older version of firejail), postfirejail --version.@pcrockett commented on GitHub (Mar 1, 2020):
So about a year old. This is the latest that comes with Parrot OS. I'll try upgrading and report back.
@pcrockett commented on GitHub (Mar 1, 2020):
Ok, I updated to the latest release (0.9.62) and kept getting the whitelist error message. But I tried something different this time:
--whitelist=${RUNUSER}/*. That did the trick. My/run/user/1000directory inside the sandbox is empty, and now VSCodium runs completely isolated instances in the correct sandboxes.Here's my new full profile:
Thanks all.
@rusty-snake commented on GitHub (Mar 2, 2020):
whitelist globbing is actually unsupported, once it is supported this will reintroduce this issue for you. IMHO something like
whitelist ${RUNUSER}/__empty__would be better.@smitsohu commented on GitHub (Mar 2, 2020):
How about adding
blacklist ${RUNUSER}/vscode-*(assuming that's the path) to disable-programs.inc or a comparable place?This socket is possibly also a vector to escape from other sandboxes.
@pcrockett commented on GitHub (Mar 2, 2020):
Since this is meant to be a general-purpose sandbox, and not specifically for VS Code, I guess I'd want to do just
blacklist ${RUNUSER}, is that correct?Question: Doesn't blacklisting a directory cause permission errors? Or would it simply cause the directory to appear empty?
Sorry, I'd just try it out, but my PC isn't within reach at the moment.
@rusty-snake commented on GitHub (Mar 2, 2020):
Permission errors
@pcrockett commented on GitHub (Mar 2, 2020):
👌 So it sounds like for my case, since I do want applications to be able to write to the directory without having an effect on other sandboxes,
whitelist ${RUNUSER}/__empty__is a better tool for the job thatblacklist.It would sure be nice if Firejail just had an
empty-dirfeature or something like that. Whitelisting a random file seems like a bit of a hack.@rusty-snake commented on GitHub (Mar 2, 2020):
@smitsohu in general I think that we should do more whitelisting in RUNUSER, but we can do this ATM only for gtk3 and cli programs.