This page provides instructions for sandboxing the Linux build of Tor Browser Bundle using the [https://wiki.smartos.org/display/DOC/Home SmartOS hypervisor] with the [https://wiki.illumos.org/display/illumos/illumos+Home IllumOS kernel] such that the Browser is only able to access the `SocksPort` of a `tor` instance running in another security domain. We make use of native Solaris [https://wiki.smartos.org/display/DOC/Zones zones] for running `tor` and a firewall, and Solaris' [https://wiki.smartos.org/display/DOC/LX+Branded+Zones Linux-Branded Zones] (which emulate Linux system calls, and can run both x86 32-bit and 64-bit Linux binaries) for running Tor Browser. We also provide instructions for using the browser-based NoVNC client to access the sandboxed Tor Browser (eg, from another Tor Browser running locally).
This page provides instructions for sandboxing the Linux build of Tor Browser Bundle using the [SmartOS hypervisor](https://wiki.smartos.org/display/DOC/Home) with the [IllumOS kernel](https://wiki.illumos.org/display/illumos/illumos+Home) such that the Browser is only able to access the `SocksPort` of a `tor` instance running in another security domain. We make use of native Solaris [zones](https://wiki.smartos.org/display/DOC/Zones) for running `tor` and a firewall, and Solaris' [Linux-Branded Zones](https://wiki.smartos.org/display/DOC/LX+Branded+Zones)(which emulate Linux system calls, and can run both x86 32-bit and 64-bit Linux binaries) for running Tor Browser. We also provide instructions for using the browser-based NoVNC client to access the sandboxed Tor Browser (eg, from another Tor Browser running locally).
'''The Linux Tor Browser binary runs just fine in a Linux zone on Solaris/SmartOS!'''
**The Linux Tor Browser binary runs just fine in a Linux zone on Solaris/SmartOS!**
Our sandbox environment will have several components which will each be in their own zone. The Tor Browser will run with a X server created by vnc4server. A stealth authenticated onion service will expose an HTTP service via noVNC which will serve an HTML5 VNC client to the browser and it will connect to the zone running the Tor Browser vnc4server.
...
...
@@ -17,7 +17,7 @@ Our sandbox environment will have several components which will each be in their
* Tor Browser + vnc4server
* the webserver component of noVNC
== why? ==
## why?
* use of dtrace
* use of ZFS to take snapshots and rollback to previous snapshots
...
...
@@ -26,12 +26,12 @@ Our sandbox environment will have several components which will each be in their
* less overhead than Linux virtualization
* remote execution vulnerability not likely to exploit kernel since we aren't running the Linux kernel
== global zone configuration ==
## global zone configuration
I recommend that the global zone have several changes such as disabling ssh password login, changing the ssh listening port and using strict firewall rules.
my '''/usbkey/config''' looks like this:
{{{
my **/usbkey/config** looks like this:
```
admin_nic=MM:MM:MM:MM:MM:MM
admin_ip=dhcp
headnode_default_gateway=none
...
...
@@ -41,10 +41,10 @@ ntp_hosts=0.pool.ntp.org
hostname=computer
root_authorized_keys_file=authorized_keys
etherstub="switch0"
}}}
```
firewall rules in '''/etc/ipf/ipf.conf'''; you'll have to change the rule for your DNS resolver IPv4 address and I also recommend that you not use ssh port 22 but instead pick a high port number:
{{{
firewall rules in **/etc/ipf/ipf.conf**; you'll have to change the rule for your DNS resolver IPv4 address and I also recommend that you not use ssh port 22 but instead pick a high port number:
```
#
# ipf.conf
#
...
...
@@ -138,16 +138,16 @@ pass in quick proto tcp from any to any port = 22 flags S/FSRPAU keep state keep
# Block and log only first occurrence of all remaining traffic.
block in log first quick on vioif0 all
}}}
```
== creation of zones ==
## creation of zones
Read the SmartOS documentation on [https://wiki.smartos.org/display/DOC/Managing+Images zone image management].
Read the SmartOS documentation on [zone image management](https://wiki.smartos.org/display/DOC/Managing+Images).
We create Solaris and Linux zones using the latest SmartOS zone images available:
These two image IDs will be specified in our zone manifests.
Refer to [https://wiki.smartos.org/display/DOC/How+to+create+a+zone+%28+OS+virtualized+machine+%29+in+SmartOS creating zones with SmartOS] for more information.
Refer to [creating zones with SmartOS](https://wiki.smartos.org/display/DOC/How+to+create+a+zone+%28+OS+virtualized+machine+%29+in+SmartOS) for more information.
== firewall zone ==
## firewall zone
create a '''firewall.json''' file where public IPv4 address is '''XXX.XXX.XXX.XXX''' and the gateway is '''YYY.YYY.YYY.YYY''' :
{{{
create a **firewall.json** file where public IPv4 address is **XXX.XXX.XXX.XXX** and the gateway is **YYY.YYY.YYY.YYY** :
```
{
"alias": "firewall",
"hostname": "firewall",
...
...
@@ -191,16 +191,16 @@ create a '''firewall.json''' file where public IPv4 address is '''XXX.XXX.XXX.XX
}
]
}
}}}
```
create the zone:
{{{
```
vmadm create -f firewall.json
}}}
```
login
{{{
```
vmadm list
UUID TYPE RAM STATE ALIAS
5d9ab9da-8aae-4a48-b73a-b7ae574a5dd3 OS 500 running firewall
...
...
@@ -216,31 +216,30 @@ Last login: Fri Mar 4 10:33:05 on pts/13
`-' https://docs.joyent.com/images/smartos/base
[root@firewall ~]#
}}}
```
firewall NAT configuration in '''/etc/ipf/ipfnat.conf'''
{{{
firewall NAT configuration in **/etc/ipf/ipfnat.conf**
```
ipfnat.conf
map net0 10.0.0.2/24 -> 0/32 portmap tcp/udp auto
map net0 10.0.0.2/24 -> 0/32
}}}
```
firewall filtering in '''/etc/ipf/ipf.conf'''
{{{
firewall filtering in **/etc/ipf/ipf.conf**
```
block out from 10.0.0.13/32
block in from 10.0.0.13/32
}}}
```
'''/opt/custom/bin/net-setup'''
{{{
#!/usr/bin/bash
**/opt/custom/bin/net-setup**
```
ipnat -v -f /etc/ipf/ipfnat.conf
}}}
```
'''/opt/custom/smf/net-setup.xml'''
{{{
**/opt/custom/smf/net-setup.xml**
```
<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">