Skip to content

Commit 5298a91

Browse files
committed
VPN section first pass
1 parent 1b21ece commit 5298a91

File tree

2 files changed

+196
-17
lines changed

2 files changed

+196
-17
lines changed

figures/Slide43.png

158 KB
Loading

systems.rst

Lines changed: 196 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -226,9 +226,14 @@ stored in various files in directory in the user’s home directory. For
226226
example, file ``~/.ssh/known_hosts`` records the keys for all the
227227
hosts the user has logged into, file ``~/.ssh/authorized_keys``
228228
contains the public keys needed to authenticate the user when logging
229-
into this machine (i.e., they are used on the server side), and file
230-
``~/.ssh/id_rsa`` contains the private keys needed to authenticate the
231-
user on remote machines (i.e., they are used on the client side).
229+
into this machine (i.e., they are used on the server side). The
230+
private keys needed to authenticate the user on remote machines (i.e.,
231+
keys that are used on the client side) are stored in a file whose name
232+
depends on the algorithm. For example, an RSA key would be stored in a
233+
file ``~/.ssh/id_rsa``; an ECDSA key would be stored in
234+
``~/.ssh/id_edcsa`` and so on. These files are usually encrypted with
235+
a secret passphrase to protect against the possibility of the private
236+
key being compromised by an attacker who gains access to the file.
232237

233238
.. _fig-ssh-tunnel:
234239
.. figure:: figures/f08-14-9780123850591.png
@@ -387,12 +392,12 @@ we discuss below.
387392
------------------------------------
388393

389394
A virtual private network (VPN) can be built using a wide variety of
390-
different technolgies, but any VPN requires that we establish
395+
different technologies, but any VPN requires that we establish
391396
connectivity among a set of endpoints. The connections must
392397
offer some level of privacy to the principals communicating between
393398
those endpoints. Furthermore, to qualify as a *virtual* private
394399
network, a VPN creates the illusion of being dedicated to a group of
395-
users, even though the underlying infrastucture is shared more
400+
users, even though the underlying infrastructure is shared more
396401
widely. In practice, this means that a VPN is almost always built as
397402
some sort of overlay on shared infrastructure.
398403

@@ -419,7 +424,8 @@ corporate office.
419424

420425
*Site-to-Site VPNs* are generally used to interconnect the sites of an
421426
enterprise, which could include datacenters, main corporate offices,
422-
and branch offices. Figure xxy.
427+
and branch offices. :numref:`Figure %s <fig-sitevpn>` shows a simple
428+
example for three sites of difference sizes.
423429

424430
.. _fig-sitevpn:
425431
.. figure:: figures/sitevpn.png
@@ -429,35 +435,208 @@ and branch offices. Figure xxy.
429435
A corporate VPN connects a main office, a branch office, and a datacenter.
430436

431437
Viewed at this level of abstraction, there are obvious similarities
432-
between VPN classes. They are not entirely non-overlapping but they
433-
help us identify the key requirements. The differences become apparent
438+
between these VPN classes. They are not entirely non-overlapping but they
439+
help us identify the requirements. The differences become apparent
434440
when we look at the types of devices that terminate tunnels and the
435441
methods used to establish them.
436442

437-
Remote access VPNs usually establish tunnels directly from a client device,
438-
such as a phone or a laptop, to some sort of VPN gateway or
439-
concentrator. Some sort of VPN client software performs this task,
440-
with Wireguard and OpenVPN being two examples of open source,
441-
multi-platform clients.
443+
Remote access VPNs usually establish tunnels directly from a client
444+
device, such as a phone or a laptop, to a device at the edge of the
445+
corporate network called a VPN gateway or concentrator. Some VPN
446+
client software performs this task, with WireGuard and OpenVPN being
447+
two examples of open source, multi-platform clients. There are plenty
448+
of proprietary options as well.
442449

443450
OpenVPN leverages TLS to build the encrypted tunnels from client to
444451
server. While this mostly follows the same protocol as described in
445452
Chapter 6, the additional step of authenticating the client is almost
446453
always required in VPN use cases, unlike most Web usages of
447454
TLS. Client certificates may be used, but this raises the issue of how
448455
certificates can be reliably distributed to client devices. One option
449-
is that they are provisioned by a corporate IT deparment as part of
456+
is that they are provisioned by a corporate IT department as part of
450457
setting up client devices. OpenVPN also allows for other
451458
authentication methods including username plus password and optionally
452459
multi-factor authentication.
453460

