Welcome to this video,
where I want to talk at a high level
about hardware security modules known as HSMs.
Now, these are a really important
type of device to understand both in general
and especially if you currently work in
or want to work in the security space,
because so many other things rely on them to function.
Now let's jump in and step through why we need them,
what they are, and how they work.
Now let's start by looking at the world
without hardware security modules.
And we're going to do that with the example
of a virtualized environment.
And so we have a VM host,
and this could be VMware, Xen,
or something within a cloud environment.
It doesn't matter for this example.
This means that we have some physical CPUs, memory,
as well as mechanical or solid-state storage.
Running on this is our hypervisor,
a pair of operating systems,
and to keep this simple, a pair of applications.
Now, I want you to imagine that these applications,
the operating systems, and the hypervisor
are all using encryption in some way.
That might be encryption at rest or in transit,
it might be public key infrastructure,
or it might be simple SSL or TLS.
Whatever the requirement,
it means you're going to have keys stored in many places,
keys inside the applications
controlled by the operating system
or held by the hypervisor.
And all of this means that keys will be handled by the CPU,
held in memory, and stored on storage.
And over time, if you care about disaster recovery,
you're going to have keys stored on various backups,
some of which might go offsite for storage.
Using encryption means using keys,
and these keys will be stored or held in various places.
You might think this is controllable,
but over time they will leave your premises,
and because of this your direct control,
meaning it becomes easier
for these to fall into the wrong hands and become exploited.
Now, that's where HSMs add value, so let's take a look.
Now, this is a similar architecture,
the same hypervisor,
the same set of operating systems and applications,
and the same backup infrastructure,
only now we've chosen to utilize a HSM.
A HSM or hardware security module, as the name suggests,
is a separate device or cluster of devices.
It's isolated from your main infrastructure,
and it's inside this device that your keys are stored.
They never leave this device.
They're managed by this device,
often generated and deleted by this device.
Anytime you want to perform cryptographic operations,
you send those to the HSM together with the data.
The HSM performs cryptographic operations
and sends the result back.
It means you keep the same application
and virtualization architecture,
but instead of having to generate,
manage, store, and secure keys and risk those leaking,
with HSM the keys are securely held on device.
So that's HSMs at a high level.
Let's finish by exploring the architecture in more detail.
So now we have our HSM in the middle.
Think of this as 100% separated
from the rest of our infrastructure,
accessible only in a highly defined way.
Keys are created on the HSM, stored on the HSM,
operations happen on the HSM,
and keys generally never leave the device.
By utilizing HSMs,
you create a secure island within your infrastructure
where all cryptographic operations are controlled from.
Now, authentication takes place inside the device.
This means you have an isolated security blast radius.
Even if your corporate identity store was exploited,
the identities used within a HSM are internally defined
and so can withstand this type of exploit.
HSMs are tamper-proof
and they're hardened against physical and logical attacks.
The devices use secure enclaves internally,
which makes it almost impossible
to gain access to the internal key material
through direct physical means.
Many smartphones today
come with a similar cut-down version of this.
It stores your biometric information to keep it isolated
from any badly behaving software on your smartphone.
Access to cryptographic operations within the HSM
is tightly controlled.
You need access,
but assuming you have those access permissions,
this access is still via industry standard APIs
such as PKCS#11, JCE, and CryptoNG.
Nothing is directly accessible.
It's all controlled via APIs.
Now, there's even role separation for admins,
so you can define people who can admin the HSM
for things like software updates,
key generation, and other admin tasks,
but those people might not be able
to perform cryptographic operations.
Many HSMs are audited to some very stringent standards,
such as those required for US government use.
And it's this auditability, this access control,
which makes them such a powerful type of device.
Examples of the types of situations
where you might use a HSM,
and this is a very small subset, there are many others,
but you might use it to offload processing
for SSL or TLS onto the HSM.
So if you have a fleet of web servers,
you might have the HSM device
perform the heavy lifting on your behalf
instead of the web servers.
HSMs often handle this in hardware using acceleration,
so you gain the benefits of secure key management
and the performance boost via offloading.
You might also use HSMs
for signing certificates for a private PKI infrastructure
that you have within your business.
This just provides a way that you can securely manage
the key material used to sign your certificates.
Now, I wanted to keep this video brief
and just provide a very high level introduction
because I'm going to be making
many more videos in this series.
In order for those to make sense,
you need to understand why HSMs are needed,
what they do, and how they work at a high level.
And so that's what I covered in this video.
Now, I hope you've enjoyed it,
but that's everything for now.
So go ahead and complete the video,
and when you're ready,
I look forward to you joining me in the next.