This document describes the creation of live boot CDs used to make secure VPN connections from anywhere (over the Internet) to internal networks that have firewall exposure to the Internet.</abstract>
<toc> <!-- generate a table of contents here -->
<!-- Space inserted for revision history (using RCS etc.)
V0.08 2007-04-29 reviewed by TM
V0.07 2007-02-12 initial draft
End of revision history -->
<sect>Introduction
<p>
<nidx>bootcdvpn!introduction</nidx>
For several years now, users at the Institution where I currently work part-time have expressed a need for a robust and secure connection to the internal network. The internal network actually has some clients that are on private networks and some clients that are Internet-routeable.
Being mostly a Microsoft shop, the options that have been available were not deemed appropriate for various reasons, usually due to security concerns. After being introduced to the problem a few months ago and listening to the concerns surrounding it, I suggested using a boot CD, which would alleviate all of their security concerns. They gave me the go ahead to give it a try. I now have a working prototype and this document describes the process used to create it.
<item>to copy, distribute, display, and perform the work
<item>to make derivative works
<item>to make commercial use of the work
</itemize>Under the following conditions:
Attribution. You must give the original author credit.
Share Alike. If you alter, transform, or build upon this work, you may distribute the resulting work only under a license identical to this one.
<itemize>
<item>For any reuse or distribution, you must make clear to others the license terms of this work.
<item>Any of these conditions can be waived if you get permission from the author.
</itemize>
<sect1>Disclaimer
<p>
Use the information in this document at your own risk. I disavow any potential liability for the contents of this document. Use of the concepts, examples, and/or other content of this document is entirely at your own risk.
All copyrights are owned by their owners, unless specifically noted otherwise. Use of a term in this document should not be regarded as affecting the validity of any trademark or service mark.
Naming of particular products or brands should not be seen as endorsements.
You are strongly recommended to take a backup of your system before major installation and backups at regular intervals.
<!-- =========================== -->
<sect1>News
<p>
<itemize>
<item>V0.06 2007-02-09 (pre-release)
<item>V0.05 2007-02-05 (pre-release)
<item>V0.04 2007-02-05 (pre-release)
<item>V0.03 2006-12-12 (pre-release)
<item>V0.02 2006.12.11 First Draft (pre-release)
<item>V0.01 2006.11.13 webgenerated sgml form (pre-release)
</itemize>
<!-- =========================== -->
<sect1>Credits
<p>
I used many resources to do what I did. A big thank you to all those that have contributed to these projects. They include but are not limited to:
<itemize>
<item>http://www.linuxjournal.com/article/7246
<item>http://www.openvpn.net/howto.html
<item>http://www.damnsmalllinux.org
<item>http://www.ubuntu.com
</itemize>
<!-- =========================== -->
<sect1>Translations
<p>
Currently there are no translations.
If you would you like to translate this, Please contact me at
jefferydouglaswaddell (at) gmail (dot) com .
<!-- =========================== -->
<sect>Theory
<p>
To begin, I will attempt to lay out the problem a little more thoroughly and give the theory behind the prototype.
<p>
In the case of the Institution, there is a set of machines that are behind a very robust firewall. This firewall allows VERY little to go through. As far as connecting out to the Internet, many things, including access to HTTP, FTP, secure shell, etc., are allowed. As far as connecting in, none of those are allowed.
<p>
You can imagine the firewall as a set of machines on the edge of our internal network. There is a lot of unsecured traffic within our internal network, which has both private networks and internet addressed clients within it. To be allowed to do any of the things that require a connection INTO the network from the Internet, a server allowing the connection must be on the periphery of the network (i.e. part of the firewall).
<p>
The desire has been to be able to access the internal network sufficiently to do work from home (on par with doing work in the office), but without opening up the firewall such that our unsecured traffic would be exposed to the Internet. There is also sensitive, internal data within the internal network that can be accessed, that should neither be copied to the home machine (laptop, etc.) nor printed at the home machine.
<p>
So the question becomes: how do you allow enough access to give certain people the ability to do their jobs from home and still protect the sensitive information and the network as a whole? Other security considerations that came up were:
<itemize>
<item>The potential for a laptop with sensitive information on it to be stolen.
<item>A home machine to being used in a way that breaks policy and yet can't be traced or effectively enforced due to it's off-site actuality.
</itemize>
<p>
The answer that came to my mind was to give the users a boot CD that they could place in a machine (whether at Uncle Joe's, their own house, or the internet cafe at the airport) and use to boot into their internal work desktop. The theory is that connecting to a server on the periphery of the network, which then gives them access to their desktop, is at least as secure as if they had accessed the network from their internal desktop, and that a great deal of control can be exercised over when and how that access is granted. Being a boot CD, no on-site OS configuration will be required, nor will extra precautions concerning malware, spy-ware, or viruses need to be taken. In the next section, Technologies, I will examine some of the ways this can be implemented, and in the Implementation section I will explain how we actually did it.
<!-- =========================== -->
<sect>Technologies
<p>
Since many people are already familiar with openVPN, this seemed like a good idea. However, in and of itself openVPN is not sufficient. The most convenient way for people to be able to work is for them to be able to directly connect to their already existing desktop. All of the users here run either Windows XP (tm) or Windows 2000 (tm), which suggests rdesktop as a solution. But rdesktop can't get through the firewall and we won't open our firewall for that traffic as it would be too hard to secure. Adding openVPN allows for more security, but it runs into the following problems within the scope of our implementation:
<enum>
<item>We would have to set up openVPN server on EACH internal desktop and each external client machine (at home, at the Internet cafe, or wherever) and it would therefore be highly subject to IT time and in general be a pain to get set up and working for each separate user's setup.
<item>If you allow a direct remote session (even over openVPN) you run into several potential security risks.
<enum>
<item>key loggers on the external client box
<item>attacks directly on the internal Windows(tm) box through the VPN ports that are now open and exposed on the Internet.
<item>viruses, spy ware and other malware on the client box infecting the internal workplace desktop (and any others that it has connection with) through the established VPN connection.
<item>having the private key stored on multiple desktops around the organization on unsecured desktops. Someone with access to that key (which would need to be on the internal machine in order to establish the VPN connection) could allow unauthorized key-making.
<item>Only the specific external machine that is setup by IT services personnel would be able to connect and use the resources, when what is actually desired is that the authorized user can get access from anywhere.
</enum>
In order to eliminate the security issues above and to make it less of a difficult system to maintain into the future, I suggested creating a Linux live CD that boots, logs into an openVPN server that connects the external and internal networks, and then automatically opens the individuals internal desktop using rdesktop.
<!-- =========================== -->
<sect>Implementation
<p>
Many decisions had to be made as to which direction to go. The following subsections detail some of the paths I took to get to a working prototype. Please modify to suit your environment. Where appropriate I will make clarifying comments.
I looked at several live CD distributions and concluded that DSL would work best for the purposes at hand. I considered the following:
<enum>
<item>Ubuntu. This live CD expects a relatively high-end machine and has way more applications than would be useful to this project. Instead of trying to remove tons of applications and whittle it down I opted not to use this one. It could be a good choice though if you are trying to give people a full desktop PLUS access to an internal network.
<item>PuppyLinux. This live CD looked really good, however I had trouble figuring out the SFS file system it uses for its root, and was able to get to instructions and tools on how to deal with the Knoppix compressed file system much more easily.
<item>Knoppix. This live CD, like Ubuntu, was too top heavy for the specific purposes of this project.
<item>Damn Small Linux. This live CD has a 50 MB footprint, will work on almost anything hardware-wise, and is what I chose to implement.
</enum>
<sect1>Getting and modifying a DSL-based .ISO file.
<p>
The choice of DSL means that we are relying on DSL's built in ability to automatically find, configure and attach to a network via DHCP. DSL's wireless support is very minimal and thus we do not support wireless at this time. The end user will need a machine that normally attachs to the Internet through DHCP from their provider and uses a normal wired network card to do so.
<enum>
<item>Fresh install of Ubuntu (http://www.ubuntu.com), EdUbuntu (http://www.edubuntu.org), xUbuntu (http://www.xubuntu.org), or kUbuntu (http://www.kubuntu.org)
<item>Use Synaptic to add repositories (all available)
<item>Install qemu, open-vpn and cloop-utils
<item>Get an ISO (I recommend the dsl-3.0 ISO); hopefully I'll soon have one of my prototype CD images (sans VPN keys) available on the Internet for your downloading pleasure. Refer the Examples section - this ISO might be a good place for you to start.
<item>Test it in an emulator (I tend to enjoy qemu...use whatever you like: vmware, xen, ?)
<tscreen><verb>qemu -boot d -cdrom yourvpn.iso</verb></tscreen>
</enum>
<item>Repeat as necessary to get the desired ISO image.
<item>Burn image and enjoy.
</enum>
<sect1>Comments on modifying the software on the CD.
<p>
<enum>
<item>Unpack openvpn*.deb to the root file system after chroot.
<item>Make sure all the proper libraries were copied to the proper place.
<enum>
<item>chroot
<item>ldd /usr/sbin/openvpn
<item>Go to the other root terminal on the main system and copy any libraries from the main system to the vpn-tree
<item>Make the tun node:
mknod /dev/net/tun c 10 200
</enum>
<item>Remove the loading of the DSL business card graphic by editing the vpn-cd-tree/boot/isolinux/boot.msg file and removing "^Xlogo.16"
<item>Cause it not to wait for boot options by editing vpn-cd-tree/boot/isolinux/isolinux.cfg and changing the line that says "PROMPT 1" to "PROMPT 0"
<item>Edit the file vpn-tree/etc/skel/.xinitrc to reflect what we wish to happen on the desktop. Remove code to load icons onto desktop; remove code to make the windows see through; add code to establish VPN connection; add code to load rdesktop and make connection to correct machine.
<item>Edit the display screen for boot.
<enum>
<item>copy vpn-cd-tree/boot/isolinux/minirt24.gz to /tmp
<item>gunzip minirt24.gz
<item>mount -o loop minirt24 /mnt
<item>edit /etc/linuxrc to display text indicating Institution's name (you would put whatever is appropriate for your institution here) instead of "DSL"
<item>umount /mnt
<item>gzip minirt24
<item>copy minirt24.gz over to vpn-cd-tree/boot/isolinux/minirt24.gz
</enum>
</enum>
<sect1>Setting up multi user OpenVPN server.
<p>
<enum>
<item>Follow instructions on making cert and keys for the server.
<item>You will need to enter several pieces of information that are covered in the openVPN HOWTO.
<item>Remember to create a password-protected key for the client.
<item>Set all the configuration as desired.
<item>For each client you will need to
<enum>
<item>make a password-protected key using the certificate
<item>place the certificate, and client key (only) in the vpn-tree/etc/openvpn/keys directory
<item>adjust the vpn-tree/etc/openvpn/openvpn.cfg file to have the proper key files indicated (see the server configuration file in the Samples section)
<item>adjust the added routes in the vpn-tree/opt/bootlocal.sh
<item>adjust the vpn-tree/etc/skel/.xinitrc to point to the correct rdesktop IP.
</enum>
<item>Rebuild the CD.
<item>Test in the emulator.
<item>Once it works correctly, either burn the ISO or make a qemu Windows emulator version by placing the .ISO in the win-qemu-yourvpn-cd directory and building that .ISO (don't forget to burn it afterwards).
Once built there is NO maintenance to the CDs. If you need to change the private key password for the individual user, burn them a new CD. If they lose a CD, give them a fresh burn. If the CD gets destroyed, give them a new copy.
The openVPN server requires little maintenance. It is recommended that you periodically check the openVPN logs on the server to determine the likelihood of nefarious activity and act accordingly. Usage-tracking is beyond the scope of this document.
<!-- =========================== -->
<sect>Advanced Issues
<p>
I believe that the majority of security and ease of use issues are dealt with by the technologies I have described here. Certainly there are many issues that this technology could expose (mostly internal political or policy issues within your own institution).
If you discover any flaws in the technology. Please contact me about it.
Also, if you can explain the proper pf rules to get *bsd to properly forward (masquerade the 10. network) packets to Internet-routed network segments on the internal side of the VPN, I would definitely like to hear from you. I could not get it to work, whereas the Linux masquerading rule I found just works.
<!-- =========================== -->
<sect>Features
<p>
<enum>
<item>Ease of use for the end user:
<enum>
<item>Put in CD
<item>Boot machine
<item>Type in private key password
<item>Log into work desktop and work as usual
</enum>
<item>Ease of use for the administrator(s):
<enum>
<item>Key generation is separate from use.
<item>A user's access can be specifically revoked (without affecting their work desktop) using a single command.
<item>All new users can be denied by shutting down the openVPN server process on the server.
<item>All connections can be broken by shutting down the entire server; this will also deny future access until the server is brought back up and the end user reboots.
</enum>
<item>The CD build process can be automated for ease of creation.
<item>The openVPN logs can be used to determine (or trace) nefarious or out-of-policy computer use.
</enum>
<!-- =========================== -->
<sect>Troubleshooting
<p>
There are several troubleshooting techniques that I used in the course of this project. I would expect people attempting this to be familiar with most or all of them. Here are a few:
<enum>
<item>tcpdump is your friend when attempting to prove that your traffic really is going over the VPN.
<item>ldd is very helpful in finding out what libraries are missing when you have to install a package by hand.
<item>qemu or another emulator is priceless when you don't wish to waste a bunch of physical CDs or the time it takes to burn and boot them.
</enum>
<!-- =========================== -->
<sect>Further Information
<p>
As mentioned elsewhere, please see http://openvpn.net for more information on openVPN...the HOWTO is especially good.
Please see http://damnsmalllinux.org for more info on DSL.
For live CD information, Google may be your best bet, although there is now a live CD book that seems fairly good.
<!-- =========================== -->
<sect>Getting Help
<p>
Obviously the above mentioned communities can help you with varying aspects of the respective pieces of this puzzle.
If you need help understanding how to put it all together, feel free to contact me after you've thoroughly read (and maybe tried) this HOWTO.
<!-- =========================== -->
<sect>Concluding Remarks
<p>
There you have it. May it be of use.
<!-- =========================== -->
<sect>Questions and Answers
<p>
When I receive questions generated from this document I will compile them and insert them here.
<!-- =========================== -->
<sect>Bits and Pieces
<p>
<sect1>Making a Windows autorun CD.
<p>
Due to a policy decision, we will not be deploying this, although it does work. The security concerns over this method include the following:
<enum>
<item>Key logger on the host Windows (tm) machine. This could conceivably be used to capture the private key password and potentially grant unauthorized access.
<item>Malware on the host Windows (tm) machine. Might be able to send through the VPN...seems unlikely.
<item>A virus on the host Windows (tm) machine. Might be able to propagate itself through to the internal network...again this seems unlikely.
</enum>
This is what you do to create one. This method is likely useful for other projects.
<item>Burn the ISO and try it on a Windows (tm) box.
</enum>
<!-- =========================== -->
<sect>Examples
<p>
Here is the config file (with IP address and key names removed for the CD). Text in upper case is used to indicate that you need to change whatever is there to your setup.
----------------
<tscreen>
<verb>
##############################################
# Sample client-side OpenVPN 2.0 config file #
# for connecting to multi-client server. #
# #
# This configuration can be used by multiple #
# clients, however each client should have #
# its own cert and key files. #
# #
# On Windows, you might want to rename this #
# file so it has a .ovpn extension #
##############################################
# Specify that we are a client and that we
# will be pulling certain config file directives
# from the server.
client
# Use the same setting as you are using on
# the server.
# On most systems, the VPN will not function
# unless you partially or fully disable
# the firewall for the TUN/TAP interface.
;dev tap
dev tun
# Windows needs the TAP-Win32 adapter name
# from the Network Connections panel
# if you have more than one. On XP SP2,
# you may need to disable the firewall
# for the TAP adapter.
;dev-node MyTap
# Are we connecting to a TCP or
# UDP server? Use the same setting as
# on the server.
;proto tcp
proto udp
# The hostname/IP and port of the server.
# You can have multiple remote entries
# to load balance between the servers.
remote PUT_YOUR_OPENVPN_SERVER_IP_HERE 1194
;remote my-server-2 1194
# Choose a random host from the remote
# list for load-balancing. Otherwise
# try hosts in the order specified.
;remote-random
# Keep trying indefinitely to resolve the
# host name of the OpenVPN server. Very useful
# on machines which are not permanently connected
# to the internet such as laptops.
resolv-retry infinite
# Most clients don't need to bind to
# a specific local port number.
nobind
# Downgrade privileges after initialization (non-Windows only)