461+
WireGuard is a more recent implementation of encrypted tunnels that
462+
aims to address some shortcomings that have emerged over years of
463+
using IPsec and OpenVPN tunnels. The paper below from NDSS 2017 lays
464+
out the design philosophy of WireGuard. Compared to OpenVPN, it is
465+
less complex by virtue of reducing the set of cryptographic algorithms
466+
that it supports. It establishes "stateless" tunnels that are more like
467+
IPsec than TLS—that is, there is no transport connection to
468+
establish. It also uses the idea of pre-shared public keys for mutual
469+
authentication, similar to the approach used in SSH. Finally, it is
470+
implemented in the operating system kernel, another contrast to
471+
OpenVPN that improves performance. For further details we refer you to
472+
the paper.
454473

474+
.. admonition:: Further Reading
455475

456-
https://www.ndss-symposium.org/ndss2017/ndss-2017-programme/wireguard-next-generation-kernel-network-tunnel/
457-
458-
7.4.1 Mesh VPNs
476+
J. Donenfeld. `WireGuard: Next Generation Kernel Network Tunnel
477+
<https://www.ndss-symposium.org/ndss2017/ndss-2017-programme/WireGuard-next-generation-kernel-network-tunnel/>`__.
478+
NDSS, 2017.
479+
480+
One of these types of tunnels plus a gateway or concentrator to
481+
terminate them is pretty much all that is needed to deliver a remote
482+
access VPN. A concentrator is just an appliance that can handle a
483+
large number of VPN tunnels at once, and provides the necessary
484+
administrative controls for managing user accounts and interfaces for
485+
passing the VPN traffic on to the corporate network. Note that a
486+
remote access VPN will almost always have to solve the problem of how
487+
to get traffic through the corporate firewall. We cover firewalls in a
488+
later chapter, but it is generally the case that VPN traffic will be
489+
allowed to traverse the firewall so that the VPN user can access
490+
corporate resources. The problems of this approach are discussed in
491+
the firewalls chapter.
492+
493+
The main difference with site-to-site VPNs is that they aim to connect
494+
entire networks together, not just the devices of single remote
495+
users. And because office buildings don't move around the way users
496+
do, these VPNs are relatively static. Thus, one early approach to
497+
building site-to-site VPNs was to simply configure tunnels statically
498+
from a router at the edge of one site to a router at the edge of
499+
another. Keys could also be statically configured. This would be OK
500+
for a small VPN, but as the number of sites increases, the
501+
configuration overhead becomes considerable. Furthermore, there is not
502+
likely to be an on-site routing and security expert at every branch
503+
office, so the configuration would have to be set once before the
504+
router was shipped out to the branch and after that point, changes
505+
become difficult, especially if the router becomes unreachable for
506+
some reason. On top of this, if the connectivity among sites is
507+
anything other than a hub and spoke, then the issue of correctly
508+
configuring routing protocols to forward traffic across the mesh of
509+
tunnels becomes significant.
510+
511+
The complexity of configuring and managing a VPN comprised of
512+
encrypted tunnels is one reason why MPLS VPNs, which outsource
513+
most of the complexity of VPN management to a service provider, became
514+
such a successful service offering in the early 2000s. MPLS does not
515+
protect privacy using encryption, but it does solve the issues of routing
516+
traffic among large numbers of sites and ensures that the traffic
517+
belonging to one customer from does not leak to the network of another.
518+
519+
Several approaches to reduce the configuration overhead for VPNs using
520+
encrypted tunnels have appeared in recent years. With the rise of
521+
software-defined networking in the 2010s, several companies hit on the
522+
idea of using a centralized SDN controller to manage the configuration
523+
challenges outlined above. This approach, known as
524+
SD-WAN, became one of the successful commercial applications of SDN.
525+
526+
7.4.1 Software-Defined WANs
527+
~~~~~~~~~~~~~~~~~~~~~~~~~~~
528+
529+
Provisioning a VPN using MPLS, while less complex than most earlier
530+
options, still requires some significant local configuration of both
531+
the Customer Edge (CE) router located at each customer site, and the
532+
Provider Edge (PE) router to which that site would be connected. In
533+
addition, it would typically require the provisioning of a circuit
534+
from the customer site to the nearest point of presence for the
535+
appropriate Telco.
536+
537+
With SD-WAN, the assumption is that every branch and head
538+
office has connectivity to the Internet. An edge router is deployed at
539+
each site, and a centralized control plane is used to simplify
540+
configuration. An enterprise wants its sites—and only its authorized
541+
sites—to be interconnected by the VPN, and it typically wants to apply
542+
a set of policies regarding security, traffic prioritization, access
543+
to shared services, and so on. These policies are input to a central
544+
controller, which can then push out all the necessary configuration to
545+
the edge router located at the appropriate office. Rather than
546+
manually configuring a router or (multiple routers) every time a new site is added, or
547+
configuring tunnels by hand, it is possible to achieve "zero-touch"
548+
provisioning: an appliance is shipped to the new site with nothing
549+
more than a certificate and an address to contact, which it then uses
550+
to contact the central controller and obtain all the configuration it
551+
needs. Anything that is necessary to build site-to-site tunnels—IP
552+
addresses, routing configuration, secrets, etc.—can be pushed out from
553+
the central controller to the edge router. Changes to configuration or
554+
policies, which might affect many sites, are input centrally and
555+
pushed out to all affected sites. The idea is illustrated in
556+
:numref:`Figure %s <fig-sd-wan>`.
557+
558+
.. _fig-sd-wan:
559+
.. figure:: figures/Slide43.png
560+
:width: 600px
561+
:align: center
562+
563+
An SD-WAN controller receives policies centrally and pushes them
564+
out to edge switches at various sites. The switches build an
565+
overlay of tunnels over the Internet or other physical networks,
566+
and implement policies including allowing direct access to cloud
567+
services.
568+
569+
570+
It can be hard to determine exactly what properties of SD-WAN have
571+
made it popular, especially as vendors promote the features that
572+
distinguish their solution from the others. Unlike much of SDN, the
573+
control plane protocols used in SD-WAN tend to be proprietary. But it
574+
is certainly true that SD-WAN did enough to reduce the complexity of
575+
building and managing encrypted tunnels to drive adoption of this
576+
approach, often replacing MPLS-based VPNs.
577+
578+
An important benefit offered by SD-WAN over many earlier VPN
579+
approaches was to simplify the task of managing access from a branch
580+
office to a cloud service offered by a third party. It
581+
seems natural that you would choose to access those services directly
582+
from an Internet-connected branch, but traditional VPNs would
583+
*backhaul* traffic to a central site before sending it out to the
584+
Internet, precisely so that security policies could be controlled
585+
centrally. With SD-WAN, the central control over security policy is achieved, while the data
586+
plane remains fully distributed–meaning that remote sites can directly
587+
connect to the cloud services without backhaul.
588+
589+
590+
7.4.2 Mesh VPNs
459591
~~~~~~~~~~~~~~~
460592

