5.5. Virtual Private Networks
A
virtual private network (VPN) is a way of
employing encryption and integrity protection so that you can use a
public network (for instance, the Internet) as if it were a private
network (a piece of cabling that you control). Making a private,
high-speed, long-distance connection between two sites is much more
expensive than connecting the same two sites to a public high-speed
network, but it's also much more secure. A virtual private
network is an attempt to combine the advantages of a public network
(it's cheap and widely available) with some of the advantages
of a private network (it's secure).
Fundamentally, all virtual private networks that run over the
Internet employ the same principle: traffic is encrypted, integrity
protected, and encapsulated into new packets, which are sent across
the Internet to something that undoes the encapsulation, checks the
integrity, and decrypts the traffic.
Virtual private networks are not exactly a firewall technology, but
we discuss them here for several reasons:
- If you're using virtual private networking, you need to be
careful about how it interacts with the firewall. In many cases, the
firewall can't control traffic that comes in over the virtual
network, which makes it a way to avoid the firewall controls and open
new insecurities.
- A firewall is a convenient place to add virtual private networking
features.
- We will frequently mention virtual private networking as a way to
provide remote services that cannot be provided securely using other
firewall techniques.
5.5.1. Where Do You Encrypt?
Virtual private networks depend on
encryption. That encryption can be done as a transport method, where
a host decides to encrypt traffic when it is generated, or as a
tunnel, where traffic is encrypted and decrypted somewhere in between
the source and the destination. The question of where you do the
encryption and decryption relative to your packet filtering is an
important one. If you do the encryption and decryption inside the
packet filtering perimeter (i.e., on your internal net), then the
filters just have to allow the encrypted packets in and out. This is
especially easy if you're doing tunneling, because all the
tunneled packets will be addressed to the same remote address and
port number at the other end of the tunnel (the decryption unit). On
the other hand, doing the encryption and decryption inside your
filtering perimeter means that packets arriving encrypted are not
subject to the scrutiny of the packet filters. This leaves you
vulnerable to attack from the other site if that site has been
compromised.
If you do the encryption and decryption outside the packet filtering
perimeter (i.e., on your perimeter net or in your exterior router),
then the packets coming in from the other site can be subjected to
the full scrutiny of your packet filtering system. On the other hand,
they can also be subjected to the full scrutiny of anyone who can
read traffic on your perimeter net, including intruders.
5.5.2. Key Distribution and Certificates
As with any encryption and
integrity protection system, key distribution can be a very sticky
problem. A number of choices are available, including sharing keys or
using a public key system; see
Appendix C, "Cryptography", for
descriptions of these systems and the advantages and disadvantages of
each.
5.5.3. Advantages of Virtual Private Networks
Most of the advantages of virtual
private networks are economic; it's cheaper to use shared
public networks than it is to set up dedicated connections, whether
those are leased lines between sites or modem pools that allow
individual machines to connect to a central site. On the other hand,
virtual private networks also provide some security advantages.
5.5.3.1. Virtual private networks provide overall encryption
A virtual private network conceals
all the traffic that goes over it. Not only does it guarantee that
all the information is encrypted, but it also keeps people from
knowing which internal machines are being used and with what
protocols. You can protect information from snooping by using
individual encrypted protocols, but attackers will still have some
idea what machines are talking and what kind of information
they're exchanging (for instance, if you use an encrypted mail
protocol, they will know that things are being mailed). A virtual
private network conceals more information.
5.5.3.2. Virtual private networks allow you to remotely use protocols that are difficult to secure any other way
Some protocols are extremely difficult to provide securely through a
firewall. For instance, a number of protocols used on Microsoft
systems are based on SMB, which provides a wide variety of services
with different security implications over the same ports and
connections. Packet filtering and proxying both have trouble adding
security to SMB. Virtual private networking provides a way to give
remote access for these protocols without letting people attack them
from the Internet at large.
5.5.4. Disadvantages of Virtual Private Networks
Although virtual private networks are an important security tool,
they also present problems in a firewall environment.
5.5.4.1. Virtual private networks involve dangerous network connections
A virtual private network runs over an actual network, which is
presumably not a private network. The hosts on the virtual private
network must be connected to that actual network, and if you're
not careful, they will be vulnerable to attack from that network. For
instance, if you use a virtual private network to provide
connectivity to your internal network for mobile users who connect to
the Internet, their machines may be attacked from the Internet.
Ideally, a virtual private network system will disable all other uses
of the network interface. It's important to choose a system
that will allow you to force this on the remote system. It's
not good enough to have a system where the remote system is able to
turn off other uses because the user on the remote system may turn
networking back on. It's very tempting as a way to get rapid
access to Internet resources.
5.5.4.2. Virtual private networks extend the network you must protect
When you attach something via a virtual private network, you are
making it part of your internal network. If a machine on the virtual
private network is broken into, the attacker will then be able to use
the virtual private network to attack the rest of your site, from
something that's treated as if it were inside of your local
network. Virtual private networking is commonly used to give access
to machines that are much more vulnerable than those that are
physically on the network -- for instance, laptops that are
carried around in public, home machines that curious children have
physical access to, and machines owned by other sites with interests
and policies that are not identical to yours.
Even if the virtual private network disables other uses of the
network interface it is running over, the machine may have other
network interfaces. This can make it into a gateway between your
network and others, inside your network's security perimeter.
Because of this, you want to be careful how you attach the virtual
private network to your real private network, and how you secure the
remote end. It may not be appropriate to make the virtual private
network a seamless part of your internal network. Consider putting in
a subsidiary firewall or at least special intrusion detection to
watch for problems.
| | |
5.4. Network Address Translation | | 6. Firewall Architectures |