Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The ˋ--forceˋ flag isn't working within distrobox #6144

Open
neurodiverseEsoteric opened this issue Dec 30, 2023 · 21 comments
Open

The ˋ--forceˋ flag isn't working within distrobox #6144

neurodiverseEsoteric opened this issue Dec 30, 2023 · 21 comments

Comments

@neurodiverseEsoteric
Copy link

I tried running ˋfirejail --force ---private librewolfˋ inside a distrobox of archlinux on a fedora-based distro which doesn't offer librewolf at all, but firejail still ignored everything for being run inside of a "sandbox..."

@rusty-snake
Copy link
Collaborator

How old is your firejail?

You should upgrade to fix multiple vulnerabilities.

@rusty-snake
Copy link
Collaborator

@neurodiverseEsoteric
Copy link
Author

@rusty-snake

It's archlinux, it shouldn't be that old

@neurodiverseEsoteric
Copy link
Author

@rusty-snake

That defeats the purpose of avoiding all host system and app breakages being blamed on my installing outsider software (it's not just librewolf)

@glitsj16
Copy link
Collaborator

I tried running ˋfirejail --force ---private librewolfˋ inside a distrobox of archlinux on a fedora-based distro which doesn't offer librewolf at all, but firejail still ignored everything for being run inside of a "sandbox..."

(1) I'm assuming the triple dash in ---private is a typo and isn't the actual command you ran.
(2) Firejail dropped the --force option since version 0.9.54:

firejail/RELNOTES

Lines 490 to 491 in db09546

firejail (0.9.54) baseline; urgency=low
* modif: --force removed

For example, when running firejail --force --private librewolf on Arch Linux with 0.9.72, you should see:

Error: invalid --force command line option

Not sure what the actual problem is. Can you rephrase your issue?

@neurodiverseEsoteric
Copy link
Author

Oh if it did throw that error i didn't see it...how do I put --force back in?

@rusty-snake
Copy link
Collaborator

rusty-snake commented Dec 30, 2023

@neurodiverseEsoteric
Copy link
Author

ok thanks

@rusty-snake
Copy link
Collaborator

FWIW, the following contaiers are supported container=(lxc|docker|lxc-libvirt|systemd-nspawn|rkt) firejail ... according to

int is_container(const char *str) {
assert(str);
if (strcmp(str, "lxc") == 0 ||
strcmp(str, "docker") == 0 ||
strcmp(str, "lxc-libvirt") == 0 ||
strcmp(str, "systemd-nspawn") == 0 ||
strcmp(str, "rkt") == 0)
return 1;
return 0;
}

@neurodiverseEsoteric
Copy link
Author

Wait nob that release is a thouzandoulus years old...

@neurodiverseEsoteric
Copy link
Author

FWIW, the following contaiers are supported container=(lxc|docker|lxc-libvirt|systemd-nspawn|rkt) firejail ... according to

int is_container(const char *str) {
assert(str);
if (strcmp(str, "lxc") == 0 ||
strcmp(str, "docker") == 0 ||
strcmp(str, "lxc-libvirt") == 0 ||
strcmp(str, "systemd-nspawn") == 0 ||
strcmp(str, "rkt") == 0)
return 1;
return 0;
}

What would happen if I just naively added distrobox to the list?

@rusty-snake
Copy link
Collaborator

Either it works or it does not work.

@neurodiverseEsoteric
Copy link
Author

It didn't work, firejail still detects a sandbox...

@rusty-snake
Copy link
Collaborator

int check_namespace_virt(void) {
EUID_ASSERT();
// check container environment variable
const char *str = env_get("container");
if (str && is_container(str))
return 1;

That's the first check, if it still detects a sandbox you added the wrong value.

@neurodiverseEsoteric
Copy link
Author

neurodiverseEsoteric commented Dec 30, 2023

Ah, it might be one of these pod-based labels:

https://github.com/89luca89/distrobox/blob/3435f4d27070a99668bfa29a3e508db4ecc09009/distrobox-create#L441-L469

(how did you get the code preview thing?)

@neurodiverseEsoteric
Copy link
Author

Okay I added the right values, but...

Reading profile /usr/local/etc/firejail/librewolf.profile
Reading profile /usr/local/etc/firejail/firefox-common.profile
Reading profile /usr/local/etc/firejail/disable-common.inc
Reading profile /usr/local/etc/firejail/disable-devel.inc
Reading profile /usr/local/etc/firejail/disable-exec.inc
Reading profile /usr/local/etc/firejail/disable-interpreters.inc
Reading profile /usr/local/etc/firejail/disable-proc.inc
Reading profile /usr/local/etc/firejail/disable-programs.inc
Reading profile /usr/local/etc/firejail/whitelist-common.inc
Reading profile /usr/local/etc/firejail/whitelist-run-common.inc
Reading profile /usr/local/etc/firejail/whitelist-runuser-common.inc
Reading profile /usr/local/etc/firejail/whitelist-usr-share-common.inc
Reading profile /usr/local/etc/firejail/whitelist-var-common.inc
firejail version 0.9.73

Seccomp list in: !chroot, check list: @default-keep, prelist: unknown,
Warning: /usr/bin/xdg-dbus-proxy was not found, downgrading dbus-user policy to allow.
To enable DBus filtering, install the xdg-dbus-proxy program.
Ignoring "dbus-user.own io.gitlab.librewolf.*" and 1 other dbus-user filter rule.
Parent pid 15028, child pid 15029
Warning: cannot find /var/run/utmp
Error: cannot create /dev/zero device: Operation not permitted
Error: proc 15028 cannot sync with peer: unexpected EOF
Peer 15029 unexpectedly exited with status 1

@neurodiverseEsoteric
Copy link
Author

Does podman support need to be added into firejail?

@rusty-snake
Copy link
Collaborator

  1. Try if --profile=noprofile works.
  2. Try rootfull podman with --privileged and --security-opt=label=disable --security-opt=seccomp=unconfined

@neurodiverseEsoteric
Copy link
Author

By rootful podman you mean run distrobox with the --root flag?

@rusty-snake
Copy link
Collaborator

I never used distrobox but firejail might not work inside rootless podman (https://github.com/containers/podman#rootless).

@neurodiverseEsoteric
Copy link
Author

Distrobox keeps freezing the entire OS whever I try creating a rootful container...and the podman command used to "enter" the container, ˋpodman exec,ˋ doesn't take the "--security-opt" flag, anyway...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants