Hi Rosika,
I tried it
$ cat safefox2
#!/usr/bin/bash
firejail --private-tmp --disable-mnt --nodbus --no-u2f --nodvd --nogroups --nonewprivs --noroot --notv --nou2f --novideo --private-cache --private-dev --dns=1.1.1.1 --dns=9.9.9.9 firefox -no-remote
There was an error
Error: invalid --no-u2f command line option
So I removed --no-u2f
and it works, with a few messages
$ ./safefox2
Reading profile /etc/firejail/firefox.profile
Reading profile /etc/firejail/whitelist-usr-share-common.inc
Error: Cannot relax dbus-user policy, it is already set to block
Reading profile /etc/firejail/firefox-common.profile
Reading profile /etc/firejail/disable-common.inc
Reading profile /etc/firejail/disable-devel.inc
Reading profile /etc/firejail/disable-exec.inc
Reading profile /etc/firejail/disable-interpreters.inc
Reading profile /etc/firejail/disable-proc.inc
Reading profile /etc/firejail/disable-programs.inc
Reading profile /etc/firejail/whitelist-common.inc
Reading profile /etc/firejail/whitelist-run-common.inc
Reading profile /etc/firejail/whitelist-runuser-common.inc
Reading profile /etc/firejail/whitelist-var-common.inc
Warning: networking feature is disabled in Firejail configuration file
Seccomp list in: !chroot, check list: @default-keep, prelist: unknown,
Ignoring "dbus-user.own org.mozilla.*" and 1 other dbus-user filter rule.
Parent pid 7095, child pid 7098
DNS server 1.1.1.1
DNS server 9.9.9.9
Warning: An abstract unix socket for session D-BUS might still be available. Use --net or remove unix from --protocol set.
Seccomp list in: !chroot, check list: @default-keep, prelist: unknown,
Warning: cleaning all supplementary groups
Warning: Replacing profile instead of stacking it. It is a legacy behavior that can result in relaxation of the protection. It is here as a temporary measure to unbreak the software that has been broken by switching to the stacking behavior.
Warning: Cannot confine the application using AppArmor.
Maybe firejail-default AppArmor profile is not loaded into the kernel.
As root, run "aa-enforce firejail-default" to load it.
Child process initialized in 205.02 ms
ATTENTION: default value of option mesa_glthread overridden by environment.
ATTENTION: default value of option mesa_glthread overridden by environment.
[Parent 10, Main Thread] WARNING: Failed to create DBus proxy for org.a11y.Bus: Could not connect: Permission denied
: 'glib warning', file /builds/worker/checkouts/gecko/toolkit/xre/nsSigHandlers.cpp:201
** (firefox:10): WARNING **: 21:30:51.088: Failed to create DBus proxy for org.a11y.Bus: Could not connect: Permission denied
Parent is shutting down, bye...
nevj@trinity:~
$ ./safefox2
Reading profile /etc/firejail/firefox.profile
Reading profile /etc/firejail/whitelist-usr-share-common.inc
Error: Cannot relax dbus-user policy, it is already set to block
Reading profile /etc/firejail/firefox-common.profile
Reading profile /etc/firejail/disable-common.inc
Reading profile /etc/firejail/disable-devel.inc
Reading profile /etc/firejail/disable-exec.inc
Reading profile /etc/firejail/disable-interpreters.inc
Reading profile /etc/firejail/disable-proc.inc
Reading profile /etc/firejail/disable-programs.inc
Reading profile /etc/firejail/whitelist-common.inc
Reading profile /etc/firejail/whitelist-run-common.inc
Reading profile /etc/firejail/whitelist-runuser-common.inc
Reading profile /etc/firejail/whitelist-var-common.inc
Warning: networking feature is disabled in Firejail configuration file
Seccomp list in: !chroot, check list: @default-keep, prelist: unknown,
Ignoring "dbus-user.own org.mozilla.*" and 1 other dbus-user filter rule.
Parent pid 7266, child pid 7267
DNS server 1.1.1.1
DNS server 9.9.9.9
Warning: An abstract unix socket for session D-BUS might still be available. Use --net or remove unix from --protocol set.
Seccomp list in: !chroot, check list: @default-keep, prelist: unknown,
Warning: cleaning all supplementary groups
Warning: Replacing profile instead of stacking it. It is a legacy behavior that can result in relaxation of the protection. It is here as a temporary measure to unbreak the software that has been broken by switching to the stacking behavior.
Warning: Cannot confine the application using AppArmor.
Maybe firejail-default AppArmor profile is not loaded into the kernel.
As root, run "aa-enforce firejail-default" to load it.
Child process initialized in 185.67 ms
ATTENTION: default value of option mesa_glthread overridden by environment.
ATTENTION: default value of option mesa_glthread overridden by environment.
[Parent 9, Main Thread] WARNING: Failed to create DBus proxy for org.a11y.Bus: Could not connect: Permission denied
: 'glib warning', file /builds/worker/checkouts/gecko/toolkit/xre/nsSigHandlers.cpp:201
** (firefox:9): WARNING **: 21:32:07.285: Failed to create DBus proxy for org.a11y.Bus: Could not connect: Permission denied
[Parent 9, Main Thread] WARNING: Failed to create DBus proxy for org.freedesktop.UPower: Could not connect: Permission denied
: 'glib warning', file /builds/worker/checkouts/gecko/toolkit/xre/nsSigHandlers.cpp:201
** (firefox:9): WARNING **: 21:32:09.995: Failed to create DBus proxy for org.freedesktop.UPower: Could not connect: Permission denied
Parent is shutting down, bye...
During the session I logged into my bank successfully, so I has not interfered with access.
Now I have to check your cookie-specific restrictions
For even more cookie-specific restrictions, you could add:
--env=MOZ_DISABLE_CONTENT_SANDBOX=1 --env=MOZ_DISABLE_GMP_SANDBOX=1 --env=MOZ_DISABLE_RDD_SANDBOX=1
These environment variables disable various Firefox sandboxes that might interfere with cookie restrictions.
So the new script is
#!/usr/bin/bash
firejail --private-tmp --disable-mnt --nodbus --nodvd --nogroups --nonewprivs --noroot --notv --nou2f --novideo --private-cache --private-dev --dns=1.1.1.1 --dns=9.9.9.9 firefox -no-remote --env=MOZ_DISABLE_CONTENT_SANDBOX=1 --env=MOZ_DISABLE_GMP_SANDBOX=1 --env=MOZ_DISABLE_RDD_SANDBOX=1
and it works too, I can access the bank site.
My bank has 2FA and that still works.
So I think we have a new more secure method.
Dont know how I can check if cookies are still being used.?
I might try Waterfox instead of Firefox next.
Regards
Neville