Readme.md: Add hardening guide for underlying browser
Most people might using chrome for openserp. Chrome itself is a spyware and it's reading unnecessary PC information (like device information) on startup. Also, what if Google turns more evil & start hijacking openserp's browser?
By adding some protection you'll be safe from Google's malicious intent.
So here's how.
I am going to assume you're using Chromium. What, using Google Chrome? Who cares, u deserved to be spied on if you're on Google side lol
1. Firejail
- Install Firejail.
- Save below as "rule.conf"
- Protect openserp like this:
firejail --profile=rule.conf openserp ...
Fully tested with openserp + chromium setup.
quiet
# Edit this path!!
# e.g. /path/to/your/openserp/ is a directory, and /path/to/your/openserp/ have openserp and config.yaml
whitelist /path/to/your/openserp
# This make sure Chrome cannot access real /home
# Instead Chrome will get temporary home
whitelist /home/deny_all
# Again, I'm using apt's chromium
# If you're using Spyware Chrome, change to 'chrome'
private-etc chromium
private-etc chromium.d
# Yeah, chromium works with those restrictions anyway
private-dev
private-tmp
nodvd
nogroups
noinput
nonewprivs
noprinters
noroot
nosound
notv
nou2f
novideo
machine-id
caps.drop all
disable-mnt
# Spyware cannot open other software
blacklist /dev/bus/usb
blacklist /usr/bin/exo-open
blacklist /usr/bin/gio
blacklist /usr/bin/kde-open
blacklist /usr/bin/sensible-browser
blacklist /usr/bin/xdg-email
blacklist /usr/bin/xdg-open
2. Chrome Policy
These policies turn off metrics reporting, DNS-over-HTTPS, WebRTC’s use of non-proxied UDP (which limits direct STUN/WebRTC connections), and component updates, respectively.
:~# mkdir /etc/chromium/policies/
:~# mkdir /etc/chromium/policies/managed/
:~# nano /etc/chromium/policies/managed/network.json
:~# nano /etc/chromium/policies/managed/network.json
:~# cat /etc/chromium/policies/managed/network.json
{
"MetricsReportingEnabled": false,
"DnsOverHttpsMode": "off",
"WebRtcIPHandlingPolicy": "disable_non_proxied_udp",
"ComponentUpdatesEnabled": false
}
:~# chmod -R 777 /etc/chromium/policies/
For:
server:
host: unix:/tmp/sockets/openserp.sock
socket_mode: "0777"
port: 7000
Use:
whitelist /tmp/sockets
private-tmp
"whitelist /tmp/sockets/openserp*" doesn't work if you need to use socket_mode like this.