CLOSED: [2018-03-22 Thu 19:36] :PROPERTIES: :CREATED: [2018-03-22 Thu 13:28] :ID: 2018-03-22-secure-email-environment :END: :LOGBOOK: - State "DONE" from "NEXT" [2018-03-22 Thu 19:36] :END: Consider following situation: you are responsible for important things within your company. One of those responsibilities is that you are the one that gets job applications or emails from potential business partners. Of course, your company is using [[https://www.cvedetails.com/top-50-products.php][the most dangerous IT environment]] there is: MS Windows, Exchange/Outlook, MS Office, Adobe Acrobat Reader, IE with flash. *** You Are Exposed You have basically all important attack vectors against you. It is just a matter of time that you are going to open an infected email or infected attachment. Without noticing, your computer gets turned into a gateway for the bad guys. The whole network gets infiltrated using your computer. A competitor is able to get the source code of your latest product, all financial documents got leaked. Or you infect the whole company with [[https://en.wikipedia.org/wiki/Ransomware][ransomware]]. Not funny. Welcome to [[https://en.wikipedia.org/wiki/Phishing#Spear_phishing][a thing called spear phishing]]. According to many statistics from independent sources, this happens more often than we think. Even when a company notices an attack - which they hardly do - most attacks do not get reported anywhere. And yes, it is that easy to hi-jack a computer using Outlook, IE, Flash, Word, and so on. *** What To Do About That Since not everybody is able to choose their environment and [[id:2017-07-23-Qubes-OS][switch over to a secure operating system that allows safe opening of malware-infected documents]], you have to look for a workaround. I have tested a method using free and open source tools which can be set-up by any IT savvy person within an hour or so. The basic idea is to use a [[https://www.virtualbox.org/][VirtualBox]] container (VM) with a minimal GNU/Linux operating system. In this VM, a hardened web browser is accessing the [[https://en.wikipedia.org/wiki/Outlook_on_the_web][Outlook on the web]], previously known as Outlook Web Access (OWA). For opening attachments, a hardened PDF viewer and Office package is used. The user gets a shortcut link to the VM on his/her desktop. After starting the link, a new window appears, the user logs into the web-based Outlook using his/her credentials (not using [[https://mastodon.social/@publicvoit/99603121104412848][the insecure]] [[https://palant.de/2018/03/10/master-password-in-firefox-or-thunderbird-do-not-bother][password storage]] of the browser). Any email can be opened and read. Attachments can be opened in the hardened applications. To be on the safe side, you can even configure the VM that way that nothing gets persisted on its virtual hard disk. This way, the VM always starts in the same status and no malware is able to persist itself in the system. *** How I Did It Here is a brief list of tasks I did which you can follow: - Install [[https://www.virtualbox.org/][VirtualBox]] on your Windows machine - [[https://www.debian.org/distrib/][Download a Debian ISO]] - Install the Debian on a new VM - Sufficient are 5GB of maximum virtual hard disk space and 1.5GB of RAM - Network is accessed via NAT (default) - I chose [[https://xfce.org/][xfce]] as desktop environment - It is small, fast, easy to adapt/simplify - Setup the root account - Setup a user account - Install latest updates - Create a cronjob which updates the VM automatically via =apt update && apt upgrade= each noon on Monday to Friday - Install following Debian packages: - =sudo apt install xfce4-whiskermenu-plugin firejail firefox libreoffice okular= **** Configure xfce4 - [[https://www.lifewire.com/customize-xfce-desktop-environment-2202080][Switch from the default xfce menu to the xfce4-whiskermenu-plugin]] - Remove the default menu so that the whisker menu is the only menu left - Remove all favorite links in the whisker menu so that only the web browser and the file manager are left - Remove the second xfce panel on the bottom - Change the height of the panel to a smaller one in order to maximize screen estate for the browser. I won't hide it because it might irritate users. - Remove the desktop switcher from the panel - Move the panel to the bottom to make it as convenient as possible for Windows users: 1. panel preferences: unlock 2. close preferences 3. move panel using the handle of the outer left hand side 4. panel preferences: lock panel - Enable [[https://unix.stackexchange.com/questions/302400/auto-login-on-xfce-in-jessie][auto-login]] for the user you have created - Put firefox in the auto-start of xfce **** Configure Firejail - [[https://firejail.wordpress.com/][Firejail]] is a sandbox tool that lets you limit resources for programs - Follow [[https://firejail.wordpress.com/documentation-2/][the installation procedure]] - We are going to use it to limit resources of the Firefox browser and disable network for PDF viewer (Okular) and office tools (LibreOffice) - Copy the default firejail configs for Okular and LibreOffice from =/etc/firejail= to =~user/.firejail/= and add =network no= at the end **** Configure Firefox - Configure firefox to use Okular for PDF files and LibreOffice for office files without asking the user again - Set the OWA URL as the start page **** Configure LibreOffice - Install [[https://charliecnr.deviantart.com/art/Office-2013-theme-for-LibreOffice-512127527][the Office 2013 icon set]] to smoothen the look and feel for MS Office users **** Finalize the VM - Create a snapshot with a decent description so that you can switch back to the starting status - Add a link to the VM on desktop - Context menu of the VM in the VirtualBox Manager *** Result When the windows user starts the link on his/her desktop, the VM opens up with the OWA log-in screen. After logging in, emails can be read and attachments are opened in an offline sandbox. You now have to instruct the user how to switch back the mouse to Windows (using the right Ctrl key) and to properly shut down the VM. Enjoy. *** No Silver Bullet :PROPERTIES: :END: To be clear about it: this method is no silver bullet. Yes, you may infect your (GNU/Linux) environment but it is much harder to do. If you transfer malicious files from this VM to your Windows machine or still open (or preview) malicious emails in Outlook, you can get hacked. For many threats, this VM encapsulation with offline PDF reader and office tools offers a viable method to stay sane.