593+
Another approach to VPNs that combines some of the features of remote
594+
access VPNs and site-to-site VPNs is referred to as Mesh VPNs. Like a
595+
remote VPN, a mesh VPN builds tunnels that terminate directly on
596+
client devices. However, rather than connecting the other end of the
597+
tunnel to a central VPN gateway or concentrator, mesh VPNs build a
598+
mesh of tunnels among client devices. The effect is to create a VPN
599+
that interconnects the set of authorized client devices almost as if
600+
they were on the same private LAN, even though they can be located
601+
anywhere in the Internet.
602+
603+
There are numerous implementations of the mesh VPN approach, with
604+
Tailscale being a well-known implementation that contains a mixture of
605+
open source and proprietary components. Tailscale is
606+
built using WireGuard as the tunneling protocol, and adds a control
607+
and management plane to ease the task of setting up and managing the
608+
mesh. For example, WireGuard makes the assumption that public keys
609+
have been set up at the tunnel endpoints before the tunnel is
610+
established; Tailscale supplies a central coordination service to
611+
generate and distribute those keys.
612+
613+
One notable aspect of Tailscale is that it assumes that client devices
614+
are likely to be sitting in networks that use private addresses and
615+
are connected to the Internet through a NAT (network address
616+
translation) device. This problem doesn't exist when building a tunnel
617+
to a VPN concentrator with a public IP address, or between a pair of
618+
edge routers, but it has to be solved if you want to build
619+
client-to-client tunnels. There are quite a few details to getting
620+
this to work, especially given that NAT devices don't all behave the
621+
same way, and there may be firewalls to travese as well. An IETF
622+
standard called STUN (Session Traversal Utilities for NAT) plays an
623+
important part, and the centralized control plane helps to resolve
624+
some of the more difficult corner cases. You can read more about the
625+
issues to be solved in the blog post listed below.
626+
627+
628+
Because mesh VPNs build tunnels all the way from client to client,
629+
they also avoid one of the drawbacks of traditional VPNs, which is the
630+
existence of trusted network zones, such as the network behind the
631+
firewall to which a remote access or site-to-site VPN would give
632+
access. In this respect they embrace the idea of zero trust
633+
networking, a topic we discuss in chapter 9.
634+
635+
636+
.. admonition:: Further Reading
637+
638+
A. Pennarun. `How Tailscale Works <https://tailscale.com/blog/how-tailscale-works>`__.
639+
Tailscale blog, 2020.
461640

462641

463642
7.5 Web Authentication (WebAuthn) and Passkeys

0 commit comments

Comments
 (0)