In this lesson we're going to talk
about the CIA triad.
Now this is important because
by default our networks are fundamentally not secure.
When they were developed and all
these different networking standards
were created many years ago,
security was not in the discussion.
Instead, over the years we've tried to bolt on
and add on security as we go
to make these networking protocols more secure.
But to begin with, a network is a very unsecure place.
We have to be careful in order to minimize
and eliminate these risks over time,
and that's where network security is going to come into play.
If we can understand the various threats
that are facing our networks,
then we're going to be better able
to defend our networks against the onslaught
of cyber attacks then we are facing on a daily basis.
The way we look at security in our networks
is based on something called the CIA triad.
Now this stands for confidentiality,
integrity, and availability.
Those are the three tenants
that make up this triad that give us security.
We're going to talk more about these three components
of the CIA triad in this lesson.
Our first one is C for confidentiality.
Now, confidentiality is concerned
with keeping your data safe and private.
We want to use things like encryption
and authentication to verify that somebody has the need
to know and that they should be allowed to see that data.
By using encryption, we can ensure
that data can only be read
or decoded by the intended recipient,
and that person is going to have a secret encryption
or decryption key to be able to read it.
Now, to do this, we can use either symmetric encryption
or asymmetric encryption.
Now if you're not familiar with those concepts,
we're going to cover them here for you
to bring you up to speed.
Symmetric encryption is something
that is the basis of confidentiality.
Both the sender and the receiver are going to use
the exact same key, which is why we call it
symmetric encryption or symmetric key cryptography.
Now we can go from plain text to cipher text using one key,
and then the other person who wants to read it will use
that same key to decrypt it from cipher text back
into plain text so they can actually read it
in normal language.
In fact, symmetric encryption is almost 1,000 times faster
than using asymmetric encryption
where we use two different keys.
Now we're going to cover asymmetric encryption
in just a second, but first we need to talk
about some problems with symmetric encryption.
Now, there is one large problem
with symmetric encryption though,
and this is that we both have to have the same key
to encrypt and decrypt that data.
Now, if you and I have never met before,
how are we going to make sure we both
have the same shared key?
Well, if I'm doing this on a large scale,
let's say I encrypted a folder on my Google Drive
that I wanted to share with all of my students.
I would have a 300,000 people who need to access
that Google Drive, and I have to give each
of them a copy of that key.
That'd be a really hard task to do and to do it securely.
Now, let's imagine that one
of those students shouldn't have access anymore.
Now I have to go and change that key
and give it to the other 299,999 people
who still need access, and I have to have a secure way
to redistribute that new key to all
of those people who still need to access it.
You see, this is the biggest problem we have
with symmetric encryption.
It's key management.
Even though symmetric encryption is fast,
and even though it's secure, we still have
to figure out a way to get a secured, shared secret key
to all the users who need to use it.
So how are we going to solve that problem?
Well, enter the world of asymmetric encryption.
Now, asymmetric encryption is used to give confidentiality
as well, but it does this by using two different keys,
one for the sender and one for the receiver.
Now, RSA is by far the most popular implementation of this,
and it uses what we call public key infrastructure, or PKI.
Now PKI is where we encrypt the data
between an email sender and an email receiver,
or when you're going to an e-commerce site like Amazon,
you're going to be using PKI to do a key exchange.
This way, you can get a secure email exchange
or secure web browsing, and it solves the problem
of having to distribute those keys ahead of time
because we're using public keys.
So how does asymmetric encryption work?
Well, it works on the concept of having a key pair.
This key pair is made up of a public and a private key.
The public key, anybody can know,
and we can share with everyone in the entire world.
But the private key is something that only I should know
and nobody else should see it.
Let's see how this works in the real world.
Well, when we look at this, there's a sender and receiver,
and they're both going to use different keys
to encrypt and decrypt the message.
In this case, if I'm the sender,
and I want to send something to the receiver,
I'm going to use the receiver's public key,
which everyone in the world can know because it's public.
Now, once I've encrypted that data using their public key,
the only key in the entire world that can open up
that message and decrypt it,
is going to be their private key.
And the only person with that private key is that receiver.
So we know it has confidentiality
'cause only they can decrypt this message.
This guarantees that we're going to have confidentiality
of the data because nobody can read it except them,
and once I encrypt that data, even I can't read it
because I don't have the receiver's private key.
So how does this work if we're going to use
e-commerce for instance?
Well, I said before that we can use asymmetric keys
as a way to do a key exchange,
and we're going to be able to share a symmetric key
through that by creating an encrypted tunnel.
So what we're going to do here in e-commerce
is using asymmetric to then turn over to symmetric.
In this case, if I wanted to be the client,
and I wanted to go to Amazon to buy something,
I would do it this way.
First, I'm going to request the website by going to amazon.com,
and I'm going to use the secure version of the website
by going to https://amazon.com.
Now, when I go to that server, the server is going to tell me
that it has a public key available.
That public key is going to have
what we like to call a digital certificate.
Now, when you buy a Verisign certificate
or some other trusted certificate for your server,
that server is going to then hold a copy of your public key
for you and any client who wants to get it can go to
that trusted third party and get a copy of your public key.
So my web client is going to go to Verisign,
it's going to grab Amazon's public key,
and then I'm going to create a random number
and whatever I'm going to choose,
and I'm going to encrypt that random number
using the public key that Amazon has.
Now, I'm going to send that back over to the Amazon server
because Amazon will be the only person who can unlock
that message and decrypt it using their private key,
which is part of their server code.
Now, they can open that message and see that random number.
So now that they have the random number I chose,
I know it because I chose it, and they know it
because they decrypted the message.
So we've used a asymmetric encryption to be able
to pass this random number,
which will now act as our symmetric key.
Now we can both create a tunnel,
and that tunnel can be secured
by that symmetric key we just chose,
and we can use that for the entire session.
This becomes known as a session key, which is simply
that random number that I chose and sent over to Amazon.
Now we can communicate securely for the rest of the session,
creating a nice, secure encrypted tunnel
between me and the Amazon server.
Now, why would I do it this way?
Why wouldn't I just use an asymmetric key
the entire time it sent data back and forth?
Well, the problem is asymmetric is pretty slow.
In fact, symmetric key is a thousand times
faster than asymmetric.
So we want to use symmetric to the maximum extent possible,
but there's some things that symmetric doesn't do well,
like a key exchange.
So for that reason, we're going to use asymmetric
to do the handshake and exchange a key,
and then we're going to switch over to symmetric using
that key we just exchanged to get those faster speeds
for all the rest of our data transfer.
All right, the next thing we need
to talk about is the I in the CIA triad.
This is integrity.
Now, integrity is all about making sure
that the data you have was not modified
in storage or in transit.
This verifies that the source of the traffic
that it originated from was where you thought it came from.
We're not going to be subject to an on path
or man in the middle attack here
because we want to make sure that that data has integrity.
Also, this will help us prevent forms
of spoofing like IP spoofing, ARP spoofing, or Mac spoofing.
Integrity violations can also happen
if there's a defacement of your corporate webpage,
for example, because somebody is changing the data
on your server, and you didn't authorize it.
All these are examples of integrity violations.
Now, another example of this would be
if somebody went to your e-commerce site,
and they went to buy a product that's supposed to sell
for a hundred dollars, but they actually changed that to $10
by removing a zero, that would be an integrity breach
because they also modified the electronically stored
financial records on your server.
So what if I decide to add a couple of zeros
to my bank account balance?
Guess what?
That's also an integrity breach
because I'm changing the balance,
and I'm not authorized to do that.
All of these things are things that we don't want
to happen inside of our network.
So how do we ensure that we have integrity?
Well, we're going to use hashing.
Now, hashing is an algorithm that runs a string of data
through the algorithm and then it creates
a hash or a hash digest.
This serves as a unique individual fingerprint
for a file or a data set.
All right, if you see here on the screen,
I have the word password written in three different ways
I have it written as password,
I have it written as password with a capital P,
and I have it written as password
with a capital P and a period at the end.
Notice, those three hashes are vastly different
even though I changed very little, just adding a period
or changing a letter from lowercase to uppercase.
In this example, I'm using an MD5 hash for each one
of these, and this algorithm ensures drastic changes
to the output when a slight change is made to the input.
Now by just adding that period
or making a capital letter instead of a lowercase letter,
we have this huge amount of change to the hash digest.
That's how we're using them as individual fingerprints.
Once I run this data through the algorithm,
I get this hash, and the data and the hash
are then going to be sent over to the receiver.
Now, when the receiver gets the data, they're going to run it
through the same hash on their own side
and compare that hash that they get
to the hash that I sent them.
If the two are going to match,
that means there's integrity in the transmission.
If they don't match, it's going to reject that transmission
and ask for it to be sent again
because it assumes it was bad
or there was some kind of an integrity breach.
All right, let's move to our third component
of the CIA triad.
This is the A for availability.
Now availability is going to measure
the accessibility of that data.
Can I get to the data when I want to and where I want to?
That's what we're asking here.
This is increased by designing redundant networks,
by having multiple components doing the same functions.
We're going to talk a lot more about redundant networks
and talk about high availability
and redundancy in a separate lesson
as we start digging more into how we can create
good availability within our networks.
But for now, let's talk about
how availability could be compromised.
Well, there's lots of different things
that you can do to hurt your availability.
You could crash a router or switch
by sending improperly formulated data to it,
like the old ping of death attack,
and that would actually turn off your router or switch
and make the entire network go down.
Therefore, your availability would be failed as well.
Now, you can also flood a network with just so much traffic,
even if it's legitimate requests,
that they simply can't be processed in time.
This is known as a denial of service
or distributed denial of service attack,
and this can make your network fail as well.
This can also happen when you have a good problem.
For instance, if my site became wildly popular overnight
and had a million people try
to access it all at the same time,
that could crash my website
because I became too popular too fast.
This would also be considered a denial of service,
even though it was more of a self-imposed one
by becoming too popular.
Now, you can also have a power outage in your area
and that could cause your network to fail.
Or maybe there's a flood
and your server room is now underwater, and guess what?
That's going to take a hit to your availability as well.
All these are things that can really hurt you.
Maybe you have some really old routers
and switches that are out of warranty
and one of them dies from old age.
Well, that's going to hurt the availability of your network
because the network is going to go down
when that core switch goes down.
I think you get the idea,
but we will dive deeper into this later on
as we cover availability more in depth.