I have successfully created a jail & installed Firefox inside the jail problem Firefox is completely mute. I can't watch Youtube. How do I enable sound in the jailed Firefox ?
Jails, by default, have limited access to devices. You'll need to set up proper devfs.rules(5) to allow the jail access to the audio devices.I have successfully created a jail & installed Firefox inside the jail problem Firefox is completely mute. I can't watch Youtube. How do I enable sound in the jailed Firefox ?
I have addedJails, by default, have limited access to devices. You'll need to set up proper devfs.rules(5) to allow the jail access to the audio devices.
devfs_ruleset = 4
to# cat jail.conf
ffjailed {
devfs_ruleset = 4;
enforce_statfs = 2;
exec.clean;
exec.consolelog = /var/log/bastille/ffjailed_console.log;
exec.start = '/bin/sh /etc/rc';
exec.stop = '/bin/sh /etc/rc.shutdown';
host.hostname = ffjailed;
mount.devfs;
mount.fstab = /usr/local/bastille/jails/ffjailed/fstab;
path = /usr/local/bastille/jails/ffjailed/root;
securelevel = 2;
interface = wlan0;
ip4.addr = 192.168.225.10;
ip6 = disable;
devfs_ruleset=4;
}
That's the default (look at the first line of the jail configuration).I have added devfs_ruleset = 4 to
[devfsrules_jail=4]
add include $devfsrules_hide_all
add include $devfsrules_unhide_basic
add include $devfsrules_unhide_login
add path fuse unhide
add path zfs unhide
If somehow I can manage to enable the sound in Firefox then its a success. Any ideas ? So what number should I try ?That's the default (look at the first line of the jail configuration).
Rule 4 limits access to pretty much everything except a few necessary devices.
Code:[devfsrules_jail=4] add include $devfsrules_hide_all add include $devfsrules_unhide_basic add include $devfsrules_unhide_login add path fuse unhide add path zfs unhide
Agreed. Posts split off to its own thread.I think a jail for a browser is slightly off-topic here?
[bastille=20]
add include $devfsrules_hide_all
add include $devfsrules_unhide_basic
add include $devfsrules_unhide_login
add path fuse unhide
add path zfs unhide
add include $devfsrules_jail
, it unhid everything which defeated the purpose of restricting dev access.(1) So should I create a regular user inside the Jail that I have created & use it to run Firefox ?A1) Think about it this way, if your Firefox starts running malware, it's going to be able to do anything it can do that the account it runs on. Running Firefox as root is a bad idea, regardless if this is in a jail or not. Bad habits are hard to break, better not get accustomed to it in the first place.
A2) There are two types of jails. The 'regular' jail, which uses the hosts network stack. From the jail you cannot change anything, you can't change the IP and you can't run a firewall. This is all controlled from the host. The second type of jail is a so-called VNET jail. That jail has it's own virtualized network stack, from within the jail you can configure it, set the IP and run a firewall on it.
A3) They're files. Just copy them. Note that Firefox typically creates a profile directory with a random name.
A4) Yes, sort of. How much did you lose? Well, you gave the jail access to the audio devices. That's the security you've lost, a jail normally doesn't have access to those devices. Is this a big risk? Probably not.
vnet
either. Note that bastille(8) has specific options for this. https://bastille.readthedocs.io/en/latest/chapters/networking.html#virtual-network-vnet vnet Create the jail with its own virtual network stack, with its own
network interfaces, addresses, routing table, etc. The kernel
must have been compiled with the VIMAGE option for this to be
available. Possible values are “inherit” to use the system
network stack, possibly with restricted IP addresses, and “new”
to create a new network stack.
sudo bastille console ffjailed
I get the root account of the jail by default. The prompt looks like this root@ffjailed:~ #
. Now when I type the exit
command I am out of the jail & back to my host. How do I login to my newly created account ? login
. setenv DISPLAY :1
to .cshrc of my new user account exactly the same way I did for the root account & rebooted the Jail but I am still getting~ $ firefox
Error: no DISPLAY environment variable specified
Xnest :1 -listen tcp
Actually, no. A jail is the logical consequence of the idea to use chroot(8) for "secure" isolation. It wasn't designed for that, but was just a nice tool to be able to do something "inside" a userland mounted on a path prefix (instead of /). For isolation, the first problem was protection against trickeries with paths (like, very simple symlinks) allowing file access outside the chroot. This was solved in many implementations, but there were still other things missing like restricted device access, resource limits, networking restrictions etc, and all these things were added to create FreeBSD's "jails".By just looking at how FreeBSD jails work I see Jails as headless VMs with a minimum FreeBSD base install.
[devfsrules_desktop_jail=5]
add include $devfsrules_hide_all
add include $devfsrules_unhide_basic
add include $devfsrules_unhide_login
add path zfs unhide
add path 'mixer*' unhide
add path 'dsp*' unhide
allow.raw_sockets = 1;
exec.start = "/bin/sh /etc/rc";
exec.stop = "/bin/sh /etc/rc.shutdown";
exec.clean;
devfs_ruleset = 5;
mount.devfs;
fox {
path = "/usr/jails/fox";
host.hostname = "fox";
ip4.addr = "10.0.0.3";
interface = "lo1";
mount.fstab = "/etc/fstab.fox";